likec4 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/codegen/react.mjs +7 -8
- package/__app__/codegen/webcomponent.mjs +70 -881
- package/__app__/src/aichat/index.mjs +8 -1
- package/__app__/src/chunks/AIChat.mjs +959 -0
- package/__app__/src/chunks/DiagramActorProvider.mjs +7638 -0
- package/__app__/src/chunks/LikeC4Styles.mjs +1866 -0
- package/__app__/src/chunks/Markdown.mjs +146 -0
- package/__app__/src/chunks/NavigationPanel.mjs +61 -0
- package/__app__/src/chunks/ProjectsOverview.mjs +540 -0
- package/__app__/src/chunks/adhoc-editor.mjs +3386 -0
- package/__app__/src/chunks/es.mjs +439 -0
- package/__app__/src/chunks/hooks.mjs +145 -0
- package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +1894 -0
- package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
- package/__app__/src/chunks/libs/@mantine.mjs +12070 -0
- package/__app__/src/chunks/libs/@tabler/icons-react.mjs +252 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
- package/__app__/src/chunks/libs/@tanstack.mjs +2718 -0
- package/__app__/src/chunks/libs/@xstate/react.mjs +1982 -0
- package/__app__/src/chunks/libs/@xyflow/react.mjs +5256 -0
- package/__app__/src/chunks/libs/bezier-js.mjs +1003 -0
- package/__app__/src/chunks/libs/d3.mjs +2842 -0
- package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
- package/__app__/src/chunks/libs/framer.mjs +5872 -0
- package/__app__/src/chunks/libs/remeda.mjs +642 -0
- package/__app__/src/chunks/libs/zod.mjs +3170 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +23 -0
- package/__app__/src/chunks/styled-system.mjs +1040 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +14816 -14
- package/__app__/src/style.css +1 -1
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +2 -2
- package/dist/chunks/index2.d.mts +1877 -734
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +25 -25
- package/dist/chunks/libs/langium.mjs +1 -1
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/libs/zod.mjs +65 -0
- package/dist/chunks/node.mjs +73 -62
- package/dist/chunks/{plugin.mjs → vite-plugin.mjs} +41 -41
- package/dist/cli/index.mjs +184 -144
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/index.d.mts +52 -57
- package/dist/vite-plugin/internal/index.mjs +946 -1
- package/package.json +46 -47
- package/react/index.d.mts +92 -23
- package/react/index.mjs +44551 -42605
- package/__app__/chunks/AIChat2.mjs +0 -2
- package/__app__/chunks/DiagramActorProvider.mjs +0 -10
- package/__app__/chunks/EmbedPage.mjs +0 -1
- package/__app__/chunks/ExportPage.mjs +0 -2
- package/__app__/chunks/LikeC4Diagram.mjs +0 -19
- package/__app__/chunks/LikeC4Styles.mjs +0 -48
- package/__app__/chunks/Markdown.mjs +0 -1
- package/__app__/chunks/NavigationPanel.mjs +0 -1
- package/__app__/chunks/ViewReact.mjs +0 -1
- package/__app__/chunks/adhoc-editor.mjs +0 -1
- package/__app__/chunks/aichat.mjs +0 -1
- package/__app__/chunks/box.mjs +0 -1
- package/__app__/chunks/create-style-context.mjs +0 -1
- package/__app__/chunks/css.mjs +0 -1
- package/__app__/chunks/factory.mjs +0 -1
- package/__app__/chunks/hooks.mjs +0 -1
- package/__app__/chunks/hstack.mjs +0 -1
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
- package/__app__/chunks/libs/@mantine/core.mjs +0 -41
- package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
- package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
- package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
- package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -358
- package/__app__/chunks/libs/@tanstack/ai-client.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai-react.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
- package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
- package/__app__/chunks/libs/@xstate/react.mjs +0 -1
- package/__app__/chunks/libs/@xstate/store.mjs +0 -1
- package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
- package/__app__/chunks/libs/bezier-js.mjs +0 -1
- package/__app__/chunks/libs/copy-anything.mjs +0 -1
- package/__app__/chunks/libs/d3-path.mjs +0 -1
- package/__app__/chunks/libs/d3-shape.mjs +0 -1
- package/__app__/chunks/libs/fast-equals.mjs +0 -1
- package/__app__/chunks/libs/framer-motion.mjs +0 -9
- package/__app__/chunks/libs/html-to-image.mjs +0 -2
- package/__app__/chunks/libs/motion-dom.mjs +0 -1
- package/__app__/chunks/libs/nanostores.mjs +0 -1
- package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
- package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
- package/__app__/chunks/libs/remeda.mjs +0 -1
- package/__app__/chunks/libs/superjson.mjs +0 -1
- package/__app__/chunks/libs/zod.mjs +0 -64
- package/__app__/chunks/rolldown-runtime.mjs +0 -1
- package/__app__/chunks/styles.css.mjs +0 -1
- package/__app__/chunks/txt.mjs +0 -1
- package/__app__/chunks/useLikeC4Project.mjs +0 -1
- package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
- package/__app__/src/pages/EmbedPage.mjs +0 -1
- package/__app__/src/pages/ExportPage.mjs +0 -1
- package/__app__/src/pages/ProjectsOverview.mjs +0 -1
- package/__app__/src/pages/ViewAsD2.mjs +0 -1
- package/__app__/src/pages/ViewAsDot.mjs +0 -1
- package/__app__/src/pages/ViewAsMmd.mjs +0 -1
- package/__app__/src/pages/ViewAsPuml.mjs +0 -1
- package/__app__/src/pages/ViewEditor.mjs +0 -1
- package/__app__/src/pages/ViewReact.mjs +0 -1
- package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/chunks/libs/@hono/mcp.mjs +0 -70
- package/dist/chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/chunks/libs/ajv.mjs +0 -1
- package/dist/chunks/libs/ansi-align.mjs +0 -2
- package/dist/chunks/libs/ansi-regex.mjs +0 -1
- package/dist/chunks/libs/ansi-styles.mjs +0 -1
- package/dist/chunks/libs/atomically.mjs +0 -1
- package/dist/chunks/libs/boxen.mjs +0 -22
- package/dist/chunks/libs/conf.mjs +0 -1
- package/dist/chunks/libs/defu.mjs +0 -1
- package/dist/chunks/libs/destr.mjs +0 -1
- package/dist/chunks/libs/find-up-simple.mjs +0 -1
- package/dist/chunks/libs/get-port.mjs +0 -1
- package/dist/chunks/libs/hono.mjs +0 -1
- package/dist/chunks/libs/is-docker.mjs +0 -1
- package/dist/chunks/libs/is-error-instance.mjs +0 -1
- package/dist/chunks/libs/is-inside-container.mjs +0 -1
- package/dist/chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/chunks/libs/isexe.mjs +0 -1
- package/dist/chunks/libs/ky.mjs +0 -3
- package/dist/chunks/libs/p-debounce.mjs +0 -1
- package/dist/chunks/libs/p-limit.mjs +0 -1
- package/dist/chunks/libs/p-timeout.mjs +0 -1
- package/dist/chunks/libs/package-up.mjs +0 -1
- package/dist/chunks/libs/parse-ms.mjs +0 -1
- package/dist/chunks/libs/safe-stringify.mjs +0 -1
- package/dist/chunks/libs/strip-indent.mjs +0 -1
- package/dist/chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/chunks/libs/ts-graphviz.mjs +0 -1
- package/dist/chunks/libs/unctx.mjs +0 -1
- package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
- package/dist/chunks/libs/word-wrap.mjs +0 -12
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
|
@@ -23,7 +23,7 @@ import{a as t,c as n,i,n as o,o as s,r as c,s as u,t as f}from"../rolldown-runti
|
|
|
23
23
|
|
|
24
24
|
`),z.log(`Received notification '${t.method}'.`,n)}else logLSPMessage(`receive-notification`,t)}function traceReceivedResponse(t,n){if(!(R===_.Off||!z))if(fe===S.Text){let i;if((R===_.Verbose||R===_.Compact)&&(t.error&&t.error.data?i=`Error data: ${stringifyTrace(t.error.data)}\n\n`:t.result?i=`Result: ${stringifyTrace(t.result)}\n\n`:t.error===void 0&&(i=`No result returned.
|
|
25
25
|
|
|
26
|
-
`)),n){let o=t.error?` Request failed: ${t.error.message} (${t.error.code}).`:``;z.log(`Received response '${n.method} - (${t.id})' in ${Date.now()-n.timerStart}ms.${o}`,i)}else z.log(`Received response ${t.id} without active response promise.`,i)}else logLSPMessage(`receive-response`,t)}function logLSPMessage(t,n){if(!z||R===_.Off)return;let i={isLSPMessage:!0,type:t,message:n,timestamp:Date.now()};z.log(i)}function throwIfClosedOrDisposed(){if(isClosed())throw new ee(D.Closed,`Connection is closed.`);if(isDisposed())throw new ee(D.Disposed,`Connection is disposed.`)}function throwIfListening(){if(isListening())throw new ee(D.AlreadyListening,`Connection is already listening`)}function throwIfNotListening(){if(!isListening())throw Error(`Call listen() first.`)}function undefinedToNull(t){return t===void 0?null:t}function nullToUndefined(t){if(t!==null)return t}function isNamedParam(t){return t!=null&&!Array.isArray(t)&&typeof t==`object`}function computeSingleParam(t,n){switch(t){case o.ParameterStructures.auto:return isNamedParam(n)?nullToUndefined(n):[undefinedToNull(n)];case o.ParameterStructures.byName:if(!isNamedParam(n))throw Error(`Received parameters by name but param is not an object literal.`);return nullToUndefined(n);case o.ParameterStructures.byPosition:return[undefinedToNull(n)];default:throw Error(`Unknown parameter structure ${t.toString()}`)}}function computeMessageParams(t,n){let i,o=t.numberOfParams;switch(o){case 0:i=void 0;break;case 1:i=computeSingleParam(t.parameterStructures,n[0]);break;default:i=[];for(let t=0;t<n.length&&t<o;t++)i.push(undefinedToNull(n[t]));if(n.length<o)for(let t=n.length;t<o;t++)i.push(null);break}return i}let ve={sendNotification:(t,...n)=>{throwIfClosedOrDisposed();let s,c;if(i.string(t)){s=t;let i=n[0],u=0,f=o.ParameterStructures.auto;o.ParameterStructures.is(i)&&(u=1,f=i);let p=n.length,h=p-u;switch(h){case 0:c=void 0;break;case 1:c=computeSingleParam(f,n[u]);break;default:if(f===o.ParameterStructures.byName)throw Error(`Received ${h} parameters for 'by Name' notification parameter structure.`);c=n.slice(u,p).map(t=>undefinedToNull(t));break}}else{let i=n;s=t.method,c=computeMessageParams(t,i)}let u={jsonrpc:`2.0`,method:s,params:c};return traceSendingNotification(u),O.write(u).catch(t=>{throw M.error(`Sending notification failed.`),t})},onNotification:(t,n)=>{throwIfClosedOrDisposed();let o;return i.func(t)?oe=t:n&&(i.string(t)?(o=t,se.set(t,{type:void 0,handler:n})):(o=t.method,se.set(t.method,{type:t,handler:n}))),{dispose:()=>{o===void 0?oe=void 0:se.delete(o)}}},onProgress:(t,n,i)=>{if(ce.has(n))throw Error(`Progress handler for token ${n} already registered`);return ce.set(n,i),{dispose:()=>{ce.delete(n)}}},sendProgress:(t,n,i)=>ve.sendNotification(h.type,{token:n,value:i}),onUnhandledProgress:ge.event,sendRequest:(t,...n)=>{throwIfClosedOrDisposed(),throwIfNotListening();let s,c,f;if(i.string(t)){s=t;let i=n[0],p=n[n.length-1],h=0,g=o.ParameterStructures.auto;o.ParameterStructures.is(i)&&(h=1,g=i);let _=n.length;u.CancellationToken.is(p)&&(--_,f=p);let x=_-h;switch(x){case 0:c=void 0;break;case 1:c=computeSingleParam(g,n[h]);break;default:if(g===o.ParameterStructures.byName)throw Error(`Received ${x} parameters for 'by Name' request parameter structure.`);c=n.slice(h,_).map(t=>undefinedToNull(t));break}}else{let i=n;s=t.method,c=computeMessageParams(t,i);let o=t.numberOfParams;f=u.CancellationToken.is(i[o])?i[o]:void 0}let p=te++,h;f&&(h=f.onCancellationRequested(()=>{let t=V.sender.sendCancellation(ve,p);return t===void 0?(M.log(`Received no promise from cancellation strategy when cancelling id ${p}`),Promise.resolve()):t.catch(()=>{M.log(`Sending cancellation messages for id ${p} failed`)})}));let g={jsonrpc:`2.0`,id:p,method:s,params:c};return traceSendingRequest(g),typeof V.sender.enableCancellation==`function`&&V.sender.enableCancellation(g),new Promise(async(t,n)=>{let resolveWithCleanup=n=>{t(n),V.sender.cleanup(p),h?.dispose()},rejectWithCleanup=t=>{n(t),V.sender.cleanup(p),h?.dispose()},i={method:s,timerStart:Date.now(),resolve:resolveWithCleanup,reject:rejectWithCleanup};try{await O.write(g),ue.set(p,i)}catch(t){throw M.error(`Sending request failed.`),i.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,t.message?t.message:`Unknown reason`)),t}})},onRequest:(t,n)=>{throwIfClosedOrDisposed();let o=null;return g.is(t)?(o=void 0,ie=t):i.string(t)?(o=null,n!==void 0&&(o=t,ae.set(t,{handler:n,type:void 0}))):n!==void 0&&(o=t.method,ae.set(t.method,{type:t,handler:n})),{dispose:()=>{o!==null&&(o===void 0?ie=void 0:ae.delete(o))}}},hasPendingResponse:()=>ue.size>0,trace:async(t,n,o)=>{let s=!1,c=S.Text;o!==void 0&&(i.boolean(o)?s=o:(s=o.sendNotification||!1,c=o.traceFormat||S.Text)),R=t,fe=c,z=R===_.Off?void 0:n,s&&!isClosed()&&!isDisposed()&&await ve.sendNotification(T.type,{value:_.toString(t)})},onError:pe.event,onClose:me.event,onUnhandledNotification:he.event,onDispose:_e.event,end:()=>{O.end()},dispose:()=>{if(isDisposed())return;B=F.Disposed,_e.fire(void 0);let t=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let n of ue.values())n.reject(t);ue=new Map,L=new Map,de=new Set,I=new s.LinkedMap,i.func(O.dispose)&&O.dispose(),i.func(x.dispose)&&x.dispose()},listen:()=>{throwIfClosedOrDisposed(),throwIfListening(),B=F.Listening,x.listen(callback)},inspect:()=>{(0,n.default)().console.log(`inspect`)}};return ve.onNotification(E.type,t=>{if(R===_.Off||!z)return;let n=R===_.Verbose||R===_.Compact;z.log(t.message,n?t.verbose:void 0)}),ve.onNotification(h.type,t=>{let n=ce.get(t.token);n?n(t.value):ge.fire(t)}),ve}t.createMessageConnection=createMessageConnection})),or=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;let n=Zn();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});let i=Qn();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return i.Touch}});let o=$n();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});let s=Tn();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});let c=En();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});let u=er();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return u.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return u.SharedArrayReceiverStrategy}});let f=nr();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});let p=rr();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});let h=ir();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return h.AbstractMessageBuffer}});let g=ar();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return g.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return g.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return g.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return g.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return g.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return g.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return g.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return g.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return g.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return g.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return g.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return g.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return g.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return g.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return g.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return g.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return g.MessageStrategy}}),t.RAL=Cn().default})),sr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=s(`node:util`),i=or();var o=class MessageBuffer extends i.AbstractMessageBuffer{constructor(t=`utf-8`){super(t)}emptyBuffer(){return MessageBuffer.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,i){return t instanceof Buffer?t.toString(i):new n.TextDecoder(i).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};o.emptyBuffer=Buffer.allocUnsafe(0);var ReadableStreamWrapper=class{constructor(t){this.stream=t}onClose(t){return this.stream.on(`close`,t),i.Disposable.create(()=>this.stream.off(`close`,t))}onError(t){return this.stream.on(`error`,t),i.Disposable.create(()=>this.stream.off(`error`,t))}onEnd(t){return this.stream.on(`end`,t),i.Disposable.create(()=>this.stream.off(`end`,t))}onData(t){return this.stream.on(`data`,t),i.Disposable.create(()=>this.stream.off(`data`,t))}},WritableStreamWrapper=class{constructor(t){this.stream=t}onClose(t){return this.stream.on(`close`,t),i.Disposable.create(()=>this.stream.off(`close`,t))}onError(t){return this.stream.on(`error`,t),i.Disposable.create(()=>this.stream.off(`error`,t))}onEnd(t){return this.stream.on(`end`,t),i.Disposable.create(()=>this.stream.off(`end`,t))}write(t,n){return new Promise((i,o)=>{let callback=t=>{t==null?i():o(t)};typeof t==`string`?this.stream.write(t,n,callback):this.stream.write(t,callback)})}end(){this.stream.end()}};let c=Object.freeze({messageBuffer:Object.freeze({create:t=>new o(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:(t,n)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),n.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:`application/json`,decode:(t,i)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(i.charset))):Promise.resolve(JSON.parse(new n.TextDecoder(i.charset).decode(t)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:t=>new ReadableStreamWrapper(t),asWritableStream:t=>new WritableStreamWrapper(t)}),console,timer:Object.freeze({setTimeout(t,n,...i){let o=setTimeout(t,n,...i);return{dispose:()=>clearTimeout(o)}},setImmediate(t,...n){let i=setImmediate(t,...n);return{dispose:()=>clearImmediate(i)}},setInterval(t,n,...i){let o=setInterval(t,n,...i);return{dispose:()=>clearInterval(o)}}})});function RIL(){return c}(function(t){function install(){i.RAL.install(c)}t.install=install})(RIL||={}),t.default=RIL})),cr=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!==`default`&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;let o=sr();o.default.install();let c=s(`node:path`),u=s(`node:os`),f=s(`node:crypto`),p=s(`node:net`),h=or();i(or(),t);var IPCMessageReader=class extends h.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on(`error`,t=>this.fireError(t)),n.on(`close`,()=>this.fireClose())}listen(t){return this.process.on(`message`,t),h.Disposable.create(()=>this.process.off(`message`,t))}};t.IPCMessageReader=IPCMessageReader;var IPCMessageWriter=class extends h.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on(`error`,t=>this.fireError(t)),n.on(`close`,()=>this.fireClose)}write(t){try{return typeof this.process.send==`function`&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};t.IPCMessageWriter=IPCMessageWriter;var PortMessageReader=class extends h.AbstractMessageReader{constructor(t){super(),this.onData=new h.Emitter,t.on(`close`,()=>this.fireClose),t.on(`error`,t=>this.fireError(t)),t.on(`message`,t=>{this.onData.fire(t)})}listen(t){return this.onData.event(t)}};t.PortMessageReader=PortMessageReader;var PortMessageWriter=class extends h.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on(`close`,()=>this.fireClose()),t.on(`error`,t=>this.fireError(t))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};t.PortMessageWriter=PortMessageWriter;var SocketMessageReader=class extends h.ReadableStreamMessageReader{constructor(t,n=`utf-8`){super((0,o.default)().stream.asReadableStream(t),n)}};t.SocketMessageReader=SocketMessageReader;var SocketMessageWriter=class extends h.WriteableStreamMessageWriter{constructor(t,n){super((0,o.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};t.SocketMessageWriter=SocketMessageWriter;var StreamMessageReader=class extends h.ReadableStreamMessageReader{constructor(t,n){super((0,o.default)().stream.asReadableStream(t),n)}};t.StreamMessageReader=StreamMessageReader;var StreamMessageWriter=class extends h.WriteableStreamMessageWriter{constructor(t,n){super((0,o.default)().stream.asWritableStream(t),n)}};t.StreamMessageWriter=StreamMessageWriter;let g=process.env.XDG_RUNTIME_DIR,_=new Map([[`linux`,107],[`darwin`,103]]);function generateRandomPipeName(){let t=(0,f.randomBytes)(21).toString(`hex`);if(process.platform===`win32`)return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let n;n=g?c.join(g,`vscode-ipc-${t}.sock`):c.join(u.tmpdir(),`vscode-${t}.sock`);let i=_.get(process.platform);return i!==void 0&&n.length>i&&(0,o.default)().console.warn(`WARNING: IPC handle "${n}" is longer than ${i} characters.`),n}t.generateRandomPipeName=generateRandomPipeName;function createClientPipeTransport(t,n=`utf-8`){let i,o=new Promise((t,n)=>{i=t});return new Promise((s,c)=>{let u=(0,p.createServer)(t=>{u.close(),i([new SocketMessageReader(t,n),new SocketMessageWriter(t,n)])});u.on(`error`,c),u.listen(t,()=>{u.removeListener(`error`,c),s({onConnected:()=>o})})})}t.createClientPipeTransport=createClientPipeTransport;function createServerPipeTransport(t,n=`utf-8`){let i=(0,p.createConnection)(t);return[new SocketMessageReader(i,n),new SocketMessageWriter(i,n)]}t.createServerPipeTransport=createServerPipeTransport;function createClientSocketTransport(t,n=`utf-8`){let i,o=new Promise((t,n)=>{i=t});return new Promise((s,c)=>{let u=(0,p.createServer)(t=>{u.close(),i([new SocketMessageReader(t,n),new SocketMessageWriter(t,n)])});u.on(`error`,c),u.listen(t,`127.0.0.1`,()=>{u.removeListener(`error`,c),s({onConnected:()=>o})})})}t.createClientSocketTransport=createClientSocketTransport;function createServerSocketTransport(t,n=`utf-8`){let i=(0,p.createConnection)(t,`127.0.0.1`);return[new SocketMessageReader(i,n),new SocketMessageWriter(i,n)]}t.createServerSocketTransport=createServerSocketTransport;function isReadableStream(t){let n=t;return n.read!==void 0&&n.addListener!==void 0}function isWritableStream(t){let n=t;return n.write!==void 0&&n.addListener!==void 0}function createMessageConnection(t,n,i,o){i||=h.NullLogger;let s=isReadableStream(t)?new StreamMessageReader(t):t,c=isWritableStream(n)?new StreamMessageWriter(n):n;return h.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,h.createMessageConnection)(s,c,i,o)}t.createMessageConnection=createMessageConnection})),lr=f(((t,n)=>{n.exports=cr()})),Z=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;let n=cr();var i;(function(t){t.clientToServer=`clientToServer`,t.serverToClient=`serverToClient`,t.both=`both`})(i||(t.MessageDirection=i={}));var RegistrationType=class{constructor(t){this.method=t}};t.RegistrationType=RegistrationType;var ProtocolRequestType0=class extends n.RequestType0{constructor(t){super(t)}};t.ProtocolRequestType0=ProtocolRequestType0;var ProtocolRequestType=class extends n.RequestType{constructor(t){super(t,n.ParameterStructures.byName)}};t.ProtocolRequestType=ProtocolRequestType;var ProtocolNotificationType0=class extends n.NotificationType0{constructor(t){super(t)}};t.ProtocolNotificationType0=ProtocolNotificationType0;var ProtocolNotificationType=class extends n.NotificationType{constructor(t){super(t,n.ParameterStructures.byName)}};t.ProtocolNotificationType=ProtocolNotificationType})),ur=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function boolean(t){return t===!0||t===!1}t.boolean=boolean;function string(t){return typeof t==`string`||t instanceof String}t.string=string;function number(t){return typeof t==`number`||t instanceof Number}t.number=number;function error(t){return t instanceof Error}t.error=error;function func(t){return typeof t==`function`}t.func=func;function array(t){return Array.isArray(t)}t.array=array;function stringArray(t){return array(t)&&t.every(t=>string(t))}t.stringArray=stringArray;function typedArray(t,n){return Array.isArray(t)&&t.every(n)}t.typedArray=typedArray;function objectLiteral(t){return typeof t==`object`&&!!t}t.objectLiteral=objectLiteral})),dr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/implementation`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ImplementationRequest=i={}))})),fr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/typeDefinition`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.TypeDefinitionRequest=i={}))})),pr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;let n=Z();var i;(function(t){t.method=`workspace/workspaceFolders`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(i||(t.WorkspaceFoldersRequest=i={}));var o;(function(t){t.method=`workspace/didChangeWorkspaceFolders`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(o||(t.DidChangeWorkspaceFoldersNotification=o={}))})),mr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;let n=Z();var i;(function(t){t.method=`workspace/configuration`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ConfigurationRequest=i={}))})),hr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/documentColor`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.DocumentColorRequest=i={}));var o;(function(t){t.method=`textDocument/colorPresentation`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.ColorPresentationRequest=o={}))})),gr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/foldingRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.FoldingRangeRequest=i={}));var o;(function(t){t.method=`workspace/foldingRange/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(o||(t.FoldingRangeRefreshRequest=o={}))})),_r=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/declaration`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.DeclarationRequest=i={}))})),vr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/selectionRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.SelectionRangeRequest=i={}))})),yr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;let n=cr(),i=Z();var o;(function(t){t.type=new n.ProgressType;function is(n){return n===t.type}t.is=is})(o||(t.WorkDoneProgress=o={}));var s;(function(t){t.method=`window/workDoneProgress/create`,t.messageDirection=i.MessageDirection.serverToClient,t.type=new i.ProtocolRequestType(t.method)})(s||(t.WorkDoneProgressCreateRequest=s={}));var c;(function(t){t.method=`window/workDoneProgress/cancel`,t.messageDirection=i.MessageDirection.clientToServer,t.type=new i.ProtocolNotificationType(t.method)})(c||(t.WorkDoneProgressCancelNotification=c={}))})),br=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/prepareCallHierarchy`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.CallHierarchyPrepareRequest=i={}));var o;(function(t){t.method=`callHierarchy/incomingCalls`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.CallHierarchyIncomingCallsRequest=o={}));var s;(function(t){t.method=`callHierarchy/outgoingCalls`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.CallHierarchyOutgoingCallsRequest=s={}))})),xr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;let n=Z();var i;(function(t){t.Relative=`relative`})(i||(t.TokenFormat=i={}));var o;(function(t){t.method=`textDocument/semanticTokens`,t.type=new n.RegistrationType(t.method)})(o||(t.SemanticTokensRegistrationType=o={}));var s;(function(t){t.method=`textDocument/semanticTokens/full`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(s||(t.SemanticTokensRequest=s={}));var c;(function(t){t.method=`textDocument/semanticTokens/full/delta`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(c||(t.SemanticTokensDeltaRequest=c={}));var u;(function(t){t.method=`textDocument/semanticTokens/range`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(u||(t.SemanticTokensRangeRequest=u={}));var f;(function(t){t.method=`workspace/semanticTokens/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(f||(t.SemanticTokensRefreshRequest=f={}))})),Sr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;let n=Z();var i;(function(t){t.method=`window/showDocument`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ShowDocumentRequest=i={}))})),Cr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/linkedEditingRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.LinkedEditingRangeRequest=i={}))})),wr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;let n=Z();var i;(function(t){t.file=`file`,t.folder=`folder`})(i||(t.FileOperationPatternKind=i={}));var o;(function(t){t.method=`workspace/willCreateFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.WillCreateFilesRequest=o={}));var s;(function(t){t.method=`workspace/didCreateFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(s||(t.DidCreateFilesNotification=s={}));var c;(function(t){t.method=`workspace/willRenameFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(c||(t.WillRenameFilesRequest=c={}));var u;(function(t){t.method=`workspace/didRenameFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(u||(t.DidRenameFilesNotification=u={}));var f;(function(t){t.method=`workspace/didDeleteFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(f||(t.DidDeleteFilesNotification=f={}));var p;(function(t){t.method=`workspace/willDeleteFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(p||(t.WillDeleteFilesRequest=p={}))})),Tr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;let n=Z();var i;(function(t){t.document=`document`,t.project=`project`,t.group=`group`,t.scheme=`scheme`,t.global=`global`})(i||(t.UniquenessLevel=i={}));var o;(function(t){t.$import=`import`,t.$export=`export`,t.local=`local`})(o||(t.MonikerKind=o={}));var s;(function(t){t.method=`textDocument/moniker`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.MonikerRequest=s={}))})),Er=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/prepareTypeHierarchy`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.TypeHierarchyPrepareRequest=i={}));var o;(function(t){t.method=`typeHierarchy/supertypes`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.TypeHierarchySupertypesRequest=o={}));var s;(function(t){t.method=`typeHierarchy/subtypes`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.TypeHierarchySubtypesRequest=s={}))})),Dr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlineValue`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlineValueRequest=i={}));var o;(function(t){t.method=`workspace/inlineValue/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(o||(t.InlineValueRefreshRequest=o={}))})),Or=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlayHint`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlayHintRequest=i={}));var o;(function(t){t.method=`inlayHint/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.InlayHintResolveRequest=o={}));var s;(function(t){t.method=`workspace/inlayHint/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(s||(t.InlayHintRefreshRequest=s={}))})),kr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;let n=cr(),i=ur(),o=Z();var s;(function(t){function is(t){let n=t;return n&&i.boolean(n.retriggerRequest)}t.is=is})(s||(t.DiagnosticServerCancellationData=s={}));var c;(function(t){t.Full=`full`,t.Unchanged=`unchanged`})(c||(t.DocumentDiagnosticReportKind=c={}));var u;(function(t){t.method=`textDocument/diagnostic`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolRequestType(t.method),t.partialResult=new n.ProgressType})(u||(t.DocumentDiagnosticRequest=u={}));var f;(function(t){t.method=`workspace/diagnostic`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolRequestType(t.method),t.partialResult=new n.ProgressType})(f||(t.WorkspaceDiagnosticRequest=f={}));var p;(function(t){t.method=`workspace/diagnostic/refresh`,t.messageDirection=o.MessageDirection.serverToClient,t.type=new o.ProtocolRequestType0(t.method)})(p||(t.DiagnosticRefreshRequest=p={}))})),Ar=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;let n=(vn(),u(qe)),i=ur(),o=Z();var s;(function(t){t.Markup=1,t.Code=2;function is(t){return t===1||t===2}t.is=is})(s||(t.NotebookCellKind=s={}));var c;(function(t){function create(t,n){let i={executionOrder:t};return(n===!0||n===!1)&&(i.success=n),i}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&n.uinteger.is(o.executionOrder)&&(o.success===void 0||i.boolean(o.success))}t.is=is;function equals(t,n){return t===n?!0:t==null||n==null?!1:t.executionOrder===n.executionOrder&&t.success===n.success}t.equals=equals})(c||(t.ExecutionSummary=c={}));var f;(function(t){function create(t,n){return{kind:t,document:n}}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&s.is(o.kind)&&n.DocumentUri.is(o.document)&&(o.metadata===void 0||i.objectLiteral(o.metadata))}t.is=is;function diff(t,n){let i=new Set;return t.document!==n.document&&i.add(`document`),t.kind!==n.kind&&i.add(`kind`),t.executionSummary!==n.executionSummary&&i.add(`executionSummary`),(t.metadata!==void 0||n.metadata!==void 0)&&!equalsMetadata(t.metadata,n.metadata)&&i.add(`metadata`),(t.executionSummary!==void 0||n.executionSummary!==void 0)&&!c.equals(t.executionSummary,n.executionSummary)&&i.add(`executionSummary`),i}t.diff=diff;function equalsMetadata(t,n){if(t===n)return!0;if(t==null||n==null||typeof t!=typeof n||typeof t!=`object`)return!1;let o=Array.isArray(t),s=Array.isArray(n);if(o!==s)return!1;if(o&&s){if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(!equalsMetadata(t[i],n[i]))return!1}if(i.objectLiteral(t)&&i.objectLiteral(n)){let i=Object.keys(t),o=Object.keys(n);if(i.length!==o.length||(i.sort(),o.sort(),!equalsMetadata(i,o)))return!1;for(let o=0;o<i.length;o++){let s=i[o];if(!equalsMetadata(t[s],n[s]))return!1}}return!0}})(f||(t.NotebookCell=f={}));var p;(function(t){function create(t,n,i,o){return{uri:t,notebookType:n,version:i,cells:o}}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&i.string(o.uri)&&n.integer.is(o.version)&&i.typedArray(o.cells,f.is)}t.is=is})(p||(t.NotebookDocument=p={}));var h;(function(t){t.method=`notebookDocument/sync`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.RegistrationType(t.method)})(h||(t.NotebookDocumentSyncRegistrationType=h={}));var g;(function(t){t.method=`notebookDocument/didOpen`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(g||(t.DidOpenNotebookDocumentNotification=g={}));var _;(function(t){function is(t){let o=t;return i.objectLiteral(o)&&n.uinteger.is(o.start)&&n.uinteger.is(o.deleteCount)&&(o.cells===void 0||i.typedArray(o.cells,f.is))}t.is=is;function create(t,n,i){let o={start:t,deleteCount:n};return i!==void 0&&(o.cells=i),o}t.create=create})(_||(t.NotebookCellArrayChange=_={}));var x;(function(t){t.method=`notebookDocument/didChange`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(x||(t.DidChangeNotebookDocumentNotification=x={}));var S;(function(t){t.method=`notebookDocument/didSave`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(S||(t.DidSaveNotebookDocumentNotification=S={}));var T;(function(t){t.method=`notebookDocument/didClose`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(T||(t.DidCloseNotebookDocumentNotification=T={}))})),jr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCompletionRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlineCompletion`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlineCompletionRequest=i={}))})),Mr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;let n=Z(),i=(vn(),u(qe)),o=ur(),s=dr();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});let c=fr();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});let f=pr();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return f.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return f.DidChangeWorkspaceFoldersNotification}});let p=mr();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return p.ConfigurationRequest}});let h=hr();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return h.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return h.ColorPresentationRequest}});let g=gr();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return g.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return g.FoldingRangeRefreshRequest}});let _=_r();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return _.DeclarationRequest}});let x=vr();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});let S=yr();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return S.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return S.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return S.WorkDoneProgressCancelNotification}});let T=br();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return T.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return T.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return T.CallHierarchyPrepareRequest}});let E=xr();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});let D=Sr();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return D.ShowDocumentRequest}});let ee=Cr();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return ee.LinkedEditingRangeRequest}});let O=wr();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return O.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return O.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return O.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return O.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return O.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return O.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return O.WillDeleteFilesRequest}});let k=Tr();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return k.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return k.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return k.MonikerRequest}});let A=Er();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return A.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return A.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return A.TypeHierarchySupertypesRequest}});let j=Dr();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return j.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return j.InlineValueRefreshRequest}});let M=Or();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return M.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return M.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return M.InlayHintRefreshRequest}});let N=kr();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return N.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return N.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return N.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return N.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return N.DiagnosticRefreshRequest}});let P=Ar();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return P.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return P.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return P.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return P.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return P.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return P.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidCloseNotebookDocumentNotification}});let te=jr();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return te.InlineCompletionRequest}});var F;(function(t){function is(t){let n=t;return o.string(n)||o.string(n.language)||o.string(n.scheme)||o.string(n.pattern)}t.is=is})(F||(t.TextDocumentFilter=F={}));var ne;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(o.string(n.notebookType)||o.string(n.scheme)||o.string(n.pattern))}t.is=is})(ne||(t.NotebookDocumentFilter=ne={}));var re;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(o.string(n.notebook)||ne.is(n.notebook))&&(n.language===void 0||o.string(n.language))}t.is=is})(re||(t.NotebookCellTextDocumentFilter=re={}));var ie;(function(t){function is(t){if(!Array.isArray(t))return!1;for(let n of t)if(!o.string(n)&&!F.is(n)&&!re.is(n))return!1;return!0}t.is=is})(ie||(t.DocumentSelector=ie={}));var ae;(function(t){t.method=`client/registerCapability`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(ae||(t.RegistrationRequest=ae={}));var oe;(function(t){t.method=`client/unregisterCapability`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(oe||(t.UnregistrationRequest=oe={}));var se;(function(t){t.Create=`create`,t.Rename=`rename`,t.Delete=`delete`})(se||(t.ResourceOperationKind=se={}));var ce;(function(t){t.Abort=`abort`,t.Transactional=`transactional`,t.TextOnlyTransactional=`textOnlyTransactional`,t.Undo=`undo`})(ce||(t.FailureHandlingKind=ce={}));var le;(function(t){t.UTF8=`utf-8`,t.UTF16=`utf-16`,t.UTF32=`utf-32`})(le||(t.PositionEncodingKind=le={}));var I;(function(t){function hasId(t){let n=t;return n&&o.string(n.id)&&n.id.length>0}t.hasId=hasId})(I||(t.StaticRegistrationOptions=I={}));var ue;(function(t){function is(t){let n=t;return n&&(n.documentSelector===null||ie.is(n.documentSelector))}t.is=is})(ue||(t.TextDocumentRegistrationOptions=ue={}));var de;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(n.workDoneProgress===void 0||o.boolean(n.workDoneProgress))}t.is=is;function hasWorkDoneProgress(t){let n=t;return n&&o.boolean(n.workDoneProgress)}t.hasWorkDoneProgress=hasWorkDoneProgress})(de||(t.WorkDoneProgressOptions=de={}));var L;(function(t){t.method=`initialize`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(L||(t.InitializeRequest=L={}));var R;(function(t){t.unknownProtocolVersion=1})(R||(t.InitializeErrorCodes=R={}));var fe;(function(t){t.method=`initialized`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(fe||(t.InitializedNotification=fe={}));var z;(function(t){t.method=`shutdown`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType0(t.method)})(z||(t.ShutdownRequest=z={}));var B;(function(t){t.method=`exit`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType0(t.method)})(B||(t.ExitNotification=B={}));var pe;(function(t){t.method=`workspace/didChangeConfiguration`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(pe||(t.DidChangeConfigurationNotification=pe={}));var me;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(me||(t.MessageType=me={}));var he;(function(t){t.method=`window/showMessage`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(he||(t.ShowMessageNotification=he={}));var ge;(function(t){t.method=`window/showMessageRequest`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(ge||(t.ShowMessageRequest=ge={}));var _e;(function(t){t.method=`window/logMessage`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(_e||(t.LogMessageNotification=_e={}));var V;(function(t){t.method=`telemetry/event`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(V||(t.TelemetryEventNotification=V={}));var ve;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ve||(t.TextDocumentSyncKind=ve={}));var ye;(function(t){t.method=`textDocument/didOpen`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(ye||(t.DidOpenTextDocumentNotification=ye={}));var be;(function(t){function isIncremental(t){let n=t;return n!=null&&typeof n.text==`string`&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength==`number`)}t.isIncremental=isIncremental;function isFull(t){let n=t;return n!=null&&typeof n.text==`string`&&n.range===void 0&&n.rangeLength===void 0}t.isFull=isFull})(be||(t.TextDocumentContentChangeEvent=be={}));var xe;(function(t){t.method=`textDocument/didChange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(xe||(t.DidChangeTextDocumentNotification=xe={}));var Se;(function(t){t.method=`textDocument/didClose`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Se||(t.DidCloseTextDocumentNotification=Se={}));var Ce;(function(t){t.method=`textDocument/didSave`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Ce||(t.DidSaveTextDocumentNotification=Ce={}));var we;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(we||(t.TextDocumentSaveReason=we={}));var Te;(function(t){t.method=`textDocument/willSave`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Te||(t.WillSaveTextDocumentNotification=Te={}));var Ee;(function(t){t.method=`textDocument/willSaveWaitUntil`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ee||(t.WillSaveTextDocumentWaitUntilRequest=Ee={}));var De;(function(t){t.method=`workspace/didChangeWatchedFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Oe;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Oe||(t.FileChangeType=Oe={}));var ke;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(i.URI.is(n.baseUri)||i.WorkspaceFolder.is(n.baseUri))&&o.string(n.pattern)}t.is=is})(ke||(t.RelativePattern=ke={}));var Ae;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Ae||(t.WatchKind=Ae={}));var je;(function(t){t.method=`textDocument/publishDiagnostics`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(je||(t.PublishDiagnosticsNotification=je={}));var Me;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Me||(t.CompletionTriggerKind=Me={}));var Ne;(function(t){t.method=`textDocument/completion`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ne||(t.CompletionRequest=Ne={}));var Pe;(function(t){t.method=`completionItem/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Pe||(t.CompletionResolveRequest=Pe={}));var Fe;(function(t){t.method=`textDocument/hover`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Fe||(t.HoverRequest=Fe={}));var Ie;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Ie||(t.SignatureHelpTriggerKind=Ie={}));var Le;(function(t){t.method=`textDocument/signatureHelp`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Le||(t.SignatureHelpRequest=Le={}));var Re;(function(t){t.method=`textDocument/definition`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Re||(t.DefinitionRequest=Re={}));var ze;(function(t){t.method=`textDocument/references`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(ze||(t.ReferencesRequest=ze={}));var H;(function(t){t.method=`textDocument/documentHighlight`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(H||(t.DocumentHighlightRequest=H={}));var Be;(function(t){t.method=`textDocument/documentSymbol`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Be||(t.DocumentSymbolRequest=Be={}));var Ve;(function(t){t.method=`textDocument/codeAction`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ve||(t.CodeActionRequest=Ve={}));var He;(function(t){t.method=`codeAction/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(He||(t.CodeActionResolveRequest=He={}));var Ue;(function(t){t.method=`workspace/symbol`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var We;(function(t){t.method=`workspaceSymbol/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(We||(t.WorkspaceSymbolResolveRequest=We={}));var Ge;(function(t){t.method=`textDocument/codeLens`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ge||(t.CodeLensRequest=Ge={}));var Ke;(function(t){t.method=`codeLens/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ke||(t.CodeLensResolveRequest=Ke={}));var Je;(function(t){t.method=`workspace/codeLens/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(Je||(t.CodeLensRefreshRequest=Je={}));var Ye;(function(t){t.method=`textDocument/documentLink`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ye||(t.DocumentLinkRequest=Ye={}));var Xe;(function(t){t.method=`documentLink/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Xe||(t.DocumentLinkResolveRequest=Xe={}));var Ze;(function(t){t.method=`textDocument/formatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ze||(t.DocumentFormattingRequest=Ze={}));var U;(function(t){t.method=`textDocument/rangeFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(U||(t.DocumentRangeFormattingRequest=U={}));var W;(function(t){t.method=`textDocument/rangesFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(W||(t.DocumentRangesFormattingRequest=W={}));var Qe;(function(t){t.method=`textDocument/onTypeFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Qe||(t.DocumentOnTypeFormattingRequest=Qe={}));var $e;(function(t){t.Identifier=1})($e||(t.PrepareSupportDefaultBehavior=$e={}));var et;(function(t){t.method=`textDocument/rename`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(et||(t.RenameRequest=et={}));var tt;(function(t){t.method=`textDocument/prepareRename`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(tt||(t.PrepareRenameRequest=tt={}));var nt;(function(t){t.method=`workspace/executeCommand`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(nt||(t.ExecuteCommandRequest=nt={}));var rt;(function(t){t.method=`workspace/applyEdit`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(`workspace/applyEdit`)})(rt||(t.ApplyWorkspaceEditRequest=rt={}))})),Nr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;let n=cr();function createProtocolConnection(t,i,o,s){return n.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,n.createMessageConnection)(t,i,o,s)}t.createProtocolConnection=createProtocolConnection})),Pr=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!==`default`&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,i(cr(),t),i((vn(),u(qe)),t),i(Z(),t),i(Mr(),t);var o=Nr();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(s||(t.LSPErrorCodes=s={}))})),Q=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!==`default`&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;let o=lr();i(lr(),t),i(Pr(),t);function createProtocolConnection(t,n,i,s){return(0,o.createMessageConnection)(t,n,i,s)}t.createProtocolConnection=createProtocolConnection})),Fr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generateUuid=t.parse=t.isUUID=t.v4=t.empty=void 0;var ValueUUID=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},n=class V4UUID extends ValueUUID{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return V4UUID._oneOf(V4UUID._chars)}constructor(){super([V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,`4`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._oneOf(V4UUID._timeHighBits),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex()].join(``))}};n._chars=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`],n._timeHighBits=[`8`,`9`,`a`,`b`],t.empty=new ValueUUID(`00000000-0000-0000-0000-000000000000`);function v4(){return new n}t.v4=v4;let i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isUUID(t){return i.test(t)}t.isUUID=isUUID;function parse(t){if(!isUUID(t))throw Error(`invalid uuid`);return new ValueUUID(t)}t.parse=parse;function generateUuid(){return v4().asHex()}t.generateUuid=generateUuid})),Ir=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.attachPartialResult=t.ProgressFeature=t.attachWorkDone=void 0;let n=Q(),i=Fr();var o=class WorkDoneProgressReporterImpl{constructor(t,n){this._connection=t,this._token=n,WorkDoneProgressReporterImpl.Instances.set(this._token,this)}begin(t,i,o,s){let c={kind:`begin`,title:t,percentage:i,message:o,cancellable:s};this._connection.sendProgress(n.WorkDoneProgress.type,this._token,c)}report(t,i){let o={kind:`report`};typeof t==`number`?(o.percentage=t,i!==void 0&&(o.message=i)):o.message=t,this._connection.sendProgress(n.WorkDoneProgress.type,this._token,o)}done(){WorkDoneProgressReporterImpl.Instances.delete(this._token),this._connection.sendProgress(n.WorkDoneProgress.type,this._token,{kind:`end`})}};o.Instances=new Map;var WorkDoneProgressServerReporterImpl=class extends o{constructor(t,i){super(t,i),this._source=new n.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},NullProgressReporter=class{constructor(){}begin(){}report(){}done(){}},NullProgressServerReporter=class extends NullProgressReporter{constructor(){super(),this._source=new n.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function attachWorkDone(t,n){if(n===void 0||n.workDoneToken===void 0)return new NullProgressReporter;let i=n.workDoneToken;return delete n.workDoneToken,new o(t,i)}t.attachWorkDone=attachWorkDone;let ProgressFeature=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(n.WorkDoneProgressCancelNotification.type,t=>{let n=o.Instances.get(t.token);(n instanceof WorkDoneProgressServerReporterImpl||n instanceof NullProgressServerReporter)&&n.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new NullProgressReporter:new o(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,i.generateUuid)();return this.connection.sendRequest(n.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new WorkDoneProgressServerReporterImpl(this.connection,t))}else return Promise.resolve(new NullProgressServerReporter)}};t.ProgressFeature=ProgressFeature;var s;(function(t){t.type=new n.ProgressType})(s||={});var ResultProgressReporterImpl=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(s.type,this._token,t)}};function attachPartialResult(t,n){if(n===void 0||n.partialResultToken===void 0)return;let i=n.partialResultToken;return delete n.partialResultToken,new ResultProgressReporterImpl(t,i)}t.attachPartialResult=attachPartialResult})),Lr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationFeature=void 0;let n=Q(),i=Xn(),ConfigurationFeature=t=>class extends t{getConfiguration(t){return t?i.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let i={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(n.ConfigurationRequest.type,i).then(n=>Array.isArray(n)?Array.isArray(t)?n:n[0]:Array.isArray(t)?[]:null)}};t.ConfigurationFeature=ConfigurationFeature})),Rr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFoldersFeature=void 0;let n=Q(),WorkspaceFoldersFeature=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let i=t.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new n.Emitter,this.connection.onNotification(n.DidChangeWorkspaceFoldersNotification.type,t=>{this._onDidChangeWorkspaceFolders.fire(t.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n==`string`}getWorkspaceFolders(){return this.connection.sendRequest(n.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw Error(`Client doesn't support sending workspace folder change events.`);return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(n.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};t.WorkspaceFoldersFeature=WorkspaceFoldersFeature})),zr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyFeature=void 0;let n=Q(),CallHierarchyFeature=t=>class extends t{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(n.CallHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let i=n.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onOutgoingCalls:t=>{let i=n.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.CallHierarchyFeature=CallHierarchyFeature})),Br=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensDiff=t.SemanticTokensFeature=void 0;let n=Q(),SemanticTokensFeature=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(n.SemanticTokensRefreshRequest.type),on:t=>{let i=n.SemanticTokensRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onDelta:t=>{let i=n.SemanticTokensDeltaRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onRange:t=>{let i=n.SemanticTokensRangeRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.SemanticTokensFeature=SemanticTokensFeature;var SemanticTokensDiff=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,i=0;for(;i<n&&i<t&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<n&&i<t){let o=t-1,s=n-1;for(;o>=i&&s>=i&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o<i||s<i)&&(o++,s++);let c=o-i+1,u=this.modifiedSequence.slice(i,s+1);return u.length===1&&u[0]===this.originalSequence[o]?[{start:i,deleteCount:c-1}]:[{start:i,deleteCount:c,data:u}]}else if(i<n)return[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}];else if(i<t)return[{start:i,deleteCount:t-i}];else return[]}};t.SemanticTokensDiff=SemanticTokensDiff;var SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(t,n,i,o,s){let c=t,u=n;this._dataLen>0&&(c-=this._prevLine,c===0&&(u-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData===void 0?this.build():{resultId:this.id,edits:new SemanticTokensDiff(this._prevData,this._data).computeDiff()}}};t.SemanticTokensBuilder=SemanticTokensBuilder})),Vr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentFeature=void 0;let n=Q(),ShowDocumentFeature=t=>class extends t{showDocument(t){return this.connection.sendRequest(n.ShowDocumentRequest.type,t)}};t.ShowDocumentFeature=ShowDocumentFeature})),Hr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileOperationsFeature=void 0;let n=Q(),FileOperationsFeature=t=>class extends t{onDidCreateFiles(t){return this.connection.onNotification(n.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(n.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(n.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(n.WillCreateFilesRequest.type,(n,i)=>t(n,i))}onWillRenameFiles(t){return this.connection.onRequest(n.WillRenameFilesRequest.type,(n,i)=>t(n,i))}onWillDeleteFiles(t){return this.connection.onRequest(n.WillDeleteFilesRequest.type,(n,i)=>t(n,i))}};t.FileOperationsFeature=FileOperationsFeature})),Ur=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeFeature=void 0;let n=Q(),LinkedEditingRangeFeature=t=>class extends t{onLinkedEditingRange(t){return this.connection.onRequest(n.LinkedEditingRangeRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0))}};t.LinkedEditingRangeFeature=LinkedEditingRangeFeature})),Wr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyFeature=void 0;let n=Q(),TypeHierarchyFeature=t=>class extends t{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(n.TypeHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let i=n.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onSubtypes:t=>{let i=n.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.TypeHierarchyFeature=TypeHierarchyFeature})),Gr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueFeature=void 0;let n=Q(),InlineValueFeature=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(n.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(n.InlineValueRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};t.InlineValueFeature=InlineValueFeature})),Kr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeFeature=void 0;let n=Q(),FoldingRangeFeature=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(n.FoldingRangeRefreshRequest.type),on:t=>{let i=n.FoldingRangeRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.FoldingRangeFeature=FoldingRangeFeature})),qr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintFeature=void 0;let n=Q(),InlayHintFeature=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(n.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(n.InlayHintRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest(n.InlayHintResolveRequest.type,(n,i)=>t(n,i))}}};t.InlayHintFeature=InlayHintFeature})),Jr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFeature=void 0;let n=Q(),DiagnosticFeature=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(n.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(n.DocumentDiagnosticRequest.type,(i,o)=>t(i,o,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:t=>this.connection.onRequest(n.WorkspaceDiagnosticRequest.type,(i,o)=>t(i,o,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n.WorkspaceDiagnosticRequest.partialResult,i)))}}};t.DiagnosticFeature=DiagnosticFeature})),Yr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocuments=void 0;let n=Q();var TextDocuments=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new n.Emitter,this._onDidOpen=new n.Emitter,this._onDidClose=new n.Emitter,this._onDidSave=new n.Emitter,this._onWillSave=new n.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=n.TextDocumentSyncKind.Incremental;let i=[];return i.push(t.onDidOpenTextDocument(t=>{let n=t.textDocument,i=this._configuration.create(n.uri,n.languageId,n.version,n.text);this._syncedDocuments.set(n.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),i.push(t.onDidChangeTextDocument(t=>{let n=t.textDocument,i=t.contentChanges;if(i.length===0)return;let{version:o}=n;if(o==null)throw Error(`Received document change event for ${n.uri} without valid version identifier`);let s=this._syncedDocuments.get(n.uri);s!==void 0&&(s=this._configuration.update(s,i,o),this._syncedDocuments.set(n.uri,s),this._onDidChangeContent.fire(Object.freeze({document:s})))})),i.push(t.onDidCloseTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&(this._syncedDocuments.delete(t.textDocument.uri),this._onDidClose.fire(Object.freeze({document:n})))})),i.push(t.onWillSaveTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&this._onWillSave.fire(Object.freeze({document:n,reason:t.reason}))})),i.push(t.onWillSaveTextDocumentWaitUntil((t,n)=>{let i=this._syncedDocuments.get(t.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:t.reason}),n):[]})),i.push(t.onDidSaveTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&this._onDidSave.fire(Object.freeze({document:n}))})),n.Disposable.create(()=>{i.forEach(t=>t.dispose())})}};t.TextDocuments=TextDocuments})),Xr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookDocuments=t.NotebookSyncFeature=void 0;let n=Q(),i=Yr(),NotebookSyncFeature=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(n.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(n.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(n.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(n.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};t.NotebookSyncFeature=NotebookSyncFeature;var o=class CellTextDocumentConnection{onDidOpenTextDocument(t){return this.openHandler=t,n.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,n.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,n.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return CellTextDocumentConnection.NULL_DISPOSE}onDidSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}};o.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var NotebookDocuments=class{constructor(t){t instanceof i.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new i.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new n.Emitter,this._onDidChange=new n.Emitter,this._onDidSave=new n.Emitter,this._onDidClose=new n.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t==`string`?t:t.document,i=this.notebookCellMap.get(n);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let i=new o,s=[];return s.push(this.cellTextDocuments.listen(i)),s.push(t.notebooks.synchronization.onDidOpenNotebookDocument(t=>{this.notebookDocuments.set(t.notebookDocument.uri,t.notebookDocument);for(let n of t.cellTextDocuments)i.openTextDocument({textDocument:n});this.updateCellMap(t.notebookDocument),this._onDidOpen.fire(t.notebookDocument)})),s.push(t.notebooks.synchronization.onDidChangeNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);if(n===void 0)return;n.version=t.notebookDocument.version;let o=n.metadata,s=!1,c=t.change;c.metadata!==void 0&&(s=!0,n.metadata=c.metadata);let u=[],f=[],p=[],h=[];if(c.cells!==void 0){let t=c.cells;if(t.structure!==void 0){let o=t.structure.array;if(n.cells.splice(o.start,o.deleteCount,...o.cells===void 0?[]:o.cells),t.structure.didOpen!==void 0)for(let n of t.structure.didOpen)i.openTextDocument({textDocument:n}),u.push(n.uri);if(t.structure.didClose)for(let n of t.structure.didClose)i.closeTextDocument({textDocument:n}),f.push(n.uri)}if(t.data!==void 0){let i=new Map(t.data.map(t=>[t.document,t]));for(let t=0;t<=n.cells.length;t++){let o=i.get(n.cells[t].document);if(o!==void 0){let s=n.cells.splice(t,1,o);if(p.push({old:s[0],new:o}),i.delete(o.document),i.size===0)break}}}if(t.textContent!==void 0)for(let n of t.textContent)i.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),h.push(n.document.uri)}this.updateCellMap(n);let g={notebookDocument:n};s&&(g.metadata={old:o,new:n.metadata});let _=[];for(let t of u)_.push(this.getNotebookCell(t));let x=[];for(let t of f)x.push(this.getNotebookCell(t));let S=[];for(let t of h)S.push(this.getNotebookCell(t));(_.length>0||x.length>0||p.length>0||S.length>0)&&(g.cells={added:_,removed:x,changed:{data:p,textContent:S}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),s.push(t.notebooks.synchronization.onDidSaveNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);n!==void 0&&this._onDidSave.fire(n)})),s.push(t.notebooks.synchronization.onDidCloseNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);if(n!==void 0){this._onDidClose.fire(n);for(let n of t.cellTextDocuments)i.closeTextDocument({textDocument:n});this.notebookDocuments.delete(t.notebookDocument.uri);for(let t of n.cells)this.notebookCellMap.delete(t.document)}})),n.Disposable.create(()=>{s.forEach(t=>t.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};t.NotebookDocuments=NotebookDocuments})),Zr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerFeature=void 0;let n=Q(),MonikerFeature=t=>class extends t{get moniker(){return{on:t=>{let i=n.MonikerRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.MonikerFeature=MonikerFeature})),Qr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineNotebooksFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._NotebooksImpl=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=void 0;let n=Q(),i=Xn(),o=Fr(),s=Ir(),c=Lr(),u=Rr(),f=zr(),p=Br(),h=Vr(),g=Hr(),_=Ur(),x=Wr(),S=Gr(),T=Kr(),E=qr(),D=Jr(),ee=Xr(),O=Zr();function null2Undefined(t){if(t!==null)return t}var ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||=0,n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};t.ErrorMessageTracker=ErrorMessageTracker;var RemoteConsoleImpl=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(n.MessageType.Error,t)}warn(t){this.send(n.MessageType.Warning,t)}info(t){this.send(n.MessageType.Info,t)}log(t){this.send(n.MessageType.Log,t)}debug(t){this.send(n.MessageType.Debug,t)}send(t,i){this._rawConnection&&this._rawConnection.sendNotification(n.LogMessageNotification.type,{type:t,message:i}).catch(()=>{(0,n.RAL)().console.error(`Sending log message failed`)})}},_RemoteWindowImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...i){let o={type:n.MessageType.Error,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}showWarningMessage(t,...i){let o={type:n.MessageType.Warning,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}showInformationMessage(t,...i){let o={type:n.MessageType.Info,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}};let k=(0,h.ShowDocumentFeature)((0,s.ProgressFeature)(_RemoteWindowImpl));var A;(function(t){function create(){return new BulkRegistrationImpl}t.create=create})(A||(t.BulkRegistration=A={}));var BulkRegistrationImpl=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let s=i.string(t)?t:t.method;if(this._registered.has(s))throw Error(`${s} is already added to this registration`);let c=o.generateUuid();this._registrations.push({id:c,method:s,registerOptions:n||{}}),this._registered.add(s)}asRegistrationParams(){return{registrations:this._registrations}}},j;(function(t){function create(){return new BulkUnregistrationImpl(void 0,[])}t.create=create})(j||(t.BulkUnregistration=j={}));var BulkUnregistrationImpl=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(t=>{this._unregistrations.set(t.method,t)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let n of this._unregistrations.values())t.push(n);let i={unregisterations:t};this._connection.sendRequest(n.UnregistrationRequest.type,i).catch(()=>{this._connection.console.info(`Bulk unregistration failed.`)})}disposeSingle(t){let o=i.string(t)?t:t.method,s=this._unregistrations.get(o);if(!s)return!1;let c={unregisterations:[s]};return this._connection.sendRequest(n.UnregistrationRequest.type,c).then(()=>{this._unregistrations.delete(o)},t=>{this._connection.console.info(`Un-registering request handler for ${s.id} failed.`)}),!0}},RemoteClientImpl=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,i){return t instanceof BulkRegistrationImpl?this.registerMany(t):t instanceof BulkUnregistrationImpl?this.registerSingle1(t,n,i):this.registerSingle2(t,n)}registerSingle1(t,s,c){let u=i.string(s)?s:s.method,f=o.generateUuid(),p={registrations:[{id:f,method:u,registerOptions:c||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(n.RegistrationRequest.type,p).then(n=>(t.add({id:f,method:u}),t),t=>(this.connection.console.info(`Registering request handler for ${u} failed.`),Promise.reject(t)))}registerSingle2(t,s){let c=i.string(t)?t:t.method,u=o.generateUuid(),f={registrations:[{id:u,method:c,registerOptions:s||{}}]};return this.connection.sendRequest(n.RegistrationRequest.type,f).then(t=>n.Disposable.create(()=>{this.unregisterSingle(u,c).catch(()=>{this.connection.console.info(`Un-registering capability with id ${u} failed.`)})}),t=>(this.connection.console.info(`Registering request handler for ${c} failed.`),Promise.reject(t)))}unregisterSingle(t,i){let o={unregisterations:[{id:t,method:i}]};return this.connection.sendRequest(n.UnregistrationRequest.type,o).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let i=t.asRegistrationParams();return this.connection.sendRequest(n.RegistrationRequest.type,i).then(()=>new BulkUnregistrationImpl(this._connection,i.registrations.map(t=>({id:t.id,method:t.method}))),t=>(this.connection.console.info(`Bulk registration failed.`),Promise.reject(t)))}},_RemoteWorkspaceImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function isApplyWorkspaceEditParams(t){return t&&!!t.edit}let i=isApplyWorkspaceEditParams(t)?t:{edit:t};return this.connection.sendRequest(n.ApplyWorkspaceEditRequest.type,i)}};let M=(0,g.FileOperationsFeature)((0,u.WorkspaceFoldersFeature)((0,c.ConfigurationFeature)(_RemoteWorkspaceImpl)));var TracerImpl=class{constructor(){this._trace=n.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,i){this._trace!==n.Trace.Off&&this.connection.sendNotification(n.LogTraceNotification.type,{message:t,verbose:this._trace===n.Trace.Verbose?i:void 0}).catch(()=>{})}},TelemetryImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(n.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log(`Sending TelemetryEventNotification failed`)})}},_LanguagesImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,s.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,s.attachPartialResult)(this.connection,n)}};t._LanguagesImpl=_LanguagesImpl;let N=(0,T.FoldingRangeFeature)((0,O.MonikerFeature)((0,D.DiagnosticFeature)((0,E.InlayHintFeature)((0,S.InlineValueFeature)((0,x.TypeHierarchyFeature)((0,_.LinkedEditingRangeFeature)((0,p.SemanticTokensFeature)((0,f.CallHierarchyFeature)(_LanguagesImpl)))))))));var _NotebooksImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,s.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,s.attachPartialResult)(this.connection,n)}};t._NotebooksImpl=_NotebooksImpl;let P=(0,ee.NotebookSyncFeature)(_NotebooksImpl);function combineConsoleFeatures(t,n){return function(i){return n(t(i))}}t.combineConsoleFeatures=combineConsoleFeatures;function combineTelemetryFeatures(t,n){return function(i){return n(t(i))}}t.combineTelemetryFeatures=combineTelemetryFeatures;function combineTracerFeatures(t,n){return function(i){return n(t(i))}}t.combineTracerFeatures=combineTracerFeatures;function combineClientFeatures(t,n){return function(i){return n(t(i))}}t.combineClientFeatures=combineClientFeatures;function combineWindowFeatures(t,n){return function(i){return n(t(i))}}t.combineWindowFeatures=combineWindowFeatures;function combineWorkspaceFeatures(t,n){return function(i){return n(t(i))}}t.combineWorkspaceFeatures=combineWorkspaceFeatures;function combineLanguagesFeatures(t,n){return function(i){return n(t(i))}}t.combineLanguagesFeatures=combineLanguagesFeatures;function combineNotebooksFeatures(t,n){return function(i){return n(t(i))}}t.combineNotebooksFeatures=combineNotebooksFeatures;function combineFeatures(t,n){function combine(t,n,i){return t&&n?i(t,n):t||n}return{__brand:`features`,console:combine(t.console,n.console,combineConsoleFeatures),tracer:combine(t.tracer,n.tracer,combineTracerFeatures),telemetry:combine(t.telemetry,n.telemetry,combineTelemetryFeatures),client:combine(t.client,n.client,combineClientFeatures),window:combine(t.window,n.window,combineWindowFeatures),workspace:combine(t.workspace,n.workspace,combineWorkspaceFeatures),languages:combine(t.languages,n.languages,combineLanguagesFeatures),notebooks:combine(t.notebooks,n.notebooks,combineNotebooksFeatures)}}t.combineFeatures=combineFeatures;function createConnection(t,o,c){let u=c&&c.console?new(c.console(RemoteConsoleImpl)):new RemoteConsoleImpl,f=t(u);u.rawAttach(f);let p=c&&c.tracer?new(c.tracer(TracerImpl)):new TracerImpl,h=c&&c.telemetry?new(c.telemetry(TelemetryImpl)):new TelemetryImpl,g=c&&c.client?new(c.client(RemoteClientImpl)):new RemoteClientImpl,_=c&&c.window?new(c.window(k)):new k,x=c&&c.workspace?new(c.workspace(M)):new M,S=c&&c.languages?new(c.languages(N)):new N,T=c&&c.notebooks?new(c.notebooks(P)):new P,E=[u,p,h,g,_,x,S,T];function asPromise(t){return t instanceof Promise?t:i.thenable(t)?new Promise((n,i)=>{t.then(t=>n(t),t=>i(t))}):Promise.resolve(t)}let D,ee,O,A={listen:()=>f.listen(),sendRequest:(t,...n)=>f.sendRequest(i.string(t)?t:t.method,...n),onRequest:(t,n)=>f.onRequest(t,n),sendNotification:(t,n)=>{let o=i.string(t)?t:t.method;return f.sendNotification(o,n)},onNotification:(t,n)=>f.onNotification(t,n),onProgress:f.onProgress,sendProgress:f.sendProgress,onInitialize:t=>(ee=t,{dispose:()=>{ee=void 0}}),onInitialized:t=>f.onNotification(n.InitializedNotification.type,t),onShutdown:t=>(D=t,{dispose:()=>{D=void 0}}),onExit:t=>(O=t,{dispose:()=>{O=void 0}}),get console(){return u},get telemetry(){return h},get tracer(){return p},get client(){return g},get window(){return _},get workspace(){return x},get languages(){return S},get notebooks(){return T},onDidChangeConfiguration:t=>f.onNotification(n.DidChangeConfigurationNotification.type,t),onDidChangeWatchedFiles:t=>f.onNotification(n.DidChangeWatchedFilesNotification.type,t),__textDocumentSync:void 0,onDidOpenTextDocument:t=>f.onNotification(n.DidOpenTextDocumentNotification.type,t),onDidChangeTextDocument:t=>f.onNotification(n.DidChangeTextDocumentNotification.type,t),onDidCloseTextDocument:t=>f.onNotification(n.DidCloseTextDocumentNotification.type,t),onWillSaveTextDocument:t=>f.onNotification(n.WillSaveTextDocumentNotification.type,t),onWillSaveTextDocumentWaitUntil:t=>f.onRequest(n.WillSaveTextDocumentWaitUntilRequest.type,t),onDidSaveTextDocument:t=>f.onNotification(n.DidSaveTextDocumentNotification.type,t),sendDiagnostics:t=>f.sendNotification(n.PublishDiagnosticsNotification.type,t),onHover:t=>f.onRequest(n.HoverRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onCompletion:t=>f.onRequest(n.CompletionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCompletionResolve:t=>f.onRequest(n.CompletionResolveRequest.type,t),onSignatureHelp:t=>f.onRequest(n.SignatureHelpRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDeclaration:t=>f.onRequest(n.DeclarationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDefinition:t=>f.onRequest(n.DefinitionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onTypeDefinition:t=>f.onRequest(n.TypeDefinitionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onImplementation:t=>f.onRequest(n.ImplementationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onReferences:t=>f.onRequest(n.ReferencesRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentHighlight:t=>f.onRequest(n.DocumentHighlightRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentSymbol:t=>f.onRequest(n.DocumentSymbolRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onWorkspaceSymbol:t=>f.onRequest(n.WorkspaceSymbolRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onWorkspaceSymbolResolve:t=>f.onRequest(n.WorkspaceSymbolResolveRequest.type,t),onCodeAction:t=>f.onRequest(n.CodeActionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCodeActionResolve:t=>f.onRequest(n.CodeActionResolveRequest.type,(n,i)=>t(n,i)),onCodeLens:t=>f.onRequest(n.CodeLensRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCodeLensResolve:t=>f.onRequest(n.CodeLensResolveRequest.type,(n,i)=>t(n,i)),onDocumentFormatting:t=>f.onRequest(n.DocumentFormattingRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDocumentRangeFormatting:t=>f.onRequest(n.DocumentRangeFormattingRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDocumentOnTypeFormatting:t=>f.onRequest(n.DocumentOnTypeFormattingRequest.type,(n,i)=>t(n,i)),onRenameRequest:t=>f.onRequest(n.RenameRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onPrepareRename:t=>f.onRequest(n.PrepareRenameRequest.type,(n,i)=>t(n,i)),onDocumentLinks:t=>f.onRequest(n.DocumentLinkRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentLinkResolve:t=>f.onRequest(n.DocumentLinkResolveRequest.type,(n,i)=>t(n,i)),onDocumentColor:t=>f.onRequest(n.DocumentColorRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onColorPresentation:t=>f.onRequest(n.ColorPresentationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onFoldingRanges:t=>f.onRequest(n.FoldingRangeRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onSelectionRanges:t=>f.onRequest(n.SelectionRangeRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onExecuteCommand:t=>f.onRequest(n.ExecuteCommandRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),dispose:()=>f.dispose()};for(let t of E)t.attach(A);return f.onRequest(n.InitializeRequest.type,t=>{o.initialize(t),i.string(t.trace)&&(p.trace=n.Trace.fromString(t.trace));for(let n of E)n.initialize(t.capabilities);if(ee)return asPromise(ee(t,new n.CancellationTokenSource().token,(0,s.attachWorkDone)(f,t),void 0)).then(t=>{if(t instanceof n.ResponseError)return t;let o=t;o||={capabilities:{}};let s=o.capabilities;s||(s={},o.capabilities=s),s.textDocumentSync===void 0||s.textDocumentSync===null?s.textDocumentSync=i.number(A.__textDocumentSync)?A.__textDocumentSync:n.TextDocumentSyncKind.None:!i.number(s.textDocumentSync)&&!i.number(s.textDocumentSync.change)&&(s.textDocumentSync.change=i.number(A.__textDocumentSync)?A.__textDocumentSync:n.TextDocumentSyncKind.None);for(let t of E)t.fillServerCapabilities(s);return o});{let t={capabilities:{textDocumentSync:n.TextDocumentSyncKind.None}};for(let n of E)n.fillServerCapabilities(t.capabilities);return t}}),f.onRequest(n.ShutdownRequest.type,()=>{if(o.shutdownReceived=!0,D)return D(new n.CancellationTokenSource().token)}),f.onNotification(n.ExitNotification.type,()=>{try{O&&O()}finally{o.shutdownReceived?o.exit(0):o.exit(1)}}),f.onNotification(n.SetTraceNotification.type,t=>{p.trace=n.Trace.fromString(t.value)}),A}t.createConnection=createConnection})),$r=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveModulePath=t.FileSystem=t.resolveGlobalYarnPath=t.resolveGlobalNodePath=t.resolve=t.uriToFilePath=void 0;let n=s(`node:url`),i=s(`node:path`),o=s(`node:fs`),c=s(`node:child_process`);function uriToFilePath(t){let o=n.parse(t);if(o.protocol!==`file:`||!o.path)return;let s=o.path.split(`/`);for(var c=0,u=s.length;c<u;c++)s[c]=decodeURIComponent(s[c]);if(process.platform===`win32`&&s.length>1){let t=s[0],n=s[1];t.length===0&&n.length>1&&n[1]===`:`&&s.shift()}return i.normalize(s.join(`/`))}t.uriToFilePath=uriToFilePath;function isWindows(){return process.platform===`win32`}function resolve(t,n,s,u){let f=`NODE_PATH`,p=[`var p = process;`,`p.on('message',function(m){`,`if(m.c==='e'){`,`p.exit(0);`,`}`,`else if(m.c==='rs'){`,`try{`,`var r=require.resolve(m.a);`,`p.send({c:'r',s:true,r:r});`,`}`,`catch(err){`,`p.send({c:'r',s:false});`,`}`,`}`,`});`].join(``);return new Promise((h,g)=>{let _=process.env,x=Object.create(null);Object.keys(_).forEach(t=>x[t]=_[t]),n&&o.existsSync(n)&&(x[f]?x[f]=n+i.delimiter+x[f]:x[f]=n,u&&u(`NODE_PATH value is: ${x[f]}`)),x.ELECTRON_RUN_AS_NODE=`1`;try{let n=(0,c.fork)(``,[],{cwd:s,env:x,execArgv:[`-e`,p]});if(n.pid===void 0){g(Error(`Starting process to resolve node module ${t} failed`));return}n.on(`error`,t=>{g(t)}),n.on(`message`,i=>{i.c===`r`&&(n.send({c:`e`}),i.s?h(i.r):g(Error(`Failed to resolve module: ${t}`)))});let i={c:`rs`,a:t};n.send(i)}catch(t){g(t)}})}t.resolve=resolve;function resolveGlobalNodePath(t){let n=`npm`,o=Object.create(null);Object.keys(process.env).forEach(t=>o[t]=process.env[t]),o.NO_UPDATE_NOTIFIER=`true`;let s={encoding:`utf8`,env:o};isWindows()&&(n=`npm.cmd`,s.shell=!0);let handler=()=>{};try{process.on(`SIGPIPE`,handler);let o=(0,c.spawnSync)(n,[`config`,`get`,`prefix`],s).stdout;if(!o){t&&t(`'npm config get prefix' didn't return a value.`);return}let u=o.trim();return t&&t(`'npm config get prefix' value is: ${u}`),u.length>0?isWindows()?i.join(u,`node_modules`):i.join(u,`lib`,`node_modules`):void 0}catch{return}finally{process.removeListener(`SIGPIPE`,handler)}}t.resolveGlobalNodePath=resolveGlobalNodePath;function resolveGlobalYarnPath(t){let n=`yarn`,o={encoding:`utf8`};isWindows()&&(n=`yarn.cmd`,o.shell=!0);let handler=()=>{};try{process.on(`SIGPIPE`,handler);let s=(0,c.spawnSync)(n,[`global`,`dir`,`--json`],o),u=s.stdout;if(!u){t&&(t(`'yarn global dir' didn't return a value.`),s.stderr&&t(s.stderr));return}let f=u.trim().split(/\r?\n/);for(let t of f)try{let n=JSON.parse(t);if(n.type===`log`)return i.join(n.data,`node_modules`)}catch{}return}catch{return}finally{process.removeListener(`SIGPIPE`,handler)}}t.resolveGlobalYarnPath=resolveGlobalYarnPath;var u;(function(t){let n;function isCaseSensitive(){return n===void 0&&(n=process.platform===`win32`?!1:!o.existsSync(__filename.toUpperCase())||!o.existsSync(__filename.toLowerCase())),n}t.isCaseSensitive=isCaseSensitive;function isParent(t,n){return isCaseSensitive()?i.normalize(n).indexOf(i.normalize(t))===0:i.normalize(n).toLowerCase().indexOf(i.normalize(t).toLowerCase())===0}t.isParent=isParent})(u||(t.FileSystem=u={}));function resolveModulePath(t,n,o,s){return o?(i.isAbsolute(o)||(o=i.join(t,o)),resolve(n,o,o,s).then(t=>u.isParent(o,t)?t:Promise.reject(Error(`Failed to load ${n} from node path location.`))).then(void 0,i=>resolve(n,resolveGlobalNodePath(s),t,s))):resolve(n,resolveGlobalNodePath(s),t,s)}t.resolveModulePath=resolveModulePath})),ei=f(((t,n)=>{n.exports=Q()})),ti=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCompletionFeature=void 0;let n=Q(),InlineCompletionFeature=t=>class extends t{get inlineCompletion(){return{on:t=>this.connection.onRequest(n.InlineCompletionRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};t.InlineCompletionFeature=InlineCompletionFeature})),ni=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!==`default`&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;let o=Br();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return o.SemanticTokensBuilder}});let s=ti();i(Q(),t);let c=Yr();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return c.TextDocuments}});let u=Xr();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return u.NotebookDocuments}}),i(Qr(),t);var f;(function(t){t.all={__brand:`features`,languages:s.InlineCompletionFeature}})(f||(t.ProposedFeatures=f={}))})),ri=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!==`default`&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;let o=s(`node:util`),c=Xn(),u=Qr(),f=$r(),p=ei();i(ei(),t),i(ni(),t);var h;(function(t){t.uriToFilePath=f.uriToFilePath,t.resolveGlobalNodePath=f.resolveGlobalNodePath,t.resolveGlobalYarnPath=f.resolveGlobalYarnPath,t.resolve=f.resolve,t.resolveModulePath=f.resolveModulePath})(h||(t.Files=h={}));let g=!1,_;function setupExitTimer(){let t=`--clientProcessId`;function runTimer(t){try{let n=parseInt(t);isNaN(n)||(_=setInterval(()=>{try{process.kill(n,0)}catch{process.exit(+!g)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let i=process.argv[n];if(i===t&&n+1<process.argv.length){runTimer(process.argv[n+1]);return}else{let n=i.split(`=`);n[0]===t&&runTimer(n[1])}}}setupExitTimer();let x={initialize:t=>{let n=t.processId;c.number(n)&&_===void 0&&setInterval(()=>{try{process.kill(n,0)}catch{process.exit(+!g)}},3e3)},get shutdownReceived(){return g},set shutdownReceived(t){g=t},exit:t=>{process.exit(t)}};function createConnection(t,n,i,o){let s,c,u,f;return t!==void 0&&t.__brand===`features`&&(s=t,t=n,n=i,i=o),p.ConnectionStrategy.is(t)||p.ConnectionOptions.is(t)?f=t:(c=t,u=n,f=i),_createConnection(c,u,f,s)}t.createConnection=createConnection;function _createConnection(t,n,i,o){let s=!1;if(!t&&!n&&process.argv.length>2){let i,o,c=process.argv.slice(2);for(let u=0;u<c.length;u++){let h=c[u];if(h===`--node-ipc`){t=new p.IPCMessageReader(process),n=new p.IPCMessageWriter(process);break}else if(h===`--stdio`){s=!0,t=process.stdin,n=process.stdout;break}else if(h===`--socket`){i=parseInt(c[u+1]);break}else if(h===`--pipe`){o=c[u+1];break}else{var f=h.split(`=`);if(f[0]===`--socket`){i=parseInt(f[1]);break}else if(f[0]===`--pipe`){o=f[1];break}}}if(i){let o=(0,p.createServerSocketTransport)(i);t=o[0],n=o[1]}else if(o){let i=(0,p.createServerPipeTransport)(o);t=i[0],n=i[1]}}var h=`Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'`;if(!t)throw Error(`Connection input stream is not set. `+h);if(!n)throw Error(`Connection output stream is not set. `+h);if(c.func(t.read)&&c.func(t.on)){let n=t;n.on(`end`,()=>{process.exit(+!g)}),n.on(`close`,()=>{process.exit(+!g)})}let connectionFactory=o=>{let c=(0,p.createProtocolConnection)(t,n,o,i);return s&&patchConsole(o),c};return(0,u.createConnection)(connectionFactory,x,o)}function patchConsole(t){function serialize(t){return t.map(t=>typeof t==`string`?t:(0,o.inspect)(t)).join(` `)}let n=new Map;console.assert=function assert(n,...i){if(!n)if(i.length===0)t.error(`Assertion failed`);else{let[n,...o]=i;t.error(`Assertion failed: ${n} ${serialize(o)}`)}},console.count=function count(i=`default`){let o=String(i),s=n.get(o)??0;s+=1,n.set(o,s),t.log(`${o}: ${o}`)},console.countReset=function countReset(t){t===void 0?n.clear():n.delete(String(t))},console.debug=function debug(...n){t.log(serialize(n))},console.dir=function dir(n,i){t.log((0,o.inspect)(n,i))},console.log=function log(...n){t.log(serialize(n))},console.error=function error(...n){t.error(serialize(n))},console.trace=function trace(...n){let i=Error().stack.replace(/(.+\n){2}/,``),o=`Trace`;n.length!==0&&(o+=`: ${serialize(n)}`),t.log(`${o}\n${i}`)},console.warn=function warn(...n){t.warn(serialize(n))}}})),$=ri();function findNextFeatures(t,n){let i={stacks:t,tokens:n};return interpretTokens(i),i.stacks.flat().forEach(t=>{t.property=void 0}),findNextFeatureStacks(i.stacks).map(t=>t[t.length-1])}function findNextFeaturesInternal(t){let{next:n,cardinalities:i,visited:o,plus:s}=t,c=[],u=n.feature;if(o.has(u))return[];isGroup(u)||o.add(u);let f,p=u;for(;p.$container;)if(isGroup(p.$container)){f=p.$container;break}else if(isAbstractElement(p.$container))p=p.$container;else break;if(isArrayCardinality(p.cardinality)){let t=findFirstFeaturesInternal({next:{feature:p,type:n.type},cardinalities:i,visited:o,plus:s});for(let n of t)s.add(n.feature);c.push(...t)}if(f){let t=f.elements.indexOf(p);t!==void 0&&t<f.elements.length-1&&c.push(...findNextFeaturesInGroup({feature:f,type:n.type},t+1,i,o,s)),c.every(t=>isOptionalCardinality(t.feature.cardinality,t.feature)||isOptionalCardinality(i.get(t.feature))||s.has(t.feature))&&c.push(...findNextFeaturesInternal({next:{feature:f,type:n.type},cardinalities:i,visited:o,plus:s}))}return c}function findFirstFeatures(t){return isAstNode(t)&&(t={feature:t}),findFirstFeaturesInternal({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function findFirstFeaturesInternal(t){let{next:n,cardinalities:i,visited:o,plus:s}=t;if(n===void 0)return[];let{feature:c,type:u}=n;if(isGroup(c))return o.has(c)?[]:(o.add(c),findNextFeaturesInGroup(n,0,i,o,s).map(t=>modifyCardinality(t,c.cardinality,i)));if(isAlternatives(c)||isUnorderedGroup(c))return c.elements.flatMap(t=>findFirstFeaturesInternal({next:{feature:t,type:u,property:n.property},cardinalities:i,visited:o,plus:s})).map(t=>modifyCardinality(t,c.cardinality,i));if(isAssignment(c))return findFirstFeaturesInternal({next:{feature:c.terminal,type:u,property:n.property??c.feature},cardinalities:i,visited:o,plus:s}).map(t=>modifyCardinality(t,c.cardinality,i));if(isAction(c))return findNextFeaturesInternal({next:{feature:c,type:getTypeName(c),property:n.property??c.feature},cardinalities:i,visited:o,plus:s});if(isRuleCall(c)&&isParserRule(c.rule.ref)){let t=c.rule.ref;return findFirstFeaturesInternal({next:{feature:t.definition,type:t.fragment||t.dataType?void 0:getExplicitRuleType(t)??t.name,property:n.property},cardinalities:i,visited:o,plus:s}).map(t=>modifyCardinality(t,c.cardinality,i))}else return[n]}function modifyCardinality(t,n,i){return i.set(t.feature,n),t}function findNextFeaturesInGroup(t,n,i,o,s){let c=[],u;for(;n<t.feature.elements.length&&(u={feature:t.feature.elements[n++],type:t.type},c.push(...findFirstFeaturesInternal({next:u,cardinalities:i,visited:o,plus:s})),isOptionalCardinality(u.feature.cardinality??i.get(u.feature),u.feature)););return c}function interpretTokens(t){for(let n of t.tokens)t.stacks=findNextFeatureStacks(t.stacks,n)}function findNextFeatureStacks(t,n){let i=[];for(let o of t)i.push(...interpretStackToken(o,n));return i}function interpretStackToken(t,n){let i=new Map,o=new Set(t.map(t=>t.feature).filter(isPlusFeature)),s=[];for(;t.length>0;){let c=findNextFeaturesInternal({next:t.pop(),cardinalities:i,plus:o,visited:new Set}).filter(t=>n?featureMatches(t.feature,n):!0);for(let n of c)s.push([...t,n]);if(!c.every(t=>isOptionalCardinality(t.feature.cardinality,t.feature)||isOptionalCardinality(i.get(t.feature))))break}return s}function isPlusFeature(t){if(t.cardinality===`+`)return!0;let n=getContainerOfType(t,isAssignment);return!!(n&&n.cardinality===`+`)}function featureMatches(t,n){if(isKeyword(t))return t.value===n.image;if(isRuleCall(t))return ruleMatches(t.rule.ref,n);if(isCrossReference(t)){let i=getCrossReferenceTerminal(t);if(i)return featureMatches(i,n)}return!1}function ruleMatches(t,n){return isParserRule(t)?findFirstFeatures(t.definition).some(t=>featureMatches(t.feature,n)):isTerminalRule(t)?terminalRegex(t).test(n.image):!1}function mergeCompletionProviderOptions(t){let n=Array.from(new Set(t.flatMap(t=>t?.triggerCharacters??[]))),i=Array.from(new Set(t.flatMap(t=>t?.allCommitCharacters??[])));return{triggerCharacters:n.length>0?n:void 0,allCommitCharacters:i.length>0?i:void 0}}var DefaultCompletionProvider=class{constructor(t){this.scopeProvider=t.references.ScopeProvider,this.grammar=t.Grammar,this.completionParser=t.parser.CompletionParser,this.nameProvider=t.references.NameProvider,this.lexer=t.parser.Lexer,this.nodeKindProvider=t.shared.lsp.NodeKindProvider,this.fuzzyMatcher=t.shared.lsp.FuzzyMatcher,this.grammarConfig=t.parser.GrammarConfig,this.astReflection=t.shared.AstReflection,this.documentationProvider=t.documentation.DocumentationProvider}async getCompletion(t,n,i){let o=[],s=this.buildContexts(t,n.position),acceptor=(t,n)=>{let i=this.fillCompletionItem(t,n);i&&o.push(i)},distinctionFunction=t=>isKeyword(t.feature)?t.feature.value:t.feature,c=[];for(let t of s)if(await Promise.all(stream(t.features).distinct(distinctionFunction).exclude(c).map(n=>this.completionFor(t,n,acceptor))),c.push(...t.features),!this.continueCompletion(o))break;return $.CompletionList.create(this.deduplicateItems(o),!0)}deduplicateItems(t){return stream(t).distinct(t=>`${t.kind}_${t.label}_${t.detail}`).toArray()}findFeaturesAt(t,n){let i=t.getText({start:$.Position.create(0,0),end:t.positionAt(n)}),o=this.completionParser.parse(i),s=o.tokens;if(o.tokenIndex===0){let t=getEntryRule(this.grammar),n=findFirstFeatures({feature:t.definition,type:getExplicitRuleType(t)});return s.length>0?(s.shift(),findNextFeatures(n.map(t=>[t]),s)):n}let c=[...s].splice(o.tokenIndex);return findNextFeatures([o.elementStack.map(t=>({feature:t}))],c)}*buildContexts(t,n){let i=t.parseResult.value.$cstNode;if(!i)return;let o=t.textDocument,s=o.getText(),c=o.offsetAt(n),u={document:t,textDocument:o,offset:c,position:n},f=this.findDataTypeRuleStart(i,c);if(f){let[t,n]=f,s=findLeafNodeBeforeOffset(i,t)?.astNode;yield Object.assign(Object.assign({},u),{node:s,tokenOffset:t,tokenEndOffset:n,features:this.findFeaturesAt(o,t)})}let{nextTokenStart:p,nextTokenEnd:h,previousTokenStart:g,previousTokenEnd:_}=this.backtrackToAnyToken(s,c),x=p;c<=p&&g!==void 0&&(x=g);let S=findLeafNodeBeforeOffset(i,x)?.astNode,T=!0;if(g!==void 0&&_!==void 0&&_===c&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:g,tokenEndOffset:_,features:this.findFeaturesAt(o,g)}),T=this.performNextTokenCompletion(t,s.substring(g,_),g,_),T&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:_,tokenEndOffset:_,features:this.findFeaturesAt(o,_)}))),S)T&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(o,p)}));else{let t=getEntryRule(this.grammar);if(!t)throw Error(`Missing entry parser rule`);yield Object.assign(Object.assign({},u),{tokenOffset:p,tokenEndOffset:h,features:findFirstFeatures(t.definition)})}}performNextTokenCompletion(t,n,i,o){return/\P{L}$/u.test(n)}findDataTypeRuleStart(t,n){let i=findDeclarationNodeAtOffset(t,n,this.grammarConfig.nameRegexp),o=!!getContainerOfType(i?.grammarSource,isParserRule)?.dataType;if(o){for(;o;)i=i?.container,o=!!getContainerOfType(i?.grammarSource,isParserRule)?.dataType;if(i)return[i.offset,i.end]}}continueCompletion(t){return t.length===0}backtrackToAnyToken(t,n){let i=this.lexer.tokenize(t).tokens;if(i.length===0)return{nextTokenStart:n,nextTokenEnd:n};let o;for(let t of i){if(t.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0};if(t.endOffset>=n)return{nextTokenStart:t.startOffset,nextTokenEnd:t.endOffset+1,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0};o=t}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0}}completionFor(t,n,i){if(isKeyword(n.feature))return this.completionForKeyword(t,n.feature,i);if(isCrossReference(n.feature)&&t.node)return this.completionForCrossReference(t,n,i)}completionForCrossReference(t,n,i){let o=getContainerOfType(n.feature,isAssignment),s=t.node;if(o&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},assignMandatoryProperties(this.astReflection,s));let c={reference:{$refText:``},container:s,property:o.feature};try{for(let n of this.getReferenceCandidates(c,t))i(t,this.createReferenceCompletionItem(n))}catch(t){console.error(t)}}}getReferenceCandidates(t,n){return this.scopeProvider.getScope(t).getAllElements()}createReferenceCompletionItem(t){return{nodeDescription:t,kind:this.nodeKindProvider.getCompletionItemKind(t),documentation:this.getReferenceDocumentation(t),detail:t.type,sortText:`0`}}getReferenceDocumentation(t){if(!t.node)return;let n=this.documentationProvider.getDocumentation(t.node);if(n)return{kind:`markdown`,value:n}}completionForKeyword(t,n,i){this.filterKeyword(t,n)&&i(t,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:`Keyword`,sortText:`1`})}getKeywordCompletionItemKind(t){return $.CompletionItemKind.Keyword}filterKeyword(t,n){return/\p{L}/u.test(n.value)}fillCompletionItem(t,n){let i;if(typeof n.label==`string`)i=n.label;else if(`node`in n){let t=this.nameProvider.getName(n.node);if(!t)return;i=t}else if(`nodeDescription`in n)i=n.nodeDescription.name;else return;let o;o=typeof n.textEdit?.newText==`string`?n.textEdit.newText:typeof n.insertText==`string`?n.insertText:i;let s=n.textEdit??this.buildCompletionTextEdit(t,i,o);if(s)return{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:s,label:i}}buildCompletionTextEdit(t,n,i){let o=t.textDocument.getText().substring(t.tokenOffset,t.offset);if(this.fuzzyMatcher.match(o,n))return{newText:i,range:{start:t.textDocument.positionAt(t.tokenOffset),end:t.position}}}},DefaultDefinitionProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}getDefinition(t,n,i){let o=t.parseResult.value;if(o.$cstNode){let i=o.$cstNode,s=findDeclarationNodeAtOffset(i,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(s)return this.collectLocationLinks(s,n)}}collectLocationLinks(t,n){let i=this.findLink(t);if(i)return[$.LocationLink.create(i.targetDocument.textDocument.uri,(i.target.astNode.$cstNode??i.target).range,i.target.range,i.source.range)]}findLink(t){let n=this.references.findDeclarationNode(t);if(n?.astNode){let i=getDocument(n.astNode);if(n&&i)return{source:t,target:n,targetDocument:i}}}},DefaultDocumentHighlightProvider=class{constructor(t){this.references=t.references.References,this.nameProvider=t.references.NameProvider,this.grammarConfig=t.parser.GrammarConfig}getDocumentHighlight(t,n,i){let o=t.parseResult.value.$cstNode;if(!o)return;let s=findDeclarationNodeAtOffset(o,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;let c=this.references.findDeclaration(s);if(c){let n=Y.equals(getDocument(c).uri,t.uri),i={documentUri:t.uri,includeDeclaration:n};return this.references.findReferences(c,i).map(t=>this.createDocumentHighlight(t)).toArray()}}createDocumentHighlight(t){return $.DocumentHighlight.create(t.segment.range)}},DefaultDocumentSymbolProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.nodeKindProvider=t.shared.lsp.NodeKindProvider}getSymbols(t,n,i){return this.getSymbol(t,t.parseResult.value)}getSymbol(t,n){let i=n.$cstNode,o=this.nameProvider.getNameNode(n);if(o&&i){let s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||o.text,range:i.range,selectionRange:o.range,children:this.getChildSymbols(t,n)}]}else return this.getChildSymbols(t,n)||[]}getChildSymbols(t,n){let i=[];for(let o of streamContents(n)){let n=this.getSymbol(t,o);i.push(...n)}if(i.length>0)return i}},DefaultDocumentUpdateHandler=class{constructor(t){this.workspaceManager=t.workspace.WorkspaceManager,this.documentBuilder=t.workspace.DocumentBuilder,this.workspaceLock=t.workspace.WorkspaceLock,this.serviceRegistry=t.ServiceRegistry;let n=!1;t.lsp.LanguageServer.onInitialize(t=>{n=!!t.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration}),t.lsp.LanguageServer.onInitialized(i=>{n&&this.registerFileWatcher(t)})}registerFileWatcher(t){let n=[],i=stream(t.ServiceRegistry.all).flatMap(t=>t.LanguageMetaData.fileExtensions).map(t=>t.startsWith(`.`)?t.substring(1):t).distinct().toArray();i.length>0&&n.push({globPattern:i.length===1?`**/*.${i[0]}`:`**/*.{${i.join(`,`)}}`});let o=stream(t.ServiceRegistry.all).flatMap(t=>t.LanguageMetaData.fileNames??[]).distinct().toArray();if(o.length>0&&n.push({globPattern:o.length===1?`**/${o[0]}`:`**/{${o.join(`,`)}}`}),n.length>0){let i=t.lsp.Connection,o={watchers:n};i?.client.register($.DidChangeWatchedFilesNotification.type,o)}}fireDocumentUpdate(t,n){t=t.filter(t=>this.serviceRegistry.hasServices(t)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(i=>this.documentBuilder.update(t,n,i))}).catch(t=>{console.error(`Workspace initialization failed. Could not perform document update.`,t)})}didChangeContent(t){this.fireDocumentUpdate([J.parse(t.document.uri)],[])}didChangeWatchedFiles(t){let n=stream(t.changes).filter(t=>t.type!==$.FileChangeType.Deleted).distinct(t=>t.uri).map(t=>J.parse(t.uri)).toArray(),i=stream(t.changes).filter(t=>t.type===$.FileChangeType.Deleted).distinct(t=>t.uri).map(t=>J.parse(t.uri)).toArray();this.fireDocumentUpdate(n,i)}},DefaultFoldingRangeProvider=class{constructor(t){this.commentNames=t.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(t,n,i){let o=[],acceptor=t=>o.push(t);return this.collectFolding(t,acceptor),o}collectFolding(t,n){let i=t.parseResult?.value;if(i){if(this.shouldProcessContent(i)){let o=streamAllContents(i).iterator(),s;do if(s=o.next(),!s.done){let i=s.value;this.shouldProcess(i)&&this.collectObjectFolding(t,i,n),this.shouldProcessContent(i)||o.prune()}while(!s.done)}this.collectCommentFolding(t,i,n)}}shouldProcess(t){return!0}shouldProcessContent(t){return!0}collectObjectFolding(t,n,i){let o=n.$cstNode;if(o){let n=this.toFoldingRange(t,o);n&&i(n)}}collectCommentFolding(t,n,i){let o=n.$cstNode;if(o){for(let n of flattenCst(o))if(this.commentNames.includes(n.tokenType.name)){let o=this.toFoldingRange(t,n,$.FoldingRangeKind.Comment);o&&i(o)}}}toFoldingRange(t,n,i){let o=n.range,s=o.start,c=o.end;if(!(c.line-s.line<2))return this.includeLastFoldingLine(n,i)||(c=t.textDocument.positionAt(t.textDocument.offsetAt({line:c.line,character:0})-1)),$.FoldingRange.create(s.line,c.line,s.character,c.character,i)}includeLastFoldingLine(t,n){if(n===$.FoldingRangeKind.Comment)return!1;let i=t.text,o=i.charAt(i.length-1);return!(o===`}`||o===`)`||o===`]`)}},DefaultFuzzyMatcher=class{match(t,n){if(t.length===0)return!0;let i=!1,o,s=0,c=n.length;for(let u=0;u<c;u++){let c=n.charCodeAt(u),f=t.charCodeAt(s);if((c===f||this.toUpperCharCode(c)===this.toUpperCharCode(f))&&(i||=o===void 0||this.isWordTransition(o,c),i&&s++,s===t.length))return!0;o=c}return!1}isWordTransition(t,n){return ii<=t&&t<=ai&&oi<=n&&n<=si||t===ci&&n!==ci}toUpperCharCode(t){return ii<=t&&t<=ai?t-32:t}};const ii=97,ai=122,oi=65,si=90,ci=95;var AstNodeHoverProvider=class{constructor(t){this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}getHoverContent(t,n){let i=t.parseResult?.value?.$cstNode;if(i){let o=t.textDocument.offsetAt(n.position),s=findDeclarationNodeAtOffset(i,o,this.grammarConfig.nameRegexp);if(s&&s.offset+s.length>o){let t=this.references.findDeclaration(s);if(t)return this.getAstNodeHoverContent(t);if(isKeyword(s.grammarSource))return this.getKeywordHoverContent(s.grammarSource)}}}getKeywordHoverContent(t){let n=isAstNodeWithComment(t)?t.$comment:void 0;if(n||=findCommentNode(t.$cstNode,[`ML_COMMENT`])?.text,n&&isJSDoc(n)){let t=parseJSDoc(n).toMarkdown();if(t)return{contents:{kind:`markdown`,value:t}}}}},MultilineCommentHoverProvider=class extends AstNodeHoverProvider{constructor(t){super(t),this.documentationProvider=t.documentation.DocumentationProvider}getAstNodeHoverContent(t){let n=this.documentationProvider.getDocumentation(t);if(n)return{contents:{kind:`markdown`,value:n}}}},li=Q();const ui={[$.SemanticTokenTypes.class]:0,[$.SemanticTokenTypes.comment]:1,[$.SemanticTokenTypes.enum]:2,[$.SemanticTokenTypes.enumMember]:3,[$.SemanticTokenTypes.event]:4,[$.SemanticTokenTypes.function]:5,[$.SemanticTokenTypes.interface]:6,[$.SemanticTokenTypes.keyword]:7,[$.SemanticTokenTypes.macro]:8,[$.SemanticTokenTypes.method]:9,[$.SemanticTokenTypes.modifier]:10,[$.SemanticTokenTypes.namespace]:11,[$.SemanticTokenTypes.number]:12,[$.SemanticTokenTypes.operator]:13,[$.SemanticTokenTypes.parameter]:14,[$.SemanticTokenTypes.property]:15,[$.SemanticTokenTypes.regexp]:16,[$.SemanticTokenTypes.string]:17,[$.SemanticTokenTypes.struct]:18,[$.SemanticTokenTypes.type]:19,[$.SemanticTokenTypes.typeParameter]:20,[$.SemanticTokenTypes.variable]:21,[$.SemanticTokenTypes.decorator]:22},di={[$.SemanticTokenModifiers.abstract]:1,[$.SemanticTokenModifiers.async]:2,[$.SemanticTokenModifiers.declaration]:4,[$.SemanticTokenModifiers.defaultLibrary]:8,[$.SemanticTokenModifiers.definition]:16,[$.SemanticTokenModifiers.deprecated]:32,[$.SemanticTokenModifiers.documentation]:64,[$.SemanticTokenModifiers.modification]:128,[$.SemanticTokenModifiers.readonly]:256,[$.SemanticTokenModifiers.static]:512};function mergeSemanticTokenProviderOptions(t){let n=[],i=[],o=!0,s=!0,c=!0;for(let u of t)u&&(u.legend.tokenTypes.forEach((t,i)=>{let o=n[i];if(o&&o!==t)throw Error(`Cannot merge '${o}' and '${t}' token types. They use the same index ${i}.`);n[i]=t}),u.legend.tokenModifiers.forEach((t,n)=>{let o=i[n];if(o&&o!==t)throw Error(`Cannot merge '${o}' and '${t}' token modifier. They use the same index ${n}.`);i[n]=t}),u.full?typeof u.full==`object`&&!u.full.delta&&(s=!1):o=!1,u.range||(c=!1));return{legend:{tokenTypes:n,tokenModifiers:i},full:o&&{delta:s},range:c}}var SemanticTokensBuilder=class extends $.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(t,n,i,o,s){this._tokens.push({line:t,char:n,length:i,tokenType:o,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(let t of this._tokens.sort(this.compareTokens))super.push(t.line,t.char,t.length,t.tokenType,t.tokenModifiers);this._tokens=[]}compareTokens(t,n){return t.line===n.line?t.char-n.char:t.line-n.line}},AbstractSemanticTokenProvider=class{constructor(t){this.tokensBuilders=new Map,t.shared.workspace.TextDocuments.onDidClose(t=>{this.tokensBuilders.delete(t.document.uri)}),t.shared.lsp.LanguageServer.onInitialize(t=>{this.initialize(t.capabilities.textDocument?.semanticTokens)})}initialize(t){this.clientCapabilities=t}get tokenTypes(){return ui}get tokenModifiers(){return di}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(t,n,i=q.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.flush(),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.build()}async semanticHighlightRange(t,n,i=q.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.flush(),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.build()}async semanticHighlightDelta(t,n,i=q.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.buildEdits()}createAcceptor(){let acceptor=t=>{`line`in t?this.highlightToken({range:{start:{line:t.line,character:t.char},end:{line:t.line,character:t.char+t.length}},type:t.type,modifier:t.modifier}):`range`in t?this.highlightToken(t):`keyword`in t?this.highlightKeyword(t):`property`in t?this.highlightProperty(t):this.highlightNode({node:t.cst,type:t.type,modifier:t.modifier})};return acceptor}getDocumentTokensBuilder(t){let n=this.tokensBuilders.get(t.uri.toString());if(n)return n;let i=new SemanticTokensBuilder;return this.tokensBuilders.set(t.uri.toString(),i),i}async computeHighlighting(t,n,i){let o=t.parseResult.value,s=streamAst(o,{range:this.currentRange}).iterator(),c;do if(c=s.next(),!c.done){await interruptAndCheck(i);let t=c.value;this.highlightElement(t,n)===`prune`&&s.prune()}while(!c.done)}highlightToken(t){let{range:n,type:i}=t,o=t.modifier;if(this.currentRange&&!inRange(n,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;let s=this.tokenTypes[i],c=0;if(o!==void 0){typeof o==`string`&&(o=[o]);for(let t of o){let n=this.tokenModifiers[t];c|=n}}let u=n.start.line,f=n.end.line;if(u===f){let t=n.start.character,i=n.end.character-t;this.currentTokensBuilder.push(u,t,i,s,c)}else if(this.clientCapabilities?.multilineTokenSupport){let t=n.start.character,i=this.currentDocument.textDocument.offsetAt(n.start),o=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(u,t,o-i,s,c)}else{let t=n.start,i=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(t.line,t.character,i-t.character-1,s,c);for(let t=u+1;t<f;t++){let n=i;i=this.currentDocument.textDocument.offsetAt({line:t+1,character:0}),this.currentTokensBuilder.push(t,0,i-n-1,s,c)}this.currentTokensBuilder.push(f,0,n.end.character,s,c)}}highlightProperty(t){let n=[];if(typeof t.index==`number`){let i=findNodeForProperty(t.node.$cstNode,t.property,t.index);i&&n.push(i)}else n.push(...findNodesForProperty(t.node.$cstNode,t.property));let{type:i,modifier:o}=t;for(let t of n)this.highlightNode({node:t,type:i,modifier:o})}highlightKeyword(t){let{node:n,keyword:i,type:o,index:s,modifier:c}=t,u=[];if(typeof s==`number`){let t=findNodeForKeyword(n.$cstNode,i,s);t&&u.push(t)}else u.push(...findNodesForKeyword(n.$cstNode,i));for(let t of u)this.highlightNode({node:t,type:o,modifier:c})}highlightNode(t){let{node:n,type:i,modifier:o}=t,s=n.range;this.highlightToken({range:s,type:i,modifier:o})}},fi;(function(t){function decode(t,n,i){let o=new Map;Object.entries(n).forEach(([t,n])=>o.set(n,t));let s=0,c=0;return sliceIntoChunks(t.data,5).map(t=>{s+=t[0],t[0]!==0&&(c=0),c+=t[1];let n=t[2];return{offset:i.textDocument.offsetAt({line:s,character:c}),tokenType:o.get(t[3]),tokenModifiers:t[4],text:i.textDocument.getText({start:{line:s,character:c},end:{line:s,character:c+n}})}})}t.decode=decode;function sliceIntoChunks(t,n){let i=[];for(let o=0;o<t.length;o+=n){let s=t.slice(o,o+n);i.push(s)}return i}})(fi||={});function mergeSignatureHelpOptions(t){let n=[],i=[];t.forEach(t=>{t?.triggerCharacters&&n.push(...t.triggerCharacters),t?.retriggerCharacters&&i.push(...t.retriggerCharacters)});let o={triggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0,retriggerCharacters:i.length>0?Array.from(new Set(i)).sort():void 0};return o.triggerCharacters?o:void 0}var DefaultLanguageServer=class{constructor(t){this.onInitializeEmitter=new li.Emitter,this.onInitializedEmitter=new li.Emitter,this.services=t}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(t){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(t),this.onInitializeEmitter.fire(t),this.onInitializeEmitter.dispose(),this.buildInitializeResult(t)}eagerLoadServices(){eagerLoad(this.services),this.services.ServiceRegistry.all.forEach(t=>eagerLoad(t))}hasService(t){return this.services.ServiceRegistry.all.some(n=>t(n)!==void 0)}buildInitializeResult(t){let n=this.services.lsp.DocumentUpdateHandler,i=this.services.lsp.FileOperationHandler?.fileOperationOptions,o=this.services.ServiceRegistry.all,s=this.hasService(t=>t.lsp?.Formatter),c=o.map(t=>t.lsp?.Formatter?.formatOnTypeOptions).find(t=>!!t),u=this.hasService(t=>t.lsp?.CodeActionProvider),f=this.hasService(t=>t.lsp?.SemanticTokenProvider),p=mergeSemanticTokenProviderOptions(o.map(t=>t.lsp?.SemanticTokenProvider?.semanticTokensOptions)),h=this.services.lsp?.ExecuteCommandHandler?.commands,g=this.hasService(t=>t.lsp?.DocumentLinkProvider),_=mergeSignatureHelpOptions(o.map(t=>t.lsp?.SignatureHelp?.signatureHelpOptions)),x=this.hasService(t=>t.lsp?.TypeProvider),S=this.hasService(t=>t.lsp?.ImplementationProvider),T=this.hasService(t=>t.lsp?.CompletionProvider),E=mergeCompletionProviderOptions(o.map(t=>t.lsp?.CompletionProvider?.completionOptions)),D=this.hasService(t=>t.lsp?.ReferencesProvider),ee=this.hasService(t=>t.lsp?.DocumentSymbolProvider),O=this.hasService(t=>t.lsp?.DefinitionProvider),k=this.hasService(t=>t.lsp?.DocumentHighlightProvider),A=this.hasService(t=>t.lsp?.FoldingRangeProvider),j=this.hasService(t=>t.lsp?.HoverProvider),M=this.hasService(t=>t.lsp?.RenameProvider),N=this.hasService(t=>t.lsp?.CallHierarchyProvider),P=this.hasService(t=>t.lsp?.TypeHierarchyProvider),te=this.hasService(t=>t.lsp?.CodeLensProvider),F=this.hasService(t=>t.lsp?.DeclarationProvider),ne=this.hasService(t=>t.lsp?.InlayHintProvider),re=this.services.lsp?.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:i},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:li.TextDocumentSyncKind.Incremental,openClose:!0,save:!!n.didSaveDocument,willSave:!!n.willSaveDocument,willSaveWaitUntil:!!n.willSaveDocumentWaitUntil},completionProvider:T?E:void 0,referencesProvider:D,documentSymbolProvider:ee,definitionProvider:O,typeDefinitionProvider:x,documentHighlightProvider:k,codeActionProvider:u,documentFormattingProvider:s,documentRangeFormattingProvider:s,documentOnTypeFormattingProvider:c,foldingRangeProvider:A,hoverProvider:j,renameProvider:M?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:_,implementationProvider:S,callHierarchyProvider:N?{}:void 0,typeHierarchyProvider:P?{}:void 0,documentLinkProvider:g?{resolveProvider:!1}:void 0,codeLensProvider:te?{resolveProvider:!1}:void 0,declarationProvider:F,inlayHintProvider:ne?{resolveProvider:!1}:void 0,workspaceSymbolProvider:re?{resolveProvider:!!re.resolveSymbol}:void 0}}}initialized(t){this.fireInitializedOnDefaultServices(t),this.onInitializedEmitter.fire(t),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(t){this.services.workspace.ConfigurationProvider.initialize(t),this.services.workspace.WorkspaceManager.initialize(t)}fireInitializedOnDefaultServices(t){let n=this.services.lsp.Connection,i=n?Object.assign(Object.assign({},t),{register:t=>n.client.register(li.DidChangeConfigurationNotification.type,t),fetchConfiguration:t=>n.workspace.getConfiguration(t)}):t;this.services.workspace.ConfigurationProvider.initialized(i).catch(t=>console.error(`Error in ConfigurationProvider initialization:`,t)),this.services.workspace.WorkspaceManager.initialized(t).catch(t=>console.error(`Error in WorkspaceManager initialization:`,t))}};function startLanguageServer(t){let n=t.lsp.Connection;if(!n)throw Error(`Starting a language server requires the languageServer.Connection service to be set.`);addDocumentUpdateHandler(n,t),addFileOperationHandler(n,t),addDiagnosticsHandler(n,t),addCompletionHandler(n,t),addFindReferencesHandler(n,t),addDocumentSymbolHandler(n,t),addGotoDefinitionHandler(n,t),addGoToTypeDefinitionHandler(n,t),addGoToImplementationHandler(n,t),addDocumentHighlightsHandler(n,t),addFoldingRangeHandler(n,t),addFormattingHandler(n,t),addCodeActionHandler(n,t),addRenameHandler(n,t),addHoverHandler(n,t),addInlayHintHandler(n,t),addSemanticTokenHandler(n,t),addExecuteCommandHandler(n,t),addSignatureHelpHandler(n,t),addCallHierarchyHandler(n,t),addTypeHierarchyHandler(n,t),addCodeLensHandler(n,t),addDocumentLinkHandler(n,t),addConfigurationChangeHandler(n,t),addGoToDeclarationHandler(n,t),addWorkspaceSymbolHandler(n,t),n.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),n.onInitialized(n=>{t.lsp.LanguageServer.initialized(n)}),t.workspace.TextDocuments.listen(n),n.listen()}function addDocumentUpdateHandler(t,n){let i=n.lsp.DocumentUpdateHandler,o=n.workspace.TextDocuments;i.didOpenDocument&&o.onDidOpen(t=>i.didOpenDocument(t)),i.didChangeContent&&o.onDidChangeContent(t=>i.didChangeContent(t)),i.didCloseDocument&&o.onDidClose(t=>i.didCloseDocument(t)),i.didSaveDocument&&o.onDidSave(t=>i.didSaveDocument(t)),i.willSaveDocument&&o.onWillSave(t=>i.willSaveDocument(t)),i.willSaveDocumentWaitUntil&&o.onWillSaveWaitUntil(t=>i.willSaveDocumentWaitUntil(t)),i.didChangeWatchedFiles&&t.onDidChangeWatchedFiles(t=>i.didChangeWatchedFiles(t))}function addFileOperationHandler(t,n){let i=n.lsp.FileOperationHandler;i&&(i.didCreateFiles&&t.workspace.onDidCreateFiles(t=>i.didCreateFiles(t)),i.didRenameFiles&&t.workspace.onDidRenameFiles(t=>i.didRenameFiles(t)),i.didDeleteFiles&&t.workspace.onDidDeleteFiles(t=>i.didDeleteFiles(t)),i.willCreateFiles&&t.workspace.onWillCreateFiles(t=>i.willCreateFiles(t)),i.willRenameFiles&&t.workspace.onWillRenameFiles(t=>i.willRenameFiles(t)),i.willDeleteFiles&&t.workspace.onWillDeleteFiles(t=>i.willDeleteFiles(t)))}function addDiagnosticsHandler(t,n){let i=n.workspace.DocumentBuilder;i.onUpdate(async(n,i)=>{for(let n of i)t.sendDiagnostics({uri:n.toString(),diagnostics:[]})}),i.onDocumentPhase(X.Validated,async n=>{n.diagnostics&&t.sendDiagnostics({uri:n.uri.toString(),diagnostics:n.diagnostics})})}function addCompletionHandler(t,n){t.onCompletion(createRequestHandler((t,n,i,o)=>(t.lsp?.CompletionProvider)?.getCompletion(n,i,o),n,X.IndexedReferences))}function addFindReferencesHandler(t,n){t.onReferences(createRequestHandler((t,n,i,o)=>(t.lsp?.ReferencesProvider)?.findReferences(n,i,o),n,X.IndexedReferences))}function addCodeActionHandler(t,n){t.onCodeAction(createRequestHandler((t,n,i,o)=>(t.lsp?.CodeActionProvider)?.getCodeActions(n,i,o),n,X.Validated))}function addDocumentSymbolHandler(t,n){t.onDocumentSymbol(createRequestHandler((t,n,i,o)=>(t.lsp?.DocumentSymbolProvider)?.getSymbols(n,i,o),n,X.Parsed))}function addGotoDefinitionHandler(t,n){t.onDefinition(createRequestHandler((t,n,i,o)=>(t.lsp?.DefinitionProvider)?.getDefinition(n,i,o),n,X.IndexedReferences))}function addGoToTypeDefinitionHandler(t,n){t.onTypeDefinition(createRequestHandler((t,n,i,o)=>(t.lsp?.TypeProvider)?.getTypeDefinition(n,i,o),n,X.IndexedReferences))}function addGoToImplementationHandler(t,n){t.onImplementation(createRequestHandler((t,n,i,o)=>(t.lsp?.ImplementationProvider)?.getImplementation(n,i,o),n,X.IndexedReferences))}function addGoToDeclarationHandler(t,n){t.onDeclaration(createRequestHandler((t,n,i,o)=>(t.lsp?.DeclarationProvider)?.getDeclaration(n,i,o),n,X.IndexedReferences))}function addDocumentHighlightsHandler(t,n){t.onDocumentHighlight(createRequestHandler((t,n,i,o)=>(t.lsp?.DocumentHighlightProvider)?.getDocumentHighlight(n,i,o),n,X.IndexedReferences))}function addHoverHandler(t,n){t.onHover(createRequestHandler((t,n,i,o)=>(t.lsp?.HoverProvider)?.getHoverContent(n,i,o),n,X.IndexedReferences))}function addFoldingRangeHandler(t,n){t.onFoldingRanges(createRequestHandler((t,n,i,o)=>(t.lsp?.FoldingRangeProvider)?.getFoldingRanges(n,i,o),n,X.Parsed))}function addFormattingHandler(t,n){t.onDocumentFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocument(n,i,o),n,X.Parsed)),t.onDocumentRangeFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocumentRange(n,i,o),n,X.Parsed)),t.onDocumentOnTypeFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocumentOnType(n,i,o),n,X.Parsed))}function addRenameHandler(t,n){t.onRenameRequest(createRequestHandler((t,n,i,o)=>(t.lsp?.RenameProvider)?.rename(n,i,o),n,X.IndexedReferences)),t.onPrepareRename(createRequestHandler((t,n,i,o)=>(t.lsp?.RenameProvider)?.prepareRename(n,i,o),n,X.IndexedReferences))}function addInlayHintHandler(t,n){t.languages.inlayHint.on(createServerRequestHandler((t,n,i,o)=>(t.lsp?.InlayHintProvider)?.getInlayHints(n,i,o),n,X.IndexedReferences))}function addSemanticTokenHandler(t,n){let i={data:[]};t.languages.semanticTokens.on(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlight(n,o,s):i,n,X.IndexedReferences)),t.languages.semanticTokens.onDelta(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlightDelta(n,o,s):i,n,X.IndexedReferences)),t.languages.semanticTokens.onRange(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlightRange(n,o,s):i,n,X.IndexedReferences))}function addConfigurationChangeHandler(t,n){t.onDidChangeConfiguration(t=>{t.settings&&n.workspace.ConfigurationProvider.updateConfiguration(t)})}function addExecuteCommandHandler(t,n){let i=n.lsp.ExecuteCommandHandler;i&&t.onExecuteCommand(async(t,n)=>{try{return await i.executeCommand(t.command,t.arguments??[],n)}catch(t){return responseError(t)}})}function addDocumentLinkHandler(t,n){t.onDocumentLinks(createServerRequestHandler((t,n,i,o)=>(t.lsp?.DocumentLinkProvider)?.getDocumentLinks(n,i,o),n,X.Parsed))}function addSignatureHelpHandler(t,n){t.onSignatureHelp(createServerRequestHandler((t,n,i,o)=>(t.lsp?.SignatureHelp)?.provideSignatureHelp(n,i,o),n,X.IndexedReferences))}function addCodeLensHandler(t,n){t.onCodeLens(createServerRequestHandler((t,n,i,o)=>(t.lsp?.CodeLensProvider)?.provideCodeLens(n,i,o),n,X.IndexedReferences))}function addWorkspaceSymbolHandler(t,n){let i=n.lsp.WorkspaceSymbolProvider;if(i){let o=n.workspace.DocumentBuilder;t.onWorkspaceSymbol(async(t,n)=>{try{return await o.waitUntil(X.IndexedContent,n),await i.getSymbols(t,n)}catch(t){return responseError(t)}});let s=i.resolveSymbol?.bind(i);s&&t.onWorkspaceSymbolResolve(async(t,n)=>{try{return await o.waitUntil(X.IndexedContent,n),await s(t,n)}catch(t){return responseError(t)}})}}function addCallHierarchyHandler(t,n){t.languages.callHierarchy.onPrepare(createServerRequestHandler(async(t,n,i,o)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.prepareCallHierarchy(n,i,o)??null:null,n,X.IndexedReferences)),t.languages.callHierarchy.onIncomingCalls(createHierarchyRequestHandler(async(t,n,i)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.incomingCalls(n,i)??null:null,n)),t.languages.callHierarchy.onOutgoingCalls(createHierarchyRequestHandler(async(t,n,i)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.outgoingCalls(n,i)??null:null,n))}function addTypeHierarchyHandler(t,n){n.ServiceRegistry.all.some(t=>t.lsp?.TypeHierarchyProvider)&&(t.languages.typeHierarchy.onPrepare(createServerRequestHandler(async(t,n,i,o)=>await(t.lsp?.TypeHierarchyProvider)?.prepareTypeHierarchy(n,i,o)??null,n,X.IndexedReferences)),t.languages.typeHierarchy.onSupertypes(createHierarchyRequestHandler(async(t,n,i)=>await(t.lsp?.TypeHierarchyProvider)?.supertypes(n,i)??null,n)),t.languages.typeHierarchy.onSubtypes(createHierarchyRequestHandler(async(t,n,i)=>await(t.lsp?.TypeHierarchyProvider)?.subtypes(n,i)??null,n)))}function createHierarchyRequestHandler(t,n){let i=n.ServiceRegistry;return async(o,s)=>{let c=J.parse(o.item.uri),u=await waitUntilPhase(n,s,c,X.IndexedReferences);if(u)return u;if(!i.hasServices(c)){let t=`Could not find service instance for uri: '${c}'`;return console.debug(t),responseError(Error(t))}let f=i.getServices(c);try{return await t(f,o,s)}catch(t){return responseError(t)}}}function createServerRequestHandler(t,n,i){let o=n.workspace.LangiumDocuments,s=n.ServiceRegistry;return async(c,u)=>{let f=J.parse(c.textDocument.uri),p=await waitUntilPhase(n,u,f,i);if(p)return p;if(!s.hasServices(f)){let t=`Could not find service instance for uri: '${f}'`;return console.debug(t),responseError(Error(t))}let h=s.getServices(f);try{return await t(h,await o.getOrCreateDocument(f),c,u)}catch(t){return responseError(t)}}}function createRequestHandler(t,n,i){let o=n.workspace.LangiumDocuments,s=n.ServiceRegistry;return async(c,u)=>{let f=J.parse(c.textDocument.uri),p=await waitUntilPhase(n,u,f,i);if(p)return p;if(!s.hasServices(f))return console.debug(`Could not find service instance for uri: '${f.toString()}'`),null;let h=s.getServices(f);try{return await t(h,await o.getOrCreateDocument(f),c,u)}catch(t){return responseError(t)}}}async function waitUntilPhase(t,n,i,o){if(o!==void 0){let s=t.workspace.DocumentBuilder;try{await s.waitUntil(o,i,n)}catch(t){return responseError(t)}}}function responseError(t){if(isOperationCancelled(t))return new li.ResponseError(li.LSPErrorCodes.RequestCancelled,`The request has been cancelled.`);if(t instanceof li.ResponseError)return t;throw t}var DefaultNodeKindProvider=class{getSymbolKind(t){return $.SymbolKind.Field}getCompletionItemKind(t){return $.CompletionItemKind.Reference}},DefaultReferencesProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}findReferences(t,n,i){let o=t.parseResult.value.$cstNode;if(!o)return[];let s=findDeclarationNodeAtOffset(o,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,t):[]}getReferences(t,n,i){let o=[],s=this.references.findDeclaration(t);if(s){let t={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,t).forEach(t=>{o.push($.Location.create(t.sourceUri.toString(),t.segment.range))})}return o}};vn();var DefaultRenameProvider=class{constructor(t){this.references=t.references.References,this.nameProvider=t.references.NameProvider,this.grammarConfig=t.parser.GrammarConfig}async rename(t,n,i){let o={},s=t.parseResult.value.$cstNode;if(!s)return;let c=findDeclarationNodeAtOffset(s,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!c)return;let u=this.references.findDeclaration(c);if(u)return this.references.findReferences(u,{onlyLocal:!1,includeDeclaration:!0}).forEach(t=>{let i=dt.replace(t.segment.range,n.newName),s=t.sourceUri.toString();o[s]?o[s].push(i):o[s]=[i]}),{changes:o}}prepareRename(t,n,i){return this.renameNodeRange(t,n.position)}renameNodeRange(t,n){let i=t.parseResult.value.$cstNode,o=t.textDocument.offsetAt(n);if(i&&o){let t=findDeclarationNodeAtOffset(i,o,this.grammarConfig.nameRegexp);if(!t)return;if(this.references.findDeclaration(t)||this.isNameNode(t))return t.range}}isNameNode(t){return t?.astNode&&isNamed(t.astNode)&&t===this.nameProvider.getNameNode(t.astNode)}},DefaultWorkspaceSymbolProvider=class{constructor(t){this.indexManager=t.workspace.IndexManager,this.nodeKindProvider=t.lsp.NodeKindProvider,this.fuzzyMatcher=t.lsp.FuzzyMatcher}async getSymbols(t,n=q.CancellationToken.None){let i=[],o=t.query.toLowerCase();for(let t of this.indexManager.allElements())if(await interruptAndCheck(n),this.fuzzyMatcher.match(o,t.name)){let n=this.getWorkspaceSymbol(t);n&&i.push(n)}return i}getWorkspaceSymbol(t){let n=t.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(t),name:t.name,location:{range:n.range,uri:t.documentUri.toString()}}}},NormalizedTextDocuments=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new $.Emitter,this._onDidOpen=new $.Emitter,this._onDidClose=new $.Emitter,this._onDidSave=new $.Emitter,this._onWillSave=new $.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(Y.normalize(t))}set(t){let n=Y.normalize(t.uri),i=!0;this._syncedDocuments.has(n)&&(i=!1),this._syncedDocuments.set(n,t);let o=Object.freeze({document:t});return this._onDidOpen.fire(o),this._onDidChangeContent.fire(o),i}delete(t){let n=Y.normalize(typeof t==`object`&&`uri`in t?t.uri:t),i=this._syncedDocuments.get(n);i!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:i})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=$.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(t=>{let n=t.textDocument,i=Y.normalize(n.uri),o=this._configuration.create(i,n.languageId,n.version,n.text);this._syncedDocuments.set(i,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(t=>{let n=t.textDocument,i=t.contentChanges;if(i.length===0)return;let{version:o}=n;if(o==null)throw Error(`Received document change event for ${n.uri} without valid version identifier`);let s=Y.normalize(n.uri),c=this._syncedDocuments.get(s);c!==void 0&&(c=this._configuration.update(c,i,o),this._syncedDocuments.set(s,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(t.onDidCloseTextDocument(t=>{let n=Y.normalize(t.textDocument.uri),i=this._syncedDocuments.get(n);i!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(t.onWillSaveTextDocument(t=>{let n=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));n!==void 0&&this._onWillSave.fire(Object.freeze({document:n,reason:t.reason}))})),n.push(t.onWillSaveTextDocumentWaitUntil((t,n)=>{let i=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:t.reason}),n):[]})),n.push(t.onDidSaveTextDocument(t=>{let n=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));n!==void 0&&this._onDidSave.fire(Object.freeze({document:n}))})),$.Disposable.create(()=>{n.forEach(t=>t.dispose())})}},NormalizedNotebookDocuments=class{constructor(t){this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new $.Emitter,this._onDidSave=new $.Emitter,this._onDidChange=new $.Emitter,this._onDidClose=new $.Emitter,`listen`in t?this._cellTextDocuments=t:this._cellTextDocuments=new NormalizedTextDocuments(t)}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(Y.normalize(t))}getNotebookCell(t){let n=this.notebookCellMap.get(Y.normalize(t));return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t==`string`||`scheme`in t?t:t.document,i=this.notebookCellMap.get(Y.normalize(n));return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let n=new pi,i=[];return i.push(this.cellTextDocuments.listen(n)),i.push(t.notebooks.synchronization.onDidOpenNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri);this.notebookDocuments.set(i,t.notebookDocument);for(let i of t.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(t.notebookDocument),this._onDidOpen.fire(t.notebookDocument)})),i.push(t.notebooks.synchronization.onDidChangeNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri),o=this.notebookDocuments.get(i);if(o===void 0)return;o.version=t.notebookDocument.version;let s=o.metadata,c=!1,u=t.change;u.metadata!==void 0&&(c=!0,o.metadata=u.metadata);let f=[],p=[],h=[],g=[];if(u.cells!==void 0){let t=u.cells;if(t.structure!==void 0){let i=t.structure.array;if(o.cells.splice(i.start,i.deleteCount,...i.cells===void 0?[]:i.cells),t.structure.didOpen!==void 0)for(let i of t.structure.didOpen)n.openTextDocument({textDocument:i}),f.push(i.uri);if(t.structure.didClose)for(let i of t.structure.didClose)n.closeTextDocument({textDocument:i}),p.push(i.uri)}if(t.data!==void 0){let n=new Map(t.data.map(t=>[t.document,t]));for(let t=0;t<=o.cells.length;t++){let i=n.get(o.cells[t].document);if(i!==void 0){let s=o.cells.splice(t,1,i);if(h.push({old:s[0],new:i}),n.delete(i.document),n.size===0)break}}}if(t.textContent!==void 0)for(let i of t.textContent)n.changeTextDocument({textDocument:i.document,contentChanges:i.changes}),g.push(i.document.uri)}this.updateCellMap(o);let _={notebookDocument:o};c&&(_.metadata={old:s,new:o.metadata});let x=[];for(let t of f)x.push(this.getNotebookCell(t));let S=[];for(let t of p)S.push(this.getNotebookCell(t));let T=[];for(let t of g)T.push(this.getNotebookCell(t));(x.length>0||S.length>0||h.length>0||T.length>0)&&(_.cells={added:x,removed:S,changed:{data:h,textContent:T}}),(_.metadata!==void 0||_.cells!==void 0)&&this._onDidChange.fire(_)})),i.push(t.notebooks.synchronization.onDidSaveNotebookDocument(t=>{let n=this.getNotebookDocument(t.notebookDocument.uri);n!==void 0&&this._onDidSave.fire(n)})),i.push(t.notebooks.synchronization.onDidCloseNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri),o=this.notebookDocuments.get(i);if(o!==void 0){this._onDidClose.fire(o);for(let i of t.cellTextDocuments)n.closeTextDocument({textDocument:i});this.notebookDocuments.delete(i);for(let t of o.cells)this.notebookCellMap.delete(t.document)}})),$.Disposable.create(()=>{i.forEach(t=>t.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}},pi=class CellTextDocumentConnection{onDidOpenTextDocument(t){return this.openHandler=t,$.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,$.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,$.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return CellTextDocumentConnection.NULL_DISPOSE}onDidSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}};pi.NULL_DISPOSE=Object.freeze({dispose:()=>{}});function createDefaultModule(t){return Wn.merge(createDefaultCoreModule(t),createDefaultLSPModule(t))}function createDefaultLSPModule(t){return{lsp:{CompletionProvider:t=>new DefaultCompletionProvider(t),DocumentSymbolProvider:t=>new DefaultDocumentSymbolProvider(t),HoverProvider:t=>new MultilineCommentHoverProvider(t),FoldingRangeProvider:t=>new DefaultFoldingRangeProvider(t),ReferencesProvider:t=>new DefaultReferencesProvider(t),DefinitionProvider:t=>new DefaultDefinitionProvider(t),DocumentHighlightProvider:t=>new DefaultDocumentHighlightProvider(t),RenameProvider:t=>new DefaultRenameProvider(t)},shared:()=>t.shared}}function createDefaultSharedModule(t){return Wn.merge(createDefaultSharedCoreModule(t),createDefaultSharedLSPModule(t))}function createDefaultSharedLSPModule(t){return{lsp:{Connection:()=>t.connection,LanguageServer:t=>new DefaultLanguageServer(t),DocumentUpdateHandler:t=>new DefaultDocumentUpdateHandler(t),WorkspaceSymbolProvider:t=>new DefaultWorkspaceSymbolProvider(t),NodeKindProvider:()=>new DefaultNodeKindProvider,FuzzyMatcher:()=>new DefaultFuzzyMatcher},workspace:{TextDocuments:()=>new NormalizedTextDocuments(An),NotebookDocuments:t=>new NormalizedNotebookDocuments(t.workspace.TextDocuments)}}}var AbstractFormatter=class{constructor(){this.collector=()=>{}}getNodeFormatter(t){return new DefaultNodeFormatter(t,this.collector)}formatDocument(t,n){let i=t.parseResult;return i.lexerErrors.length===0&&i.parserErrors.length===0?this.doDocumentFormat(t,n.options):[]}isFormatRangeErrorFree(t,n){let i=t.parseResult;return i.lexerErrors.length||i.parserErrors.length?Math.min(...i.lexerErrors.map(t=>t.line??Number.MAX_VALUE),...i.parserErrors.map(t=>t.token.startLine??Number.MAX_VALUE))>n.end.line:!0}formatDocumentRange(t,n){return this.isFormatRangeErrorFree(t,n.range)?this.doDocumentFormat(t,n.options,n.range):[]}formatDocumentOnType(t,n){let i={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(t,i)?this.doDocumentFormat(t,n.options,i):[]}get formatOnTypeOptions(){}doDocumentFormat(t,n,i){let o=new Map,collector=(t,n,i)=>{let s=this.nodeModeToKey(t,n),c=o.get(s),u=i.options.priority??0,f=c?.options.priority??0;(!c||f<=u)&&o.set(s,i)};this.collector=collector,this.iterateAstFormatting(t,i);let s=this.iterateCstFormatting(t,o,n,i);return this.avoidOverlappingEdits(t.textDocument,s)}avoidOverlappingEdits(t,n){let i=[];for(let o of n){let n=i[i.length-1];for(;n&&t.offsetAt(o.range.start)<t.offsetAt(n.range.end);)i.pop(),n=i[i.length-1];i.push(o)}return i.filter(n=>this.isNecessary(n,t))}iterateAstFormatting(t,n){let i=t.parseResult.value;this.format(i);let o=streamAllContents(i).iterator(),s;do if(s=o.next(),!s.done){let t=s.value;this.insideRange(t.$cstNode.range,n)?this.format(t):o.prune()}while(!s.done)}nodeModeToKey(t,n){return`${t.offset}:${t.end}:${n}`}insideRange(t,n){return!n||t.start.line<=n.start.line&&t.end.line>=n.end.line||t.start.line>=n.start.line&&t.end.line<=n.end.line||t.start.line<=n.end.line&&t.end.line>=n.end.line}isNecessary(t,n){return t.newText!==n.getText(t.range).replace(/\r/g,``)}iterateCstFormatting(t,n,i,o){let s={indentation:0,options:i,document:t.textDocument},c=[],u=this.iterateCstTree(t,s).iterator(),f,p;do if(p=u.next(),!p.done){let t=p.value,i=isLeafCstNode(t),u=this.nodeModeToKey(t,`prepend`),h=n.get(u);if(n.delete(u),h){let n=this.createTextEdit(f,t,h,s);for(let t of n)t&&this.insideRange(t.range,o)&&c.push(t)}let g=this.nodeModeToKey(t,`append`),_=n.get(g);if(n.delete(g),_){let n=getNextNode(t);if(n){let i=this.createTextEdit(t,n,_,s);for(let t of i)t&&this.insideRange(t.range,o)&&c.push(t)}}if(!h&&t.hidden){let n=this.createHiddenTextEdits(f,t,void 0,s);for(let t of n)t&&this.insideRange(t.range,o)&&c.push(t)}i&&(f=t)}while(!p.done);return c}createHiddenTextEdits(t,n,i,o){let s=n.range.start.line;if(t&&t.range.end.line===s)return[];let c=[],u={start:{character:0,line:s},end:n.range.start},f=o.document.getText(u),p=this.findFittingMove(u,i?.moves??[],o),h=this.getExistingIndentationCharacterCount(f,o),g=this.getIndentationCharacterCount(o,p)-h;if(g===0)return[];let _=``;g>0&&(_=(o.options.insertSpaces?` `:` `).repeat(g));let x=n.text.split(`
|
|
26
|
+
`)),n){let o=t.error?` Request failed: ${t.error.message} (${t.error.code}).`:``;z.log(`Received response '${n.method} - (${t.id})' in ${Date.now()-n.timerStart}ms.${o}`,i)}else z.log(`Received response ${t.id} without active response promise.`,i)}else logLSPMessage(`receive-response`,t)}function logLSPMessage(t,n){if(!z||R===_.Off)return;let i={isLSPMessage:!0,type:t,message:n,timestamp:Date.now()};z.log(i)}function throwIfClosedOrDisposed(){if(isClosed())throw new ee(D.Closed,`Connection is closed.`);if(isDisposed())throw new ee(D.Disposed,`Connection is disposed.`)}function throwIfListening(){if(isListening())throw new ee(D.AlreadyListening,`Connection is already listening`)}function throwIfNotListening(){if(!isListening())throw Error(`Call listen() first.`)}function undefinedToNull(t){return t===void 0?null:t}function nullToUndefined(t){if(t!==null)return t}function isNamedParam(t){return t!=null&&!Array.isArray(t)&&typeof t==`object`}function computeSingleParam(t,n){switch(t){case o.ParameterStructures.auto:return isNamedParam(n)?nullToUndefined(n):[undefinedToNull(n)];case o.ParameterStructures.byName:if(!isNamedParam(n))throw Error(`Received parameters by name but param is not an object literal.`);return nullToUndefined(n);case o.ParameterStructures.byPosition:return[undefinedToNull(n)];default:throw Error(`Unknown parameter structure ${t.toString()}`)}}function computeMessageParams(t,n){let i,o=t.numberOfParams;switch(o){case 0:i=void 0;break;case 1:i=computeSingleParam(t.parameterStructures,n[0]);break;default:i=[];for(let t=0;t<n.length&&t<o;t++)i.push(undefinedToNull(n[t]));if(n.length<o)for(let t=n.length;t<o;t++)i.push(null);break}return i}let ve={sendNotification:(t,...n)=>{throwIfClosedOrDisposed();let s,c;if(i.string(t)){s=t;let i=n[0],u=0,f=o.ParameterStructures.auto;o.ParameterStructures.is(i)&&(u=1,f=i);let p=n.length,h=p-u;switch(h){case 0:c=void 0;break;case 1:c=computeSingleParam(f,n[u]);break;default:if(f===o.ParameterStructures.byName)throw Error(`Received ${h} parameters for 'by Name' notification parameter structure.`);c=n.slice(u,p).map(t=>undefinedToNull(t));break}}else{let i=n;s=t.method,c=computeMessageParams(t,i)}let u={jsonrpc:`2.0`,method:s,params:c};return traceSendingNotification(u),O.write(u).catch(t=>{throw M.error(`Sending notification failed.`),t})},onNotification:(t,n)=>{throwIfClosedOrDisposed();let o;return i.func(t)?oe=t:n&&(i.string(t)?(o=t,se.set(t,{type:void 0,handler:n})):(o=t.method,se.set(t.method,{type:t,handler:n}))),{dispose:()=>{o===void 0?oe=void 0:se.delete(o)}}},onProgress:(t,n,i)=>{if(ce.has(n))throw Error(`Progress handler for token ${n} already registered`);return ce.set(n,i),{dispose:()=>{ce.delete(n)}}},sendProgress:(t,n,i)=>ve.sendNotification(h.type,{token:n,value:i}),onUnhandledProgress:ge.event,sendRequest:(t,...n)=>{throwIfClosedOrDisposed(),throwIfNotListening();let s,c,f;if(i.string(t)){s=t;let i=n[0],p=n[n.length-1],h=0,g=o.ParameterStructures.auto;o.ParameterStructures.is(i)&&(h=1,g=i);let _=n.length;u.CancellationToken.is(p)&&(--_,f=p);let x=_-h;switch(x){case 0:c=void 0;break;case 1:c=computeSingleParam(g,n[h]);break;default:if(g===o.ParameterStructures.byName)throw Error(`Received ${x} parameters for 'by Name' request parameter structure.`);c=n.slice(h,_).map(t=>undefinedToNull(t));break}}else{let i=n;s=t.method,c=computeMessageParams(t,i);let o=t.numberOfParams;f=u.CancellationToken.is(i[o])?i[o]:void 0}let p=te++,h;f&&(h=f.onCancellationRequested(()=>{let t=V.sender.sendCancellation(ve,p);return t===void 0?(M.log(`Received no promise from cancellation strategy when cancelling id ${p}`),Promise.resolve()):t.catch(()=>{M.log(`Sending cancellation messages for id ${p} failed`)})}));let g={jsonrpc:`2.0`,id:p,method:s,params:c};return traceSendingRequest(g),typeof V.sender.enableCancellation==`function`&&V.sender.enableCancellation(g),new Promise(async(t,n)=>{let resolveWithCleanup=n=>{t(n),V.sender.cleanup(p),h?.dispose()},rejectWithCleanup=t=>{n(t),V.sender.cleanup(p),h?.dispose()},i={method:s,timerStart:Date.now(),resolve:resolveWithCleanup,reject:rejectWithCleanup};try{await O.write(g),ue.set(p,i)}catch(t){throw M.error(`Sending request failed.`),i.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,t.message?t.message:`Unknown reason`)),t}})},onRequest:(t,n)=>{throwIfClosedOrDisposed();let o=null;return g.is(t)?(o=void 0,ie=t):i.string(t)?(o=null,n!==void 0&&(o=t,ae.set(t,{handler:n,type:void 0}))):n!==void 0&&(o=t.method,ae.set(t.method,{type:t,handler:n})),{dispose:()=>{o!==null&&(o===void 0?ie=void 0:ae.delete(o))}}},hasPendingResponse:()=>ue.size>0,trace:async(t,n,o)=>{let s=!1,c=S.Text;o!==void 0&&(i.boolean(o)?s=o:(s=o.sendNotification||!1,c=o.traceFormat||S.Text)),R=t,fe=c,z=R===_.Off?void 0:n,s&&!isClosed()&&!isDisposed()&&await ve.sendNotification(T.type,{value:_.toString(t)})},onError:pe.event,onClose:me.event,onUnhandledNotification:he.event,onDispose:_e.event,end:()=>{O.end()},dispose:()=>{if(isDisposed())return;B=F.Disposed,_e.fire(void 0);let t=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let n of ue.values())n.reject(t);ue=new Map,L=new Map,de=new Set,I=new s.LinkedMap,i.func(O.dispose)&&O.dispose(),i.func(x.dispose)&&x.dispose()},listen:()=>{throwIfClosedOrDisposed(),throwIfListening(),B=F.Listening,x.listen(callback)},inspect:()=>{(0,n.default)().console.log(`inspect`)}};return ve.onNotification(E.type,t=>{if(R===_.Off||!z)return;let n=R===_.Verbose||R===_.Compact;z.log(t.message,n?t.verbose:void 0)}),ve.onNotification(h.type,t=>{let n=ce.get(t.token);n?n(t.value):ge.fire(t)}),ve}t.createMessageConnection=createMessageConnection})),or=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;let n=Zn();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});let i=Qn();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return i.Touch}});let o=$n();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});let s=Tn();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});let c=En();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});let u=er();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return u.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return u.SharedArrayReceiverStrategy}});let f=nr();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});let p=rr();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});let h=ir();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return h.AbstractMessageBuffer}});let g=ar();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return g.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return g.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return g.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return g.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return g.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return g.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return g.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return g.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return g.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return g.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return g.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return g.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return g.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return g.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return g.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return g.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return g.MessageStrategy}}),t.RAL=Cn().default})),sr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=s(`node:util`),i=or();var o=class MessageBuffer extends i.AbstractMessageBuffer{constructor(t=`utf-8`){super(t)}emptyBuffer(){return MessageBuffer.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,i){return t instanceof Buffer?t.toString(i):new n.TextDecoder(i).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};o.emptyBuffer=Buffer.allocUnsafe(0);var ReadableStreamWrapper=class{constructor(t){this.stream=t}onClose(t){return this.stream.on(`close`,t),i.Disposable.create(()=>this.stream.off(`close`,t))}onError(t){return this.stream.on(`error`,t),i.Disposable.create(()=>this.stream.off(`error`,t))}onEnd(t){return this.stream.on(`end`,t),i.Disposable.create(()=>this.stream.off(`end`,t))}onData(t){return this.stream.on(`data`,t),i.Disposable.create(()=>this.stream.off(`data`,t))}},WritableStreamWrapper=class{constructor(t){this.stream=t}onClose(t){return this.stream.on(`close`,t),i.Disposable.create(()=>this.stream.off(`close`,t))}onError(t){return this.stream.on(`error`,t),i.Disposable.create(()=>this.stream.off(`error`,t))}onEnd(t){return this.stream.on(`end`,t),i.Disposable.create(()=>this.stream.off(`end`,t))}write(t,n){return new Promise((i,o)=>{let callback=t=>{t==null?i():o(t)};typeof t==`string`?this.stream.write(t,n,callback):this.stream.write(t,callback)})}end(){this.stream.end()}};let c=Object.freeze({messageBuffer:Object.freeze({create:t=>new o(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:(t,n)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),n.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:`application/json`,decode:(t,i)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(i.charset))):Promise.resolve(JSON.parse(new n.TextDecoder(i.charset).decode(t)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:t=>new ReadableStreamWrapper(t),asWritableStream:t=>new WritableStreamWrapper(t)}),console,timer:Object.freeze({setTimeout(t,n,...i){let o=setTimeout(t,n,...i);return{dispose:()=>clearTimeout(o)}},setImmediate(t,...n){let i=setImmediate(t,...n);return{dispose:()=>clearImmediate(i)}},setInterval(t,n,...i){let o=setInterval(t,n,...i);return{dispose:()=>clearInterval(o)}}})});function RIL(){return c}(function(t){function install(){i.RAL.install(c)}t.install=install})(RIL||={}),t.default=RIL})),cr=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;let o=sr();o.default.install();let c=s(`node:path`),u=s(`node:os`),f=s(`node:crypto`),p=s(`node:net`),h=or();i(or(),t);var IPCMessageReader=class extends h.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on(`error`,t=>this.fireError(t)),n.on(`close`,()=>this.fireClose())}listen(t){return this.process.on(`message`,t),h.Disposable.create(()=>this.process.off(`message`,t))}};t.IPCMessageReader=IPCMessageReader;var IPCMessageWriter=class extends h.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on(`error`,t=>this.fireError(t)),n.on(`close`,()=>this.fireClose)}write(t){try{return typeof this.process.send==`function`&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};t.IPCMessageWriter=IPCMessageWriter;var PortMessageReader=class extends h.AbstractMessageReader{constructor(t){super(),this.onData=new h.Emitter,t.on(`close`,()=>this.fireClose),t.on(`error`,t=>this.fireError(t)),t.on(`message`,t=>{this.onData.fire(t)})}listen(t){return this.onData.event(t)}};t.PortMessageReader=PortMessageReader;var PortMessageWriter=class extends h.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on(`close`,()=>this.fireClose()),t.on(`error`,t=>this.fireError(t))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};t.PortMessageWriter=PortMessageWriter;var SocketMessageReader=class extends h.ReadableStreamMessageReader{constructor(t,n=`utf-8`){super((0,o.default)().stream.asReadableStream(t),n)}};t.SocketMessageReader=SocketMessageReader;var SocketMessageWriter=class extends h.WriteableStreamMessageWriter{constructor(t,n){super((0,o.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};t.SocketMessageWriter=SocketMessageWriter;var StreamMessageReader=class extends h.ReadableStreamMessageReader{constructor(t,n){super((0,o.default)().stream.asReadableStream(t),n)}};t.StreamMessageReader=StreamMessageReader;var StreamMessageWriter=class extends h.WriteableStreamMessageWriter{constructor(t,n){super((0,o.default)().stream.asWritableStream(t),n)}};t.StreamMessageWriter=StreamMessageWriter;let g=process.env.XDG_RUNTIME_DIR,_=new Map([[`linux`,107],[`darwin`,103]]);function generateRandomPipeName(){let t=(0,f.randomBytes)(21).toString(`hex`);if(process.platform===`win32`)return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let n;n=g?c.join(g,`vscode-ipc-${t}.sock`):c.join(u.tmpdir(),`vscode-${t}.sock`);let i=_.get(process.platform);return i!==void 0&&n.length>i&&(0,o.default)().console.warn(`WARNING: IPC handle "${n}" is longer than ${i} characters.`),n}t.generateRandomPipeName=generateRandomPipeName;function createClientPipeTransport(t,n=`utf-8`){let i,o=new Promise((t,n)=>{i=t});return new Promise((s,c)=>{let u=(0,p.createServer)(t=>{u.close(),i([new SocketMessageReader(t,n),new SocketMessageWriter(t,n)])});u.on(`error`,c),u.listen(t,()=>{u.removeListener(`error`,c),s({onConnected:()=>o})})})}t.createClientPipeTransport=createClientPipeTransport;function createServerPipeTransport(t,n=`utf-8`){let i=(0,p.createConnection)(t);return[new SocketMessageReader(i,n),new SocketMessageWriter(i,n)]}t.createServerPipeTransport=createServerPipeTransport;function createClientSocketTransport(t,n=`utf-8`){let i,o=new Promise((t,n)=>{i=t});return new Promise((s,c)=>{let u=(0,p.createServer)(t=>{u.close(),i([new SocketMessageReader(t,n),new SocketMessageWriter(t,n)])});u.on(`error`,c),u.listen(t,`127.0.0.1`,()=>{u.removeListener(`error`,c),s({onConnected:()=>o})})})}t.createClientSocketTransport=createClientSocketTransport;function createServerSocketTransport(t,n=`utf-8`){let i=(0,p.createConnection)(t,`127.0.0.1`);return[new SocketMessageReader(i,n),new SocketMessageWriter(i,n)]}t.createServerSocketTransport=createServerSocketTransport;function isReadableStream(t){let n=t;return n.read!==void 0&&n.addListener!==void 0}function isWritableStream(t){let n=t;return n.write!==void 0&&n.addListener!==void 0}function createMessageConnection(t,n,i,o){i||=h.NullLogger;let s=isReadableStream(t)?new StreamMessageReader(t):t,c=isWritableStream(n)?new StreamMessageWriter(n):n;return h.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,h.createMessageConnection)(s,c,i,o)}t.createMessageConnection=createMessageConnection})),lr=f(((t,n)=>{n.exports=cr()})),Z=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;let n=cr();var i;(function(t){t.clientToServer=`clientToServer`,t.serverToClient=`serverToClient`,t.both=`both`})(i||(t.MessageDirection=i={}));var RegistrationType=class{constructor(t){this.method=t}};t.RegistrationType=RegistrationType;var ProtocolRequestType0=class extends n.RequestType0{constructor(t){super(t)}};t.ProtocolRequestType0=ProtocolRequestType0;var ProtocolRequestType=class extends n.RequestType{constructor(t){super(t,n.ParameterStructures.byName)}};t.ProtocolRequestType=ProtocolRequestType;var ProtocolNotificationType0=class extends n.NotificationType0{constructor(t){super(t)}};t.ProtocolNotificationType0=ProtocolNotificationType0;var ProtocolNotificationType=class extends n.NotificationType{constructor(t){super(t,n.ParameterStructures.byName)}};t.ProtocolNotificationType=ProtocolNotificationType})),ur=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function boolean(t){return t===!0||t===!1}t.boolean=boolean;function string(t){return typeof t==`string`||t instanceof String}t.string=string;function number(t){return typeof t==`number`||t instanceof Number}t.number=number;function error(t){return t instanceof Error}t.error=error;function func(t){return typeof t==`function`}t.func=func;function array(t){return Array.isArray(t)}t.array=array;function stringArray(t){return array(t)&&t.every(t=>string(t))}t.stringArray=stringArray;function typedArray(t,n){return Array.isArray(t)&&t.every(n)}t.typedArray=typedArray;function objectLiteral(t){return typeof t==`object`&&!!t}t.objectLiteral=objectLiteral})),dr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/implementation`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ImplementationRequest=i={}))})),fr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/typeDefinition`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.TypeDefinitionRequest=i={}))})),pr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;let n=Z();var i;(function(t){t.method=`workspace/workspaceFolders`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(i||(t.WorkspaceFoldersRequest=i={}));var o;(function(t){t.method=`workspace/didChangeWorkspaceFolders`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(o||(t.DidChangeWorkspaceFoldersNotification=o={}))})),mr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;let n=Z();var i;(function(t){t.method=`workspace/configuration`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ConfigurationRequest=i={}))})),hr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/documentColor`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.DocumentColorRequest=i={}));var o;(function(t){t.method=`textDocument/colorPresentation`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.ColorPresentationRequest=o={}))})),gr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/foldingRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.FoldingRangeRequest=i={}));var o;(function(t){t.method=`workspace/foldingRange/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(o||(t.FoldingRangeRefreshRequest=o={}))})),_r=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/declaration`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.DeclarationRequest=i={}))})),vr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/selectionRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.SelectionRangeRequest=i={}))})),yr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;let n=cr(),i=Z();var o;(function(t){t.type=new n.ProgressType;function is(n){return n===t.type}t.is=is})(o||(t.WorkDoneProgress=o={}));var s;(function(t){t.method=`window/workDoneProgress/create`,t.messageDirection=i.MessageDirection.serverToClient,t.type=new i.ProtocolRequestType(t.method)})(s||(t.WorkDoneProgressCreateRequest=s={}));var c;(function(t){t.method=`window/workDoneProgress/cancel`,t.messageDirection=i.MessageDirection.clientToServer,t.type=new i.ProtocolNotificationType(t.method)})(c||(t.WorkDoneProgressCancelNotification=c={}))})),br=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/prepareCallHierarchy`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.CallHierarchyPrepareRequest=i={}));var o;(function(t){t.method=`callHierarchy/incomingCalls`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.CallHierarchyIncomingCallsRequest=o={}));var s;(function(t){t.method=`callHierarchy/outgoingCalls`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.CallHierarchyOutgoingCallsRequest=s={}))})),xr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;let n=Z();var i;(function(t){t.Relative=`relative`})(i||(t.TokenFormat=i={}));var o;(function(t){t.method=`textDocument/semanticTokens`,t.type=new n.RegistrationType(t.method)})(o||(t.SemanticTokensRegistrationType=o={}));var s;(function(t){t.method=`textDocument/semanticTokens/full`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(s||(t.SemanticTokensRequest=s={}));var c;(function(t){t.method=`textDocument/semanticTokens/full/delta`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(c||(t.SemanticTokensDeltaRequest=c={}));var u;(function(t){t.method=`textDocument/semanticTokens/range`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method),t.registrationMethod=o.method})(u||(t.SemanticTokensRangeRequest=u={}));var f;(function(t){t.method=`workspace/semanticTokens/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(f||(t.SemanticTokensRefreshRequest=f={}))})),Sr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;let n=Z();var i;(function(t){t.method=`window/showDocument`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(i||(t.ShowDocumentRequest=i={}))})),Cr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/linkedEditingRange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.LinkedEditingRangeRequest=i={}))})),wr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;let n=Z();var i;(function(t){t.file=`file`,t.folder=`folder`})(i||(t.FileOperationPatternKind=i={}));var o;(function(t){t.method=`workspace/willCreateFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.WillCreateFilesRequest=o={}));var s;(function(t){t.method=`workspace/didCreateFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(s||(t.DidCreateFilesNotification=s={}));var c;(function(t){t.method=`workspace/willRenameFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(c||(t.WillRenameFilesRequest=c={}));var u;(function(t){t.method=`workspace/didRenameFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(u||(t.DidRenameFilesNotification=u={}));var f;(function(t){t.method=`workspace/didDeleteFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(f||(t.DidDeleteFilesNotification=f={}));var p;(function(t){t.method=`workspace/willDeleteFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(p||(t.WillDeleteFilesRequest=p={}))})),Tr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;let n=Z();var i;(function(t){t.document=`document`,t.project=`project`,t.group=`group`,t.scheme=`scheme`,t.global=`global`})(i||(t.UniquenessLevel=i={}));var o;(function(t){t.$import=`import`,t.$export=`export`,t.local=`local`})(o||(t.MonikerKind=o={}));var s;(function(t){t.method=`textDocument/moniker`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.MonikerRequest=s={}))})),Er=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/prepareTypeHierarchy`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.TypeHierarchyPrepareRequest=i={}));var o;(function(t){t.method=`typeHierarchy/supertypes`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.TypeHierarchySupertypesRequest=o={}));var s;(function(t){t.method=`typeHierarchy/subtypes`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(s||(t.TypeHierarchySubtypesRequest=s={}))})),Dr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlineValue`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlineValueRequest=i={}));var o;(function(t){t.method=`workspace/inlineValue/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(o||(t.InlineValueRefreshRequest=o={}))})),Or=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlayHint`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlayHintRequest=i={}));var o;(function(t){t.method=`inlayHint/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(o||(t.InlayHintResolveRequest=o={}));var s;(function(t){t.method=`workspace/inlayHint/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(s||(t.InlayHintRefreshRequest=s={}))})),kr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;let n=cr(),i=ur(),o=Z();var s;(function(t){function is(t){let n=t;return n&&i.boolean(n.retriggerRequest)}t.is=is})(s||(t.DiagnosticServerCancellationData=s={}));var c;(function(t){t.Full=`full`,t.Unchanged=`unchanged`})(c||(t.DocumentDiagnosticReportKind=c={}));var u;(function(t){t.method=`textDocument/diagnostic`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolRequestType(t.method),t.partialResult=new n.ProgressType})(u||(t.DocumentDiagnosticRequest=u={}));var f;(function(t){t.method=`workspace/diagnostic`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolRequestType(t.method),t.partialResult=new n.ProgressType})(f||(t.WorkspaceDiagnosticRequest=f={}));var p;(function(t){t.method=`workspace/diagnostic/refresh`,t.messageDirection=o.MessageDirection.serverToClient,t.type=new o.ProtocolRequestType0(t.method)})(p||(t.DiagnosticRefreshRequest=p={}))})),Ar=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;let n=(vn(),u(qe)),i=ur(),o=Z();var s;(function(t){t.Markup=1,t.Code=2;function is(t){return t===1||t===2}t.is=is})(s||(t.NotebookCellKind=s={}));var c;(function(t){function create(t,n){let i={executionOrder:t};return(n===!0||n===!1)&&(i.success=n),i}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&n.uinteger.is(o.executionOrder)&&(o.success===void 0||i.boolean(o.success))}t.is=is;function equals(t,n){return t===n?!0:t==null||n==null?!1:t.executionOrder===n.executionOrder&&t.success===n.success}t.equals=equals})(c||(t.ExecutionSummary=c={}));var f;(function(t){function create(t,n){return{kind:t,document:n}}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&s.is(o.kind)&&n.DocumentUri.is(o.document)&&(o.metadata===void 0||i.objectLiteral(o.metadata))}t.is=is;function diff(t,n){let i=new Set;return t.document!==n.document&&i.add(`document`),t.kind!==n.kind&&i.add(`kind`),t.executionSummary!==n.executionSummary&&i.add(`executionSummary`),(t.metadata!==void 0||n.metadata!==void 0)&&!equalsMetadata(t.metadata,n.metadata)&&i.add(`metadata`),(t.executionSummary!==void 0||n.executionSummary!==void 0)&&!c.equals(t.executionSummary,n.executionSummary)&&i.add(`executionSummary`),i}t.diff=diff;function equalsMetadata(t,n){if(t===n)return!0;if(t==null||n==null||typeof t!=typeof n||typeof t!=`object`)return!1;let o=Array.isArray(t),s=Array.isArray(n);if(o!==s)return!1;if(o&&s){if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(!equalsMetadata(t[i],n[i]))return!1}if(i.objectLiteral(t)&&i.objectLiteral(n)){let i=Object.keys(t),o=Object.keys(n);if(i.length!==o.length||(i.sort(),o.sort(),!equalsMetadata(i,o)))return!1;for(let o=0;o<i.length;o++){let s=i[o];if(!equalsMetadata(t[s],n[s]))return!1}}return!0}})(f||(t.NotebookCell=f={}));var p;(function(t){function create(t,n,i,o){return{uri:t,notebookType:n,version:i,cells:o}}t.create=create;function is(t){let o=t;return i.objectLiteral(o)&&i.string(o.uri)&&n.integer.is(o.version)&&i.typedArray(o.cells,f.is)}t.is=is})(p||(t.NotebookDocument=p={}));var h;(function(t){t.method=`notebookDocument/sync`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.RegistrationType(t.method)})(h||(t.NotebookDocumentSyncRegistrationType=h={}));var g;(function(t){t.method=`notebookDocument/didOpen`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(g||(t.DidOpenNotebookDocumentNotification=g={}));var _;(function(t){function is(t){let o=t;return i.objectLiteral(o)&&n.uinteger.is(o.start)&&n.uinteger.is(o.deleteCount)&&(o.cells===void 0||i.typedArray(o.cells,f.is))}t.is=is;function create(t,n,i){let o={start:t,deleteCount:n};return i!==void 0&&(o.cells=i),o}t.create=create})(_||(t.NotebookCellArrayChange=_={}));var x;(function(t){t.method=`notebookDocument/didChange`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(x||(t.DidChangeNotebookDocumentNotification=x={}));var S;(function(t){t.method=`notebookDocument/didSave`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(S||(t.DidSaveNotebookDocumentNotification=S={}));var T;(function(t){t.method=`notebookDocument/didClose`,t.messageDirection=o.MessageDirection.clientToServer,t.type=new o.ProtocolNotificationType(t.method),t.registrationMethod=h.method})(T||(t.DidCloseNotebookDocumentNotification=T={}))})),jr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCompletionRequest=void 0;let n=Z();var i;(function(t){t.method=`textDocument/inlineCompletion`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(i||(t.InlineCompletionRequest=i={}))})),Mr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;let n=Z(),i=(vn(),u(qe)),o=ur(),s=dr();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});let c=fr();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});let f=pr();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return f.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return f.DidChangeWorkspaceFoldersNotification}});let p=mr();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return p.ConfigurationRequest}});let h=hr();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return h.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return h.ColorPresentationRequest}});let g=gr();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return g.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return g.FoldingRangeRefreshRequest}});let _=_r();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return _.DeclarationRequest}});let x=vr();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});let S=yr();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return S.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return S.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return S.WorkDoneProgressCancelNotification}});let T=br();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return T.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return T.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return T.CallHierarchyPrepareRequest}});let E=xr();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});let D=Sr();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return D.ShowDocumentRequest}});let ee=Cr();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return ee.LinkedEditingRangeRequest}});let O=wr();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return O.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return O.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return O.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return O.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return O.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return O.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return O.WillDeleteFilesRequest}});let k=Tr();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return k.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return k.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return k.MonikerRequest}});let A=Er();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return A.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return A.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return A.TypeHierarchySupertypesRequest}});let j=Dr();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return j.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return j.InlineValueRefreshRequest}});let M=Or();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return M.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return M.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return M.InlayHintRefreshRequest}});let N=kr();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return N.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return N.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return N.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return N.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return N.DiagnosticRefreshRequest}});let P=Ar();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return P.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return P.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return P.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return P.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return P.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return P.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidCloseNotebookDocumentNotification}});let te=jr();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return te.InlineCompletionRequest}});var F;(function(t){function is(t){let n=t;return o.string(n)||o.string(n.language)||o.string(n.scheme)||o.string(n.pattern)}t.is=is})(F||(t.TextDocumentFilter=F={}));var ne;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(o.string(n.notebookType)||o.string(n.scheme)||o.string(n.pattern))}t.is=is})(ne||(t.NotebookDocumentFilter=ne={}));var re;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(o.string(n.notebook)||ne.is(n.notebook))&&(n.language===void 0||o.string(n.language))}t.is=is})(re||(t.NotebookCellTextDocumentFilter=re={}));var ie;(function(t){function is(t){if(!Array.isArray(t))return!1;for(let n of t)if(!o.string(n)&&!F.is(n)&&!re.is(n))return!1;return!0}t.is=is})(ie||(t.DocumentSelector=ie={}));var ae;(function(t){t.method=`client/registerCapability`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(ae||(t.RegistrationRequest=ae={}));var oe;(function(t){t.method=`client/unregisterCapability`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(oe||(t.UnregistrationRequest=oe={}));var se;(function(t){t.Create=`create`,t.Rename=`rename`,t.Delete=`delete`})(se||(t.ResourceOperationKind=se={}));var ce;(function(t){t.Abort=`abort`,t.Transactional=`transactional`,t.TextOnlyTransactional=`textOnlyTransactional`,t.Undo=`undo`})(ce||(t.FailureHandlingKind=ce={}));var le;(function(t){t.UTF8=`utf-8`,t.UTF16=`utf-16`,t.UTF32=`utf-32`})(le||(t.PositionEncodingKind=le={}));var I;(function(t){function hasId(t){let n=t;return n&&o.string(n.id)&&n.id.length>0}t.hasId=hasId})(I||(t.StaticRegistrationOptions=I={}));var ue;(function(t){function is(t){let n=t;return n&&(n.documentSelector===null||ie.is(n.documentSelector))}t.is=is})(ue||(t.TextDocumentRegistrationOptions=ue={}));var de;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(n.workDoneProgress===void 0||o.boolean(n.workDoneProgress))}t.is=is;function hasWorkDoneProgress(t){let n=t;return n&&o.boolean(n.workDoneProgress)}t.hasWorkDoneProgress=hasWorkDoneProgress})(de||(t.WorkDoneProgressOptions=de={}));var L;(function(t){t.method=`initialize`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(L||(t.InitializeRequest=L={}));var R;(function(t){t.unknownProtocolVersion=1})(R||(t.InitializeErrorCodes=R={}));var fe;(function(t){t.method=`initialized`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(fe||(t.InitializedNotification=fe={}));var z;(function(t){t.method=`shutdown`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType0(t.method)})(z||(t.ShutdownRequest=z={}));var B;(function(t){t.method=`exit`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType0(t.method)})(B||(t.ExitNotification=B={}));var pe;(function(t){t.method=`workspace/didChangeConfiguration`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(pe||(t.DidChangeConfigurationNotification=pe={}));var me;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(me||(t.MessageType=me={}));var he;(function(t){t.method=`window/showMessage`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(he||(t.ShowMessageNotification=he={}));var ge;(function(t){t.method=`window/showMessageRequest`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)})(ge||(t.ShowMessageRequest=ge={}));var _e;(function(t){t.method=`window/logMessage`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(_e||(t.LogMessageNotification=_e={}));var V;(function(t){t.method=`telemetry/event`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(V||(t.TelemetryEventNotification=V={}));var ve;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ve||(t.TextDocumentSyncKind=ve={}));var ye;(function(t){t.method=`textDocument/didOpen`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(ye||(t.DidOpenTextDocumentNotification=ye={}));var be;(function(t){function isIncremental(t){let n=t;return n!=null&&typeof n.text==`string`&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength==`number`)}t.isIncremental=isIncremental;function isFull(t){let n=t;return n!=null&&typeof n.text==`string`&&n.range===void 0&&n.rangeLength===void 0}t.isFull=isFull})(be||(t.TextDocumentContentChangeEvent=be={}));var xe;(function(t){t.method=`textDocument/didChange`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(xe||(t.DidChangeTextDocumentNotification=xe={}));var Se;(function(t){t.method=`textDocument/didClose`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Se||(t.DidCloseTextDocumentNotification=Se={}));var Ce;(function(t){t.method=`textDocument/didSave`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Ce||(t.DidSaveTextDocumentNotification=Ce={}));var we;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(we||(t.TextDocumentSaveReason=we={}));var Te;(function(t){t.method=`textDocument/willSave`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(Te||(t.WillSaveTextDocumentNotification=Te={}));var Ee;(function(t){t.method=`textDocument/willSaveWaitUntil`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ee||(t.WillSaveTextDocumentWaitUntilRequest=Ee={}));var De;(function(t){t.method=`workspace/didChangeWatchedFiles`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolNotificationType(t.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Oe;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Oe||(t.FileChangeType=Oe={}));var ke;(function(t){function is(t){let n=t;return o.objectLiteral(n)&&(i.URI.is(n.baseUri)||i.WorkspaceFolder.is(n.baseUri))&&o.string(n.pattern)}t.is=is})(ke||(t.RelativePattern=ke={}));var Ae;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Ae||(t.WatchKind=Ae={}));var je;(function(t){t.method=`textDocument/publishDiagnostics`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolNotificationType(t.method)})(je||(t.PublishDiagnosticsNotification=je={}));var Me;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Me||(t.CompletionTriggerKind=Me={}));var Ne;(function(t){t.method=`textDocument/completion`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ne||(t.CompletionRequest=Ne={}));var Pe;(function(t){t.method=`completionItem/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Pe||(t.CompletionResolveRequest=Pe={}));var Fe;(function(t){t.method=`textDocument/hover`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Fe||(t.HoverRequest=Fe={}));var Ie;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Ie||(t.SignatureHelpTriggerKind=Ie={}));var Le;(function(t){t.method=`textDocument/signatureHelp`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Le||(t.SignatureHelpRequest=Le={}));var Re;(function(t){t.method=`textDocument/definition`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Re||(t.DefinitionRequest=Re={}));var ze;(function(t){t.method=`textDocument/references`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(ze||(t.ReferencesRequest=ze={}));var H;(function(t){t.method=`textDocument/documentHighlight`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(H||(t.DocumentHighlightRequest=H={}));var Be;(function(t){t.method=`textDocument/documentSymbol`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Be||(t.DocumentSymbolRequest=Be={}));var Ve;(function(t){t.method=`textDocument/codeAction`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ve||(t.CodeActionRequest=Ve={}));var He;(function(t){t.method=`codeAction/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(He||(t.CodeActionResolveRequest=He={}));var Ue;(function(t){t.method=`workspace/symbol`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var We;(function(t){t.method=`workspaceSymbol/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(We||(t.WorkspaceSymbolResolveRequest=We={}));var Ge;(function(t){t.method=`textDocument/codeLens`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ge||(t.CodeLensRequest=Ge={}));var Ke;(function(t){t.method=`codeLens/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ke||(t.CodeLensResolveRequest=Ke={}));var Je;(function(t){t.method=`workspace/codeLens/refresh`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType0(t.method)})(Je||(t.CodeLensRefreshRequest=Je={}));var Ye;(function(t){t.method=`textDocument/documentLink`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ye||(t.DocumentLinkRequest=Ye={}));var Xe;(function(t){t.method=`documentLink/resolve`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Xe||(t.DocumentLinkResolveRequest=Xe={}));var Ze;(function(t){t.method=`textDocument/formatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Ze||(t.DocumentFormattingRequest=Ze={}));var U;(function(t){t.method=`textDocument/rangeFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(U||(t.DocumentRangeFormattingRequest=U={}));var W;(function(t){t.method=`textDocument/rangesFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(W||(t.DocumentRangesFormattingRequest=W={}));var Qe;(function(t){t.method=`textDocument/onTypeFormatting`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(Qe||(t.DocumentOnTypeFormattingRequest=Qe={}));var $e;(function(t){t.Identifier=1})($e||(t.PrepareSupportDefaultBehavior=$e={}));var et;(function(t){t.method=`textDocument/rename`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(et||(t.RenameRequest=et={}));var tt;(function(t){t.method=`textDocument/prepareRename`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(tt||(t.PrepareRenameRequest=tt={}));var nt;(function(t){t.method=`workspace/executeCommand`,t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)})(nt||(t.ExecuteCommandRequest=nt={}));var rt;(function(t){t.method=`workspace/applyEdit`,t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(`workspace/applyEdit`)})(rt||(t.ApplyWorkspaceEditRequest=rt={}))})),Nr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;let n=cr();function createProtocolConnection(t,i,o,s){return n.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,n.createMessageConnection)(t,i,o,s)}t.createProtocolConnection=createProtocolConnection})),Pr=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,i(cr(),t),i((vn(),u(qe)),t),i(Z(),t),i(Mr(),t);var o=Nr();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(s||(t.LSPErrorCodes=s={}))})),Q=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;let o=lr();i(lr(),t),i(Pr(),t);function createProtocolConnection(t,n,i,s){return(0,o.createMessageConnection)(t,n,i,s)}t.createProtocolConnection=createProtocolConnection})),Fr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generateUuid=t.parse=t.isUUID=t.v4=t.empty=void 0;var ValueUUID=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},n=class V4UUID extends ValueUUID{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return V4UUID._oneOf(V4UUID._chars)}constructor(){super([V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,`4`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._oneOf(V4UUID._timeHighBits),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),`-`,V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex(),V4UUID._randomHex()].join(``))}};n._chars=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`],n._timeHighBits=[`8`,`9`,`a`,`b`],t.empty=new ValueUUID(`00000000-0000-0000-0000-000000000000`);function v4(){return new n}t.v4=v4;let i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isUUID(t){return i.test(t)}t.isUUID=isUUID;function parse(t){if(!isUUID(t))throw Error(`invalid uuid`);return new ValueUUID(t)}t.parse=parse;function generateUuid(){return v4().asHex()}t.generateUuid=generateUuid})),Ir=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.attachPartialResult=t.ProgressFeature=t.attachWorkDone=void 0;let n=Q(),i=Fr();var o=class WorkDoneProgressReporterImpl{constructor(t,n){this._connection=t,this._token=n,WorkDoneProgressReporterImpl.Instances.set(this._token,this)}begin(t,i,o,s){let c={kind:`begin`,title:t,percentage:i,message:o,cancellable:s};this._connection.sendProgress(n.WorkDoneProgress.type,this._token,c)}report(t,i){let o={kind:`report`};typeof t==`number`?(o.percentage=t,i!==void 0&&(o.message=i)):o.message=t,this._connection.sendProgress(n.WorkDoneProgress.type,this._token,o)}done(){WorkDoneProgressReporterImpl.Instances.delete(this._token),this._connection.sendProgress(n.WorkDoneProgress.type,this._token,{kind:`end`})}};o.Instances=new Map;var WorkDoneProgressServerReporterImpl=class extends o{constructor(t,i){super(t,i),this._source=new n.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},NullProgressReporter=class{constructor(){}begin(){}report(){}done(){}},NullProgressServerReporter=class extends NullProgressReporter{constructor(){super(),this._source=new n.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function attachWorkDone(t,n){if(n===void 0||n.workDoneToken===void 0)return new NullProgressReporter;let i=n.workDoneToken;return delete n.workDoneToken,new o(t,i)}t.attachWorkDone=attachWorkDone;let ProgressFeature=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(n.WorkDoneProgressCancelNotification.type,t=>{let n=o.Instances.get(t.token);(n instanceof WorkDoneProgressServerReporterImpl||n instanceof NullProgressServerReporter)&&n.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new NullProgressReporter:new o(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,i.generateUuid)();return this.connection.sendRequest(n.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new WorkDoneProgressServerReporterImpl(this.connection,t))}else return Promise.resolve(new NullProgressServerReporter)}};t.ProgressFeature=ProgressFeature;var s;(function(t){t.type=new n.ProgressType})(s||={});var ResultProgressReporterImpl=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(s.type,this._token,t)}};function attachPartialResult(t,n){if(n===void 0||n.partialResultToken===void 0)return;let i=n.partialResultToken;return delete n.partialResultToken,new ResultProgressReporterImpl(t,i)}t.attachPartialResult=attachPartialResult})),Lr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationFeature=void 0;let n=Q(),i=Xn(),ConfigurationFeature=t=>class extends t{getConfiguration(t){return t?i.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let i={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(n.ConfigurationRequest.type,i).then(n=>Array.isArray(n)?Array.isArray(t)?n:n[0]:Array.isArray(t)?[]:null)}};t.ConfigurationFeature=ConfigurationFeature})),Rr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFoldersFeature=void 0;let n=Q(),WorkspaceFoldersFeature=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let i=t.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new n.Emitter,this.connection.onNotification(n.DidChangeWorkspaceFoldersNotification.type,t=>{this._onDidChangeWorkspaceFolders.fire(t.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n==`string`}getWorkspaceFolders(){return this.connection.sendRequest(n.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw Error(`Client doesn't support sending workspace folder change events.`);return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(n.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};t.WorkspaceFoldersFeature=WorkspaceFoldersFeature})),zr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyFeature=void 0;let n=Q(),CallHierarchyFeature=t=>class extends t{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(n.CallHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let i=n.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onOutgoingCalls:t=>{let i=n.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.CallHierarchyFeature=CallHierarchyFeature})),Br=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensDiff=t.SemanticTokensFeature=void 0;let n=Q(),SemanticTokensFeature=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(n.SemanticTokensRefreshRequest.type),on:t=>{let i=n.SemanticTokensRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onDelta:t=>{let i=n.SemanticTokensDeltaRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onRange:t=>{let i=n.SemanticTokensRangeRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.SemanticTokensFeature=SemanticTokensFeature;var SemanticTokensDiff=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,i=0;for(;i<n&&i<t&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<n&&i<t){let o=t-1,s=n-1;for(;o>=i&&s>=i&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o<i||s<i)&&(o++,s++);let c=o-i+1,u=this.modifiedSequence.slice(i,s+1);return u.length===1&&u[0]===this.originalSequence[o]?[{start:i,deleteCount:c-1}]:[{start:i,deleteCount:c,data:u}]}else if(i<n)return[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}];else if(i<t)return[{start:i,deleteCount:t-i}];else return[]}};t.SemanticTokensDiff=SemanticTokensDiff;var SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(t,n,i,o,s){let c=t,u=n;this._dataLen>0&&(c-=this._prevLine,c===0&&(u-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData===void 0?this.build():{resultId:this.id,edits:new SemanticTokensDiff(this._prevData,this._data).computeDiff()}}};t.SemanticTokensBuilder=SemanticTokensBuilder})),Vr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentFeature=void 0;let n=Q(),ShowDocumentFeature=t=>class extends t{showDocument(t){return this.connection.sendRequest(n.ShowDocumentRequest.type,t)}};t.ShowDocumentFeature=ShowDocumentFeature})),Hr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileOperationsFeature=void 0;let n=Q(),FileOperationsFeature=t=>class extends t{onDidCreateFiles(t){return this.connection.onNotification(n.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(n.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(n.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(n.WillCreateFilesRequest.type,(n,i)=>t(n,i))}onWillRenameFiles(t){return this.connection.onRequest(n.WillRenameFilesRequest.type,(n,i)=>t(n,i))}onWillDeleteFiles(t){return this.connection.onRequest(n.WillDeleteFilesRequest.type,(n,i)=>t(n,i))}};t.FileOperationsFeature=FileOperationsFeature})),Ur=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeFeature=void 0;let n=Q(),LinkedEditingRangeFeature=t=>class extends t{onLinkedEditingRange(t){return this.connection.onRequest(n.LinkedEditingRangeRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0))}};t.LinkedEditingRangeFeature=LinkedEditingRangeFeature})),Wr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyFeature=void 0;let n=Q(),TypeHierarchyFeature=t=>class extends t{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(n.TypeHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let i=n.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))},onSubtypes:t=>{let i=n.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.TypeHierarchyFeature=TypeHierarchyFeature})),Gr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueFeature=void 0;let n=Q(),InlineValueFeature=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(n.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(n.InlineValueRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};t.InlineValueFeature=InlineValueFeature})),Kr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeFeature=void 0;let n=Q(),FoldingRangeFeature=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(n.FoldingRangeRefreshRequest.type),on:t=>{let i=n.FoldingRangeRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.FoldingRangeFeature=FoldingRangeFeature})),qr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintFeature=void 0;let n=Q(),InlayHintFeature=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(n.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(n.InlayHintRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest(n.InlayHintResolveRequest.type,(n,i)=>t(n,i))}}};t.InlayHintFeature=InlayHintFeature})),Jr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFeature=void 0;let n=Q(),DiagnosticFeature=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(n.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(n.DocumentDiagnosticRequest.type,(i,o)=>t(i,o,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:t=>this.connection.onRequest(n.WorkspaceDiagnosticRequest.type,(i,o)=>t(i,o,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n.WorkspaceDiagnosticRequest.partialResult,i)))}}};t.DiagnosticFeature=DiagnosticFeature})),Yr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocuments=void 0;let n=Q();var TextDocuments=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new n.Emitter,this._onDidOpen=new n.Emitter,this._onDidClose=new n.Emitter,this._onDidSave=new n.Emitter,this._onWillSave=new n.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=n.TextDocumentSyncKind.Incremental;let i=[];return i.push(t.onDidOpenTextDocument(t=>{let n=t.textDocument,i=this._configuration.create(n.uri,n.languageId,n.version,n.text);this._syncedDocuments.set(n.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),i.push(t.onDidChangeTextDocument(t=>{let n=t.textDocument,i=t.contentChanges;if(i.length===0)return;let{version:o}=n;if(o==null)throw Error(`Received document change event for ${n.uri} without valid version identifier`);let s=this._syncedDocuments.get(n.uri);s!==void 0&&(s=this._configuration.update(s,i,o),this._syncedDocuments.set(n.uri,s),this._onDidChangeContent.fire(Object.freeze({document:s})))})),i.push(t.onDidCloseTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&(this._syncedDocuments.delete(t.textDocument.uri),this._onDidClose.fire(Object.freeze({document:n})))})),i.push(t.onWillSaveTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&this._onWillSave.fire(Object.freeze({document:n,reason:t.reason}))})),i.push(t.onWillSaveTextDocumentWaitUntil((t,n)=>{let i=this._syncedDocuments.get(t.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:t.reason}),n):[]})),i.push(t.onDidSaveTextDocument(t=>{let n=this._syncedDocuments.get(t.textDocument.uri);n!==void 0&&this._onDidSave.fire(Object.freeze({document:n}))})),n.Disposable.create(()=>{i.forEach(t=>t.dispose())})}};t.TextDocuments=TextDocuments})),Xr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookDocuments=t.NotebookSyncFeature=void 0;let n=Q(),i=Yr(),NotebookSyncFeature=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(n.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(n.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(n.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(n.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};t.NotebookSyncFeature=NotebookSyncFeature;var o=class CellTextDocumentConnection{onDidOpenTextDocument(t){return this.openHandler=t,n.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,n.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,n.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return CellTextDocumentConnection.NULL_DISPOSE}onDidSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}};o.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var NotebookDocuments=class{constructor(t){t instanceof i.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new i.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new n.Emitter,this._onDidChange=new n.Emitter,this._onDidSave=new n.Emitter,this._onDidClose=new n.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t==`string`?t:t.document,i=this.notebookCellMap.get(n);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let i=new o,s=[];return s.push(this.cellTextDocuments.listen(i)),s.push(t.notebooks.synchronization.onDidOpenNotebookDocument(t=>{this.notebookDocuments.set(t.notebookDocument.uri,t.notebookDocument);for(let n of t.cellTextDocuments)i.openTextDocument({textDocument:n});this.updateCellMap(t.notebookDocument),this._onDidOpen.fire(t.notebookDocument)})),s.push(t.notebooks.synchronization.onDidChangeNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);if(n===void 0)return;n.version=t.notebookDocument.version;let o=n.metadata,s=!1,c=t.change;c.metadata!==void 0&&(s=!0,n.metadata=c.metadata);let u=[],f=[],p=[],h=[];if(c.cells!==void 0){let t=c.cells;if(t.structure!==void 0){let o=t.structure.array;if(n.cells.splice(o.start,o.deleteCount,...o.cells===void 0?[]:o.cells),t.structure.didOpen!==void 0)for(let n of t.structure.didOpen)i.openTextDocument({textDocument:n}),u.push(n.uri);if(t.structure.didClose)for(let n of t.structure.didClose)i.closeTextDocument({textDocument:n}),f.push(n.uri)}if(t.data!==void 0){let i=new Map(t.data.map(t=>[t.document,t]));for(let t=0;t<=n.cells.length;t++){let o=i.get(n.cells[t].document);if(o!==void 0){let s=n.cells.splice(t,1,o);if(p.push({old:s[0],new:o}),i.delete(o.document),i.size===0)break}}}if(t.textContent!==void 0)for(let n of t.textContent)i.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),h.push(n.document.uri)}this.updateCellMap(n);let g={notebookDocument:n};s&&(g.metadata={old:o,new:n.metadata});let _=[];for(let t of u)_.push(this.getNotebookCell(t));let x=[];for(let t of f)x.push(this.getNotebookCell(t));let S=[];for(let t of h)S.push(this.getNotebookCell(t));(_.length>0||x.length>0||p.length>0||S.length>0)&&(g.cells={added:_,removed:x,changed:{data:p,textContent:S}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),s.push(t.notebooks.synchronization.onDidSaveNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);n!==void 0&&this._onDidSave.fire(n)})),s.push(t.notebooks.synchronization.onDidCloseNotebookDocument(t=>{let n=this.notebookDocuments.get(t.notebookDocument.uri);if(n!==void 0){this._onDidClose.fire(n);for(let n of t.cellTextDocuments)i.closeTextDocument({textDocument:n});this.notebookDocuments.delete(t.notebookDocument.uri);for(let t of n.cells)this.notebookCellMap.delete(t.document)}})),n.Disposable.create(()=>{s.forEach(t=>t.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};t.NotebookDocuments=NotebookDocuments})),Zr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerFeature=void 0;let n=Q(),MonikerFeature=t=>class extends t{get moniker(){return{on:t=>{let i=n.MonikerRequest.type;return this.connection.onRequest(i,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(i,n)))}}}};t.MonikerFeature=MonikerFeature})),Qr=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineNotebooksFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._NotebooksImpl=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=void 0;let n=Q(),i=Xn(),o=Fr(),s=Ir(),c=Lr(),u=Rr(),f=zr(),p=Br(),h=Vr(),g=Hr(),_=Ur(),x=Wr(),S=Gr(),T=Kr(),E=qr(),D=Jr(),ee=Xr(),O=Zr();function null2Undefined(t){if(t!==null)return t}var ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||=0,n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};t.ErrorMessageTracker=ErrorMessageTracker;var RemoteConsoleImpl=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(n.MessageType.Error,t)}warn(t){this.send(n.MessageType.Warning,t)}info(t){this.send(n.MessageType.Info,t)}log(t){this.send(n.MessageType.Log,t)}debug(t){this.send(n.MessageType.Debug,t)}send(t,i){this._rawConnection&&this._rawConnection.sendNotification(n.LogMessageNotification.type,{type:t,message:i}).catch(()=>{(0,n.RAL)().console.error(`Sending log message failed`)})}},_RemoteWindowImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...i){let o={type:n.MessageType.Error,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}showWarningMessage(t,...i){let o={type:n.MessageType.Warning,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}showInformationMessage(t,...i){let o={type:n.MessageType.Info,message:t,actions:i};return this.connection.sendRequest(n.ShowMessageRequest.type,o).then(null2Undefined)}};let k=(0,h.ShowDocumentFeature)((0,s.ProgressFeature)(_RemoteWindowImpl));var A;(function(t){function create(){return new BulkRegistrationImpl}t.create=create})(A||(t.BulkRegistration=A={}));var BulkRegistrationImpl=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let s=i.string(t)?t:t.method;if(this._registered.has(s))throw Error(`${s} is already added to this registration`);let c=o.generateUuid();this._registrations.push({id:c,method:s,registerOptions:n||{}}),this._registered.add(s)}asRegistrationParams(){return{registrations:this._registrations}}},j;(function(t){function create(){return new BulkUnregistrationImpl(void 0,[])}t.create=create})(j||(t.BulkUnregistration=j={}));var BulkUnregistrationImpl=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(t=>{this._unregistrations.set(t.method,t)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let n of this._unregistrations.values())t.push(n);let i={unregisterations:t};this._connection.sendRequest(n.UnregistrationRequest.type,i).catch(()=>{this._connection.console.info(`Bulk unregistration failed.`)})}disposeSingle(t){let o=i.string(t)?t:t.method,s=this._unregistrations.get(o);if(!s)return!1;let c={unregisterations:[s]};return this._connection.sendRequest(n.UnregistrationRequest.type,c).then(()=>{this._unregistrations.delete(o)},t=>{this._connection.console.info(`Un-registering request handler for ${s.id} failed.`)}),!0}},RemoteClientImpl=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,i){return t instanceof BulkRegistrationImpl?this.registerMany(t):t instanceof BulkUnregistrationImpl?this.registerSingle1(t,n,i):this.registerSingle2(t,n)}registerSingle1(t,s,c){let u=i.string(s)?s:s.method,f=o.generateUuid(),p={registrations:[{id:f,method:u,registerOptions:c||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(n.RegistrationRequest.type,p).then(n=>(t.add({id:f,method:u}),t),t=>(this.connection.console.info(`Registering request handler for ${u} failed.`),Promise.reject(t)))}registerSingle2(t,s){let c=i.string(t)?t:t.method,u=o.generateUuid(),f={registrations:[{id:u,method:c,registerOptions:s||{}}]};return this.connection.sendRequest(n.RegistrationRequest.type,f).then(t=>n.Disposable.create(()=>{this.unregisterSingle(u,c).catch(()=>{this.connection.console.info(`Un-registering capability with id ${u} failed.`)})}),t=>(this.connection.console.info(`Registering request handler for ${c} failed.`),Promise.reject(t)))}unregisterSingle(t,i){let o={unregisterations:[{id:t,method:i}]};return this.connection.sendRequest(n.UnregistrationRequest.type,o).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let i=t.asRegistrationParams();return this.connection.sendRequest(n.RegistrationRequest.type,i).then(()=>new BulkUnregistrationImpl(this._connection,i.registrations.map(t=>({id:t.id,method:t.method}))),t=>(this.connection.console.info(`Bulk registration failed.`),Promise.reject(t)))}},_RemoteWorkspaceImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function isApplyWorkspaceEditParams(t){return t&&!!t.edit}let i=isApplyWorkspaceEditParams(t)?t:{edit:t};return this.connection.sendRequest(n.ApplyWorkspaceEditRequest.type,i)}};let M=(0,g.FileOperationsFeature)((0,u.WorkspaceFoldersFeature)((0,c.ConfigurationFeature)(_RemoteWorkspaceImpl)));var TracerImpl=class{constructor(){this._trace=n.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,i){this._trace!==n.Trace.Off&&this.connection.sendNotification(n.LogTraceNotification.type,{message:t,verbose:this._trace===n.Trace.Verbose?i:void 0}).catch(()=>{})}},TelemetryImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(n.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log(`Sending TelemetryEventNotification failed`)})}},_LanguagesImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,s.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,s.attachPartialResult)(this.connection,n)}};t._LanguagesImpl=_LanguagesImpl;let N=(0,T.FoldingRangeFeature)((0,O.MonikerFeature)((0,D.DiagnosticFeature)((0,E.InlayHintFeature)((0,S.InlineValueFeature)((0,x.TypeHierarchyFeature)((0,_.LinkedEditingRangeFeature)((0,p.SemanticTokensFeature)((0,f.CallHierarchyFeature)(_LanguagesImpl)))))))));var _NotebooksImpl=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,s.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,s.attachPartialResult)(this.connection,n)}};t._NotebooksImpl=_NotebooksImpl;let P=(0,ee.NotebookSyncFeature)(_NotebooksImpl);function combineConsoleFeatures(t,n){return function(i){return n(t(i))}}t.combineConsoleFeatures=combineConsoleFeatures;function combineTelemetryFeatures(t,n){return function(i){return n(t(i))}}t.combineTelemetryFeatures=combineTelemetryFeatures;function combineTracerFeatures(t,n){return function(i){return n(t(i))}}t.combineTracerFeatures=combineTracerFeatures;function combineClientFeatures(t,n){return function(i){return n(t(i))}}t.combineClientFeatures=combineClientFeatures;function combineWindowFeatures(t,n){return function(i){return n(t(i))}}t.combineWindowFeatures=combineWindowFeatures;function combineWorkspaceFeatures(t,n){return function(i){return n(t(i))}}t.combineWorkspaceFeatures=combineWorkspaceFeatures;function combineLanguagesFeatures(t,n){return function(i){return n(t(i))}}t.combineLanguagesFeatures=combineLanguagesFeatures;function combineNotebooksFeatures(t,n){return function(i){return n(t(i))}}t.combineNotebooksFeatures=combineNotebooksFeatures;function combineFeatures(t,n){function combine(t,n,i){return t&&n?i(t,n):t||n}return{__brand:`features`,console:combine(t.console,n.console,combineConsoleFeatures),tracer:combine(t.tracer,n.tracer,combineTracerFeatures),telemetry:combine(t.telemetry,n.telemetry,combineTelemetryFeatures),client:combine(t.client,n.client,combineClientFeatures),window:combine(t.window,n.window,combineWindowFeatures),workspace:combine(t.workspace,n.workspace,combineWorkspaceFeatures),languages:combine(t.languages,n.languages,combineLanguagesFeatures),notebooks:combine(t.notebooks,n.notebooks,combineNotebooksFeatures)}}t.combineFeatures=combineFeatures;function createConnection(t,o,c){let u=c&&c.console?new(c.console(RemoteConsoleImpl)):new RemoteConsoleImpl,f=t(u);u.rawAttach(f);let p=c&&c.tracer?new(c.tracer(TracerImpl)):new TracerImpl,h=c&&c.telemetry?new(c.telemetry(TelemetryImpl)):new TelemetryImpl,g=c&&c.client?new(c.client(RemoteClientImpl)):new RemoteClientImpl,_=c&&c.window?new(c.window(k)):new k,x=c&&c.workspace?new(c.workspace(M)):new M,S=c&&c.languages?new(c.languages(N)):new N,T=c&&c.notebooks?new(c.notebooks(P)):new P,E=[u,p,h,g,_,x,S,T];function asPromise(t){return t instanceof Promise?t:i.thenable(t)?new Promise((n,i)=>{t.then(t=>n(t),t=>i(t))}):Promise.resolve(t)}let D,ee,O,A={listen:()=>f.listen(),sendRequest:(t,...n)=>f.sendRequest(i.string(t)?t:t.method,...n),onRequest:(t,n)=>f.onRequest(t,n),sendNotification:(t,n)=>{let o=i.string(t)?t:t.method;return f.sendNotification(o,n)},onNotification:(t,n)=>f.onNotification(t,n),onProgress:f.onProgress,sendProgress:f.sendProgress,onInitialize:t=>(ee=t,{dispose:()=>{ee=void 0}}),onInitialized:t=>f.onNotification(n.InitializedNotification.type,t),onShutdown:t=>(D=t,{dispose:()=>{D=void 0}}),onExit:t=>(O=t,{dispose:()=>{O=void 0}}),get console(){return u},get telemetry(){return h},get tracer(){return p},get client(){return g},get window(){return _},get workspace(){return x},get languages(){return S},get notebooks(){return T},onDidChangeConfiguration:t=>f.onNotification(n.DidChangeConfigurationNotification.type,t),onDidChangeWatchedFiles:t=>f.onNotification(n.DidChangeWatchedFilesNotification.type,t),__textDocumentSync:void 0,onDidOpenTextDocument:t=>f.onNotification(n.DidOpenTextDocumentNotification.type,t),onDidChangeTextDocument:t=>f.onNotification(n.DidChangeTextDocumentNotification.type,t),onDidCloseTextDocument:t=>f.onNotification(n.DidCloseTextDocumentNotification.type,t),onWillSaveTextDocument:t=>f.onNotification(n.WillSaveTextDocumentNotification.type,t),onWillSaveTextDocumentWaitUntil:t=>f.onRequest(n.WillSaveTextDocumentWaitUntilRequest.type,t),onDidSaveTextDocument:t=>f.onNotification(n.DidSaveTextDocumentNotification.type,t),sendDiagnostics:t=>f.sendNotification(n.PublishDiagnosticsNotification.type,t),onHover:t=>f.onRequest(n.HoverRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onCompletion:t=>f.onRequest(n.CompletionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCompletionResolve:t=>f.onRequest(n.CompletionResolveRequest.type,t),onSignatureHelp:t=>f.onRequest(n.SignatureHelpRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDeclaration:t=>f.onRequest(n.DeclarationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDefinition:t=>f.onRequest(n.DefinitionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onTypeDefinition:t=>f.onRequest(n.TypeDefinitionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onImplementation:t=>f.onRequest(n.ImplementationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onReferences:t=>f.onRequest(n.ReferencesRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentHighlight:t=>f.onRequest(n.DocumentHighlightRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentSymbol:t=>f.onRequest(n.DocumentSymbolRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onWorkspaceSymbol:t=>f.onRequest(n.WorkspaceSymbolRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onWorkspaceSymbolResolve:t=>f.onRequest(n.WorkspaceSymbolResolveRequest.type,t),onCodeAction:t=>f.onRequest(n.CodeActionRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCodeActionResolve:t=>f.onRequest(n.CodeActionResolveRequest.type,(n,i)=>t(n,i)),onCodeLens:t=>f.onRequest(n.CodeLensRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onCodeLensResolve:t=>f.onRequest(n.CodeLensResolveRequest.type,(n,i)=>t(n,i)),onDocumentFormatting:t=>f.onRequest(n.DocumentFormattingRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDocumentRangeFormatting:t=>f.onRequest(n.DocumentRangeFormattingRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onDocumentOnTypeFormatting:t=>f.onRequest(n.DocumentOnTypeFormattingRequest.type,(n,i)=>t(n,i)),onRenameRequest:t=>f.onRequest(n.RenameRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),onPrepareRename:t=>f.onRequest(n.PrepareRenameRequest.type,(n,i)=>t(n,i)),onDocumentLinks:t=>f.onRequest(n.DocumentLinkRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onDocumentLinkResolve:t=>f.onRequest(n.DocumentLinkResolveRequest.type,(n,i)=>t(n,i)),onDocumentColor:t=>f.onRequest(n.DocumentColorRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onColorPresentation:t=>f.onRequest(n.ColorPresentationRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onFoldingRanges:t=>f.onRequest(n.FoldingRangeRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onSelectionRanges:t=>f.onRequest(n.SelectionRangeRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),(0,s.attachPartialResult)(f,n))),onExecuteCommand:t=>f.onRequest(n.ExecuteCommandRequest.type,(n,i)=>t(n,i,(0,s.attachWorkDone)(f,n),void 0)),dispose:()=>f.dispose()};for(let t of E)t.attach(A);return f.onRequest(n.InitializeRequest.type,t=>{o.initialize(t),i.string(t.trace)&&(p.trace=n.Trace.fromString(t.trace));for(let n of E)n.initialize(t.capabilities);if(ee)return asPromise(ee(t,new n.CancellationTokenSource().token,(0,s.attachWorkDone)(f,t),void 0)).then(t=>{if(t instanceof n.ResponseError)return t;let o=t;o||={capabilities:{}};let s=o.capabilities;s||(s={},o.capabilities=s),s.textDocumentSync===void 0||s.textDocumentSync===null?s.textDocumentSync=i.number(A.__textDocumentSync)?A.__textDocumentSync:n.TextDocumentSyncKind.None:!i.number(s.textDocumentSync)&&!i.number(s.textDocumentSync.change)&&(s.textDocumentSync.change=i.number(A.__textDocumentSync)?A.__textDocumentSync:n.TextDocumentSyncKind.None);for(let t of E)t.fillServerCapabilities(s);return o});{let t={capabilities:{textDocumentSync:n.TextDocumentSyncKind.None}};for(let n of E)n.fillServerCapabilities(t.capabilities);return t}}),f.onRequest(n.ShutdownRequest.type,()=>{if(o.shutdownReceived=!0,D)return D(new n.CancellationTokenSource().token)}),f.onNotification(n.ExitNotification.type,()=>{try{O&&O()}finally{o.shutdownReceived?o.exit(0):o.exit(1)}}),f.onNotification(n.SetTraceNotification.type,t=>{p.trace=n.Trace.fromString(t.value)}),A}t.createConnection=createConnection})),$r=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveModulePath=t.FileSystem=t.resolveGlobalYarnPath=t.resolveGlobalNodePath=t.resolve=t.uriToFilePath=void 0;let n=s(`node:url`),i=s(`node:path`),o=s(`node:fs`),c=s(`node:child_process`);function uriToFilePath(t){let o=n.parse(t);if(o.protocol!==`file:`||!o.path)return;let s=o.path.split(`/`);for(var c=0,u=s.length;c<u;c++)s[c]=decodeURIComponent(s[c]);if(process.platform===`win32`&&s.length>1){let t=s[0],n=s[1];t.length===0&&n.length>1&&n[1]===`:`&&s.shift()}return i.normalize(s.join(`/`))}t.uriToFilePath=uriToFilePath;function isWindows(){return process.platform===`win32`}function resolve(t,n,s,u){let f=`NODE_PATH`,p=[`var p = process;`,`p.on('message',function(m){`,`if(m.c==='e'){`,`p.exit(0);`,`}`,`else if(m.c==='rs'){`,`try{`,`var r=require.resolve(m.a);`,`p.send({c:'r',s:true,r:r});`,`}`,`catch(err){`,`p.send({c:'r',s:false});`,`}`,`}`,`});`].join(``);return new Promise((h,g)=>{let _=process.env,x=Object.create(null);Object.keys(_).forEach(t=>x[t]=_[t]),n&&o.existsSync(n)&&(x[f]?x[f]=n+i.delimiter+x[f]:x[f]=n,u&&u(`NODE_PATH value is: ${x[f]}`)),x.ELECTRON_RUN_AS_NODE=`1`;try{let n=(0,c.fork)(``,[],{cwd:s,env:x,execArgv:[`-e`,p]});if(n.pid===void 0){g(Error(`Starting process to resolve node module ${t} failed`));return}n.on(`error`,t=>{g(t)}),n.on(`message`,i=>{i.c===`r`&&(n.send({c:`e`}),i.s?h(i.r):g(Error(`Failed to resolve module: ${t}`)))});let i={c:`rs`,a:t};n.send(i)}catch(t){g(t)}})}t.resolve=resolve;function resolveGlobalNodePath(t){let n=`npm`,o=Object.create(null);Object.keys(process.env).forEach(t=>o[t]=process.env[t]),o.NO_UPDATE_NOTIFIER=`true`;let s={encoding:`utf8`,env:o};isWindows()&&(n=`npm.cmd`,s.shell=!0);let handler=()=>{};try{process.on(`SIGPIPE`,handler);let o=(0,c.spawnSync)(n,[`config`,`get`,`prefix`],s).stdout;if(!o){t&&t(`'npm config get prefix' didn't return a value.`);return}let u=o.trim();return t&&t(`'npm config get prefix' value is: ${u}`),u.length>0?isWindows()?i.join(u,`node_modules`):i.join(u,`lib`,`node_modules`):void 0}catch{return}finally{process.removeListener(`SIGPIPE`,handler)}}t.resolveGlobalNodePath=resolveGlobalNodePath;function resolveGlobalYarnPath(t){let n=`yarn`,o={encoding:`utf8`};isWindows()&&(n=`yarn.cmd`,o.shell=!0);let handler=()=>{};try{process.on(`SIGPIPE`,handler);let s=(0,c.spawnSync)(n,[`global`,`dir`,`--json`],o),u=s.stdout;if(!u){t&&(t(`'yarn global dir' didn't return a value.`),s.stderr&&t(s.stderr));return}let f=u.trim().split(/\r?\n/);for(let t of f)try{let n=JSON.parse(t);if(n.type===`log`)return i.join(n.data,`node_modules`)}catch{}return}catch{return}finally{process.removeListener(`SIGPIPE`,handler)}}t.resolveGlobalYarnPath=resolveGlobalYarnPath;var u;(function(t){let n;function isCaseSensitive(){return n===void 0&&(n=process.platform===`win32`?!1:!o.existsSync(__filename.toUpperCase())||!o.existsSync(__filename.toLowerCase())),n}t.isCaseSensitive=isCaseSensitive;function isParent(t,n){return isCaseSensitive()?i.normalize(n).indexOf(i.normalize(t))===0:i.normalize(n).toLowerCase().indexOf(i.normalize(t).toLowerCase())===0}t.isParent=isParent})(u||(t.FileSystem=u={}));function resolveModulePath(t,n,o,s){return o?(i.isAbsolute(o)||(o=i.join(t,o)),resolve(n,o,o,s).then(t=>u.isParent(o,t)?t:Promise.reject(Error(`Failed to load ${n} from node path location.`))).then(void 0,i=>resolve(n,resolveGlobalNodePath(s),t,s))):resolve(n,resolveGlobalNodePath(s),t,s)}t.resolveModulePath=resolveModulePath})),ei=f(((t,n)=>{n.exports=Q()})),ti=f((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCompletionFeature=void 0;let n=Q(),InlineCompletionFeature=t=>class extends t{get inlineCompletion(){return{on:t=>this.connection.onRequest(n.InlineCompletionRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};t.InlineCompletionFeature=InlineCompletionFeature})),ni=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;let o=Br();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return o.SemanticTokensBuilder}});let s=ti();i(Q(),t);let c=Yr();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return c.TextDocuments}});let u=Xr();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return u.NotebookDocuments}}),i(Qr(),t);var f;(function(t){t.all={__brand:`features`,languages:s.InlineCompletionFeature}})(f||(t.ProposedFeatures=f={}))})),ri=f((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||(`get`in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}):(function(t,n,i,o){o===void 0&&(o=i),t[o]=n[i]})),i=t&&t.__exportStar||function(t,i){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&n(i,t,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;let o=s(`node:util`),c=Xn(),u=Qr(),f=$r(),p=ei();i(ei(),t),i(ni(),t);var h;(function(t){t.uriToFilePath=f.uriToFilePath,t.resolveGlobalNodePath=f.resolveGlobalNodePath,t.resolveGlobalYarnPath=f.resolveGlobalYarnPath,t.resolve=f.resolve,t.resolveModulePath=f.resolveModulePath})(h||(t.Files=h={}));let g=!1,_;function setupExitTimer(){let t=`--clientProcessId`;function runTimer(t){try{let n=parseInt(t);isNaN(n)||(_=setInterval(()=>{try{process.kill(n,0)}catch{process.exit(+!g)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let i=process.argv[n];if(i===t&&n+1<process.argv.length){runTimer(process.argv[n+1]);return}else{let n=i.split(`=`);n[0]===t&&runTimer(n[1])}}}setupExitTimer();let x={initialize:t=>{let n=t.processId;c.number(n)&&_===void 0&&setInterval(()=>{try{process.kill(n,0)}catch{process.exit(+!g)}},3e3)},get shutdownReceived(){return g},set shutdownReceived(t){g=t},exit:t=>{process.exit(t)}};function createConnection(t,n,i,o){let s,c,u,f;return t!==void 0&&t.__brand===`features`&&(s=t,t=n,n=i,i=o),p.ConnectionStrategy.is(t)||p.ConnectionOptions.is(t)?f=t:(c=t,u=n,f=i),_createConnection(c,u,f,s)}t.createConnection=createConnection;function _createConnection(t,n,i,o){let s=!1;if(!t&&!n&&process.argv.length>2){let i,o,c=process.argv.slice(2);for(let u=0;u<c.length;u++){let h=c[u];if(h===`--node-ipc`){t=new p.IPCMessageReader(process),n=new p.IPCMessageWriter(process);break}else if(h===`--stdio`){s=!0,t=process.stdin,n=process.stdout;break}else if(h===`--socket`){i=parseInt(c[u+1]);break}else if(h===`--pipe`){o=c[u+1];break}else{var f=h.split(`=`);if(f[0]===`--socket`){i=parseInt(f[1]);break}else if(f[0]===`--pipe`){o=f[1];break}}}if(i){let o=(0,p.createServerSocketTransport)(i);t=o[0],n=o[1]}else if(o){let i=(0,p.createServerPipeTransport)(o);t=i[0],n=i[1]}}var h=`Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'`;if(!t)throw Error(`Connection input stream is not set. `+h);if(!n)throw Error(`Connection output stream is not set. `+h);if(c.func(t.read)&&c.func(t.on)){let n=t;n.on(`end`,()=>{process.exit(+!g)}),n.on(`close`,()=>{process.exit(+!g)})}let connectionFactory=o=>{let c=(0,p.createProtocolConnection)(t,n,o,i);return s&&patchConsole(o),c};return(0,u.createConnection)(connectionFactory,x,o)}function patchConsole(t){function serialize(t){return t.map(t=>typeof t==`string`?t:(0,o.inspect)(t)).join(` `)}let n=new Map;console.assert=function assert(n,...i){if(!n)if(i.length===0)t.error(`Assertion failed`);else{let[n,...o]=i;t.error(`Assertion failed: ${n} ${serialize(o)}`)}},console.count=function count(i=`default`){let o=String(i),s=n.get(o)??0;s+=1,n.set(o,s),t.log(`${o}: ${o}`)},console.countReset=function countReset(t){t===void 0?n.clear():n.delete(String(t))},console.debug=function debug(...n){t.log(serialize(n))},console.dir=function dir(n,i){t.log((0,o.inspect)(n,i))},console.log=function log(...n){t.log(serialize(n))},console.error=function error(...n){t.error(serialize(n))},console.trace=function trace(...n){let i=Error().stack.replace(/(.+\n){2}/,``),o=`Trace`;n.length!==0&&(o+=`: ${serialize(n)}`),t.log(`${o}\n${i}`)},console.warn=function warn(...n){t.warn(serialize(n))}}})),$=ri();function findNextFeatures(t,n){let i={stacks:t,tokens:n};return interpretTokens(i),i.stacks.flat().forEach(t=>{t.property=void 0}),findNextFeatureStacks(i.stacks).map(t=>t[t.length-1])}function findNextFeaturesInternal(t){let{next:n,cardinalities:i,visited:o,plus:s}=t,c=[],u=n.feature;if(o.has(u))return[];isGroup(u)||o.add(u);let f,p=u;for(;p.$container;)if(isGroup(p.$container)){f=p.$container;break}else if(isAbstractElement(p.$container))p=p.$container;else break;if(isArrayCardinality(p.cardinality)){let t=findFirstFeaturesInternal({next:{feature:p,type:n.type},cardinalities:i,visited:o,plus:s});for(let n of t)s.add(n.feature);c.push(...t)}if(f){let t=f.elements.indexOf(p);t!==void 0&&t<f.elements.length-1&&c.push(...findNextFeaturesInGroup({feature:f,type:n.type},t+1,i,o,s)),c.every(t=>isOptionalCardinality(t.feature.cardinality,t.feature)||isOptionalCardinality(i.get(t.feature))||s.has(t.feature))&&c.push(...findNextFeaturesInternal({next:{feature:f,type:n.type},cardinalities:i,visited:o,plus:s}))}return c}function findFirstFeatures(t){return isAstNode(t)&&(t={feature:t}),findFirstFeaturesInternal({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function findFirstFeaturesInternal(t){let{next:n,cardinalities:i,visited:o,plus:s}=t;if(n===void 0)return[];let{feature:c,type:u}=n;if(isGroup(c))return o.has(c)?[]:(o.add(c),findNextFeaturesInGroup(n,0,i,o,s).map(t=>modifyCardinality(t,c.cardinality,i)));if(isAlternatives(c)||isUnorderedGroup(c))return c.elements.flatMap(t=>findFirstFeaturesInternal({next:{feature:t,type:u,property:n.property},cardinalities:i,visited:o,plus:s})).map(t=>modifyCardinality(t,c.cardinality,i));if(isAssignment(c))return findFirstFeaturesInternal({next:{feature:c.terminal,type:u,property:n.property??c.feature},cardinalities:i,visited:o,plus:s}).map(t=>modifyCardinality(t,c.cardinality,i));if(isAction(c))return findNextFeaturesInternal({next:{feature:c,type:getTypeName(c),property:n.property??c.feature},cardinalities:i,visited:o,plus:s});if(isRuleCall(c)&&isParserRule(c.rule.ref)){let t=c.rule.ref;return findFirstFeaturesInternal({next:{feature:t.definition,type:t.fragment||t.dataType?void 0:getExplicitRuleType(t)??t.name,property:n.property},cardinalities:i,visited:o,plus:s}).map(t=>modifyCardinality(t,c.cardinality,i))}else return[n]}function modifyCardinality(t,n,i){return i.set(t.feature,n),t}function findNextFeaturesInGroup(t,n,i,o,s){let c=[],u;for(;n<t.feature.elements.length&&(u={feature:t.feature.elements[n++],type:t.type},c.push(...findFirstFeaturesInternal({next:u,cardinalities:i,visited:o,plus:s})),isOptionalCardinality(u.feature.cardinality??i.get(u.feature),u.feature)););return c}function interpretTokens(t){for(let n of t.tokens)t.stacks=findNextFeatureStacks(t.stacks,n)}function findNextFeatureStacks(t,n){let i=[];for(let o of t)i.push(...interpretStackToken(o,n));return i}function interpretStackToken(t,n){let i=new Map,o=new Set(t.map(t=>t.feature).filter(isPlusFeature)),s=[];for(;t.length>0;){let c=findNextFeaturesInternal({next:t.pop(),cardinalities:i,plus:o,visited:new Set}).filter(t=>n?featureMatches(t.feature,n):!0);for(let n of c)s.push([...t,n]);if(!c.every(t=>isOptionalCardinality(t.feature.cardinality,t.feature)||isOptionalCardinality(i.get(t.feature))))break}return s}function isPlusFeature(t){if(t.cardinality===`+`)return!0;let n=getContainerOfType(t,isAssignment);return!!(n&&n.cardinality===`+`)}function featureMatches(t,n){if(isKeyword(t))return t.value===n.image;if(isRuleCall(t))return ruleMatches(t.rule.ref,n);if(isCrossReference(t)){let i=getCrossReferenceTerminal(t);if(i)return featureMatches(i,n)}return!1}function ruleMatches(t,n){return isParserRule(t)?findFirstFeatures(t.definition).some(t=>featureMatches(t.feature,n)):isTerminalRule(t)?terminalRegex(t).test(n.image):!1}function mergeCompletionProviderOptions(t){let n=Array.from(new Set(t.flatMap(t=>t?.triggerCharacters??[]))),i=Array.from(new Set(t.flatMap(t=>t?.allCommitCharacters??[])));return{triggerCharacters:n.length>0?n:void 0,allCommitCharacters:i.length>0?i:void 0}}var DefaultCompletionProvider=class{constructor(t){this.scopeProvider=t.references.ScopeProvider,this.grammar=t.Grammar,this.completionParser=t.parser.CompletionParser,this.nameProvider=t.references.NameProvider,this.lexer=t.parser.Lexer,this.nodeKindProvider=t.shared.lsp.NodeKindProvider,this.fuzzyMatcher=t.shared.lsp.FuzzyMatcher,this.grammarConfig=t.parser.GrammarConfig,this.astReflection=t.shared.AstReflection,this.documentationProvider=t.documentation.DocumentationProvider}async getCompletion(t,n,i){let o=[],s=this.buildContexts(t,n.position),acceptor=(t,n)=>{let i=this.fillCompletionItem(t,n);i&&o.push(i)},distinctionFunction=t=>isKeyword(t.feature)?t.feature.value:t.feature,c=[];for(let t of s)if(await Promise.all(stream(t.features).distinct(distinctionFunction).exclude(c).map(n=>this.completionFor(t,n,acceptor))),c.push(...t.features),!this.continueCompletion(o))break;return $.CompletionList.create(this.deduplicateItems(o),!0)}deduplicateItems(t){return stream(t).distinct(t=>`${t.kind}_${t.label}_${t.detail}`).toArray()}findFeaturesAt(t,n){let i=t.getText({start:$.Position.create(0,0),end:t.positionAt(n)}),o=this.completionParser.parse(i),s=o.tokens;if(o.tokenIndex===0){let t=getEntryRule(this.grammar),n=findFirstFeatures({feature:t.definition,type:getExplicitRuleType(t)});return s.length>0?(s.shift(),findNextFeatures(n.map(t=>[t]),s)):n}let c=[...s].splice(o.tokenIndex);return findNextFeatures([o.elementStack.map(t=>({feature:t}))],c)}*buildContexts(t,n){let i=t.parseResult.value.$cstNode;if(!i)return;let o=t.textDocument,s=o.getText(),c=o.offsetAt(n),u={document:t,textDocument:o,offset:c,position:n},f=this.findDataTypeRuleStart(i,c);if(f){let[t,n]=f,s=findLeafNodeBeforeOffset(i,t)?.astNode;yield Object.assign(Object.assign({},u),{node:s,tokenOffset:t,tokenEndOffset:n,features:this.findFeaturesAt(o,t)})}let{nextTokenStart:p,nextTokenEnd:h,previousTokenStart:g,previousTokenEnd:_}=this.backtrackToAnyToken(s,c),x=p;c<=p&&g!==void 0&&(x=g);let S=findLeafNodeBeforeOffset(i,x)?.astNode,T=!0;if(g!==void 0&&_!==void 0&&_===c&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:g,tokenEndOffset:_,features:this.findFeaturesAt(o,g)}),T=this.performNextTokenCompletion(t,s.substring(g,_),g,_),T&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:_,tokenEndOffset:_,features:this.findFeaturesAt(o,_)}))),S)T&&(yield Object.assign(Object.assign({},u),{node:S,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(o,p)}));else{let t=getEntryRule(this.grammar);if(!t)throw Error(`Missing entry parser rule`);yield Object.assign(Object.assign({},u),{tokenOffset:p,tokenEndOffset:h,features:findFirstFeatures(t.definition)})}}performNextTokenCompletion(t,n,i,o){return/\P{L}$/u.test(n)}findDataTypeRuleStart(t,n){let i=findDeclarationNodeAtOffset(t,n,this.grammarConfig.nameRegexp),o=!!getContainerOfType(i?.grammarSource,isParserRule)?.dataType;if(o){for(;o;)i=i?.container,o=!!getContainerOfType(i?.grammarSource,isParserRule)?.dataType;if(i)return[i.offset,i.end]}}continueCompletion(t){return t.length===0}backtrackToAnyToken(t,n){let i=this.lexer.tokenize(t).tokens;if(i.length===0)return{nextTokenStart:n,nextTokenEnd:n};let o;for(let t of i){if(t.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0};if(t.endOffset>=n)return{nextTokenStart:t.startOffset,nextTokenEnd:t.endOffset+1,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0};o=t}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:o?o.startOffset:void 0,previousTokenEnd:o?o.endOffset+1:void 0}}completionFor(t,n,i){if(isKeyword(n.feature))return this.completionForKeyword(t,n.feature,i);if(isCrossReference(n.feature)&&t.node)return this.completionForCrossReference(t,n,i)}completionForCrossReference(t,n,i){let o=getContainerOfType(n.feature,isAssignment),s=t.node;if(o&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},assignMandatoryProperties(this.astReflection,s));let c={reference:{$refText:``},container:s,property:o.feature};try{for(let n of this.getReferenceCandidates(c,t))i(t,this.createReferenceCompletionItem(n))}catch(t){console.error(t)}}}getReferenceCandidates(t,n){return this.scopeProvider.getScope(t).getAllElements()}createReferenceCompletionItem(t){return{nodeDescription:t,kind:this.nodeKindProvider.getCompletionItemKind(t),documentation:this.getReferenceDocumentation(t),detail:t.type,sortText:`0`}}getReferenceDocumentation(t){if(!t.node)return;let n=this.documentationProvider.getDocumentation(t.node);if(n)return{kind:`markdown`,value:n}}completionForKeyword(t,n,i){this.filterKeyword(t,n)&&i(t,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:`Keyword`,sortText:`1`})}getKeywordCompletionItemKind(t){return $.CompletionItemKind.Keyword}filterKeyword(t,n){return/\p{L}/u.test(n.value)}fillCompletionItem(t,n){let i;if(typeof n.label==`string`)i=n.label;else if(`node`in n){let t=this.nameProvider.getName(n.node);if(!t)return;i=t}else if(`nodeDescription`in n)i=n.nodeDescription.name;else return;let o;o=typeof n.textEdit?.newText==`string`?n.textEdit.newText:typeof n.insertText==`string`?n.insertText:i;let s=n.textEdit??this.buildCompletionTextEdit(t,i,o);if(s)return{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:s,label:i}}buildCompletionTextEdit(t,n,i){let o=t.textDocument.getText().substring(t.tokenOffset,t.offset);if(this.fuzzyMatcher.match(o,n))return{newText:i,range:{start:t.textDocument.positionAt(t.tokenOffset),end:t.position}}}},DefaultDefinitionProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}getDefinition(t,n,i){let o=t.parseResult.value;if(o.$cstNode){let i=o.$cstNode,s=findDeclarationNodeAtOffset(i,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(s)return this.collectLocationLinks(s,n)}}collectLocationLinks(t,n){let i=this.findLink(t);if(i)return[$.LocationLink.create(i.targetDocument.textDocument.uri,(i.target.astNode.$cstNode??i.target).range,i.target.range,i.source.range)]}findLink(t){let n=this.references.findDeclarationNode(t);if(n?.astNode){let i=getDocument(n.astNode);if(n&&i)return{source:t,target:n,targetDocument:i}}}},DefaultDocumentHighlightProvider=class{constructor(t){this.references=t.references.References,this.nameProvider=t.references.NameProvider,this.grammarConfig=t.parser.GrammarConfig}getDocumentHighlight(t,n,i){let o=t.parseResult.value.$cstNode;if(!o)return;let s=findDeclarationNodeAtOffset(o,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;let c=this.references.findDeclaration(s);if(c){let n=Y.equals(getDocument(c).uri,t.uri),i={documentUri:t.uri,includeDeclaration:n};return this.references.findReferences(c,i).map(t=>this.createDocumentHighlight(t)).toArray()}}createDocumentHighlight(t){return $.DocumentHighlight.create(t.segment.range)}},DefaultDocumentSymbolProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.nodeKindProvider=t.shared.lsp.NodeKindProvider}getSymbols(t,n,i){return this.getSymbol(t,t.parseResult.value)}getSymbol(t,n){let i=n.$cstNode,o=this.nameProvider.getNameNode(n);if(o&&i){let s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||o.text,range:i.range,selectionRange:o.range,children:this.getChildSymbols(t,n)}]}else return this.getChildSymbols(t,n)||[]}getChildSymbols(t,n){let i=[];for(let o of streamContents(n)){let n=this.getSymbol(t,o);i.push(...n)}if(i.length>0)return i}},DefaultDocumentUpdateHandler=class{constructor(t){this.workspaceManager=t.workspace.WorkspaceManager,this.documentBuilder=t.workspace.DocumentBuilder,this.workspaceLock=t.workspace.WorkspaceLock,this.serviceRegistry=t.ServiceRegistry;let n=!1;t.lsp.LanguageServer.onInitialize(t=>{n=!!t.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration}),t.lsp.LanguageServer.onInitialized(i=>{n&&this.registerFileWatcher(t)})}registerFileWatcher(t){let n=[],i=stream(t.ServiceRegistry.all).flatMap(t=>t.LanguageMetaData.fileExtensions).map(t=>t.startsWith(`.`)?t.substring(1):t).distinct().toArray();i.length>0&&n.push({globPattern:i.length===1?`**/*.${i[0]}`:`**/*.{${i.join(`,`)}}`});let o=stream(t.ServiceRegistry.all).flatMap(t=>t.LanguageMetaData.fileNames??[]).distinct().toArray();if(o.length>0&&n.push({globPattern:o.length===1?`**/${o[0]}`:`**/{${o.join(`,`)}}`}),n.length>0){let i=t.lsp.Connection,o={watchers:n};i?.client.register($.DidChangeWatchedFilesNotification.type,o)}}fireDocumentUpdate(t,n){t=t.filter(t=>this.serviceRegistry.hasServices(t)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(i=>this.documentBuilder.update(t,n,i))}).catch(t=>{console.error(`Workspace initialization failed. Could not perform document update.`,t)})}didChangeContent(t){this.fireDocumentUpdate([J.parse(t.document.uri)],[])}didChangeWatchedFiles(t){let n=stream(t.changes).filter(t=>t.type!==$.FileChangeType.Deleted).distinct(t=>t.uri).map(t=>J.parse(t.uri)).toArray(),i=stream(t.changes).filter(t=>t.type===$.FileChangeType.Deleted).distinct(t=>t.uri).map(t=>J.parse(t.uri)).toArray();this.fireDocumentUpdate(n,i)}},DefaultFoldingRangeProvider=class{constructor(t){this.commentNames=t.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(t,n,i){let o=[],acceptor=t=>o.push(t);return this.collectFolding(t,acceptor),o}collectFolding(t,n){let i=t.parseResult?.value;if(i){if(this.shouldProcessContent(i)){let o=streamAllContents(i).iterator(),s;do if(s=o.next(),!s.done){let i=s.value;this.shouldProcess(i)&&this.collectObjectFolding(t,i,n),this.shouldProcessContent(i)||o.prune()}while(!s.done)}this.collectCommentFolding(t,i,n)}}shouldProcess(t){return!0}shouldProcessContent(t){return!0}collectObjectFolding(t,n,i){let o=n.$cstNode;if(o){let n=this.toFoldingRange(t,o);n&&i(n)}}collectCommentFolding(t,n,i){let o=n.$cstNode;if(o){for(let n of flattenCst(o))if(this.commentNames.includes(n.tokenType.name)){let o=this.toFoldingRange(t,n,$.FoldingRangeKind.Comment);o&&i(o)}}}toFoldingRange(t,n,i){let o=n.range,s=o.start,c=o.end;if(!(c.line-s.line<2))return this.includeLastFoldingLine(n,i)||(c=t.textDocument.positionAt(t.textDocument.offsetAt({line:c.line,character:0})-1)),$.FoldingRange.create(s.line,c.line,s.character,c.character,i)}includeLastFoldingLine(t,n){if(n===$.FoldingRangeKind.Comment)return!1;let i=t.text,o=i.charAt(i.length-1);return!(o===`}`||o===`)`||o===`]`)}},DefaultFuzzyMatcher=class{match(t,n){if(t.length===0)return!0;let i=!1,o,s=0,c=n.length;for(let u=0;u<c;u++){let c=n.charCodeAt(u),f=t.charCodeAt(s);if((c===f||this.toUpperCharCode(c)===this.toUpperCharCode(f))&&(i||=o===void 0||this.isWordTransition(o,c),i&&s++,s===t.length))return!0;o=c}return!1}isWordTransition(t,n){return ii<=t&&t<=ai&&oi<=n&&n<=si||t===ci&&n!==ci}toUpperCharCode(t){return ii<=t&&t<=ai?t-32:t}};const ii=97,ai=122,oi=65,si=90,ci=95;var AstNodeHoverProvider=class{constructor(t){this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}getHoverContent(t,n){let i=t.parseResult?.value?.$cstNode;if(i){let o=t.textDocument.offsetAt(n.position),s=findDeclarationNodeAtOffset(i,o,this.grammarConfig.nameRegexp);if(s&&s.offset+s.length>o){let t=this.references.findDeclaration(s);if(t)return this.getAstNodeHoverContent(t);if(isKeyword(s.grammarSource))return this.getKeywordHoverContent(s.grammarSource)}}}getKeywordHoverContent(t){let n=isAstNodeWithComment(t)?t.$comment:void 0;if(n||=findCommentNode(t.$cstNode,[`ML_COMMENT`])?.text,n&&isJSDoc(n)){let t=parseJSDoc(n).toMarkdown();if(t)return{contents:{kind:`markdown`,value:t}}}}},MultilineCommentHoverProvider=class extends AstNodeHoverProvider{constructor(t){super(t),this.documentationProvider=t.documentation.DocumentationProvider}getAstNodeHoverContent(t){let n=this.documentationProvider.getDocumentation(t);if(n)return{contents:{kind:`markdown`,value:n}}}},li=Q();const ui={[$.SemanticTokenTypes.class]:0,[$.SemanticTokenTypes.comment]:1,[$.SemanticTokenTypes.enum]:2,[$.SemanticTokenTypes.enumMember]:3,[$.SemanticTokenTypes.event]:4,[$.SemanticTokenTypes.function]:5,[$.SemanticTokenTypes.interface]:6,[$.SemanticTokenTypes.keyword]:7,[$.SemanticTokenTypes.macro]:8,[$.SemanticTokenTypes.method]:9,[$.SemanticTokenTypes.modifier]:10,[$.SemanticTokenTypes.namespace]:11,[$.SemanticTokenTypes.number]:12,[$.SemanticTokenTypes.operator]:13,[$.SemanticTokenTypes.parameter]:14,[$.SemanticTokenTypes.property]:15,[$.SemanticTokenTypes.regexp]:16,[$.SemanticTokenTypes.string]:17,[$.SemanticTokenTypes.struct]:18,[$.SemanticTokenTypes.type]:19,[$.SemanticTokenTypes.typeParameter]:20,[$.SemanticTokenTypes.variable]:21,[$.SemanticTokenTypes.decorator]:22},di={[$.SemanticTokenModifiers.abstract]:1,[$.SemanticTokenModifiers.async]:2,[$.SemanticTokenModifiers.declaration]:4,[$.SemanticTokenModifiers.defaultLibrary]:8,[$.SemanticTokenModifiers.definition]:16,[$.SemanticTokenModifiers.deprecated]:32,[$.SemanticTokenModifiers.documentation]:64,[$.SemanticTokenModifiers.modification]:128,[$.SemanticTokenModifiers.readonly]:256,[$.SemanticTokenModifiers.static]:512};function mergeSemanticTokenProviderOptions(t){let n=[],i=[],o=!0,s=!0,c=!0;for(let u of t)u&&(u.legend.tokenTypes.forEach((t,i)=>{let o=n[i];if(o&&o!==t)throw Error(`Cannot merge '${o}' and '${t}' token types. They use the same index ${i}.`);n[i]=t}),u.legend.tokenModifiers.forEach((t,n)=>{let o=i[n];if(o&&o!==t)throw Error(`Cannot merge '${o}' and '${t}' token modifier. They use the same index ${n}.`);i[n]=t}),u.full?typeof u.full==`object`&&!u.full.delta&&(s=!1):o=!1,u.range||(c=!1));return{legend:{tokenTypes:n,tokenModifiers:i},full:o&&{delta:s},range:c}}var SemanticTokensBuilder=class extends $.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(t,n,i,o,s){this._tokens.push({line:t,char:n,length:i,tokenType:o,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(let t of this._tokens.sort(this.compareTokens))super.push(t.line,t.char,t.length,t.tokenType,t.tokenModifiers);this._tokens=[]}compareTokens(t,n){return t.line===n.line?t.char-n.char:t.line-n.line}},AbstractSemanticTokenProvider=class{constructor(t){this.tokensBuilders=new Map,t.shared.workspace.TextDocuments.onDidClose(t=>{this.tokensBuilders.delete(t.document.uri)}),t.shared.lsp.LanguageServer.onInitialize(t=>{this.initialize(t.capabilities.textDocument?.semanticTokens)})}initialize(t){this.clientCapabilities=t}get tokenTypes(){return ui}get tokenModifiers(){return di}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(t,n,i=q.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.flush(),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.build()}async semanticHighlightRange(t,n,i=q.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.flush(),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.build()}async semanticHighlightDelta(t,n,i=q.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=t,this.currentTokensBuilder=this.getDocumentTokensBuilder(t),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(t,this.createAcceptor(),i),this.currentTokensBuilder.buildEdits()}createAcceptor(){let acceptor=t=>{`line`in t?this.highlightToken({range:{start:{line:t.line,character:t.char},end:{line:t.line,character:t.char+t.length}},type:t.type,modifier:t.modifier}):`range`in t?this.highlightToken(t):`keyword`in t?this.highlightKeyword(t):`property`in t?this.highlightProperty(t):this.highlightNode({node:t.cst,type:t.type,modifier:t.modifier})};return acceptor}getDocumentTokensBuilder(t){let n=this.tokensBuilders.get(t.uri.toString());if(n)return n;let i=new SemanticTokensBuilder;return this.tokensBuilders.set(t.uri.toString(),i),i}async computeHighlighting(t,n,i){let o=t.parseResult.value,s=streamAst(o,{range:this.currentRange}).iterator(),c;do if(c=s.next(),!c.done){await interruptAndCheck(i);let t=c.value;this.highlightElement(t,n)===`prune`&&s.prune()}while(!c.done)}highlightToken(t){let{range:n,type:i}=t,o=t.modifier;if(this.currentRange&&!inRange(n,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;let s=this.tokenTypes[i],c=0;if(o!==void 0){typeof o==`string`&&(o=[o]);for(let t of o){let n=this.tokenModifiers[t];c|=n}}let u=n.start.line,f=n.end.line;if(u===f){let t=n.start.character,i=n.end.character-t;this.currentTokensBuilder.push(u,t,i,s,c)}else if(this.clientCapabilities?.multilineTokenSupport){let t=n.start.character,i=this.currentDocument.textDocument.offsetAt(n.start),o=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(u,t,o-i,s,c)}else{let t=n.start,i=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(t.line,t.character,i-t.character-1,s,c);for(let t=u+1;t<f;t++){let n=i;i=this.currentDocument.textDocument.offsetAt({line:t+1,character:0}),this.currentTokensBuilder.push(t,0,i-n-1,s,c)}this.currentTokensBuilder.push(f,0,n.end.character,s,c)}}highlightProperty(t){let n=[];if(typeof t.index==`number`){let i=findNodeForProperty(t.node.$cstNode,t.property,t.index);i&&n.push(i)}else n.push(...findNodesForProperty(t.node.$cstNode,t.property));let{type:i,modifier:o}=t;for(let t of n)this.highlightNode({node:t,type:i,modifier:o})}highlightKeyword(t){let{node:n,keyword:i,type:o,index:s,modifier:c}=t,u=[];if(typeof s==`number`){let t=findNodeForKeyword(n.$cstNode,i,s);t&&u.push(t)}else u.push(...findNodesForKeyword(n.$cstNode,i));for(let t of u)this.highlightNode({node:t,type:o,modifier:c})}highlightNode(t){let{node:n,type:i,modifier:o}=t,s=n.range;this.highlightToken({range:s,type:i,modifier:o})}},fi;(function(t){function decode(t,n,i){let o=new Map;Object.entries(n).forEach(([t,n])=>o.set(n,t));let s=0,c=0;return sliceIntoChunks(t.data,5).map(t=>{s+=t[0],t[0]!==0&&(c=0),c+=t[1];let n=t[2];return{offset:i.textDocument.offsetAt({line:s,character:c}),tokenType:o.get(t[3]),tokenModifiers:t[4],text:i.textDocument.getText({start:{line:s,character:c},end:{line:s,character:c+n}})}})}t.decode=decode;function sliceIntoChunks(t,n){let i=[];for(let o=0;o<t.length;o+=n){let s=t.slice(o,o+n);i.push(s)}return i}})(fi||={});function mergeSignatureHelpOptions(t){let n=[],i=[];t.forEach(t=>{t?.triggerCharacters&&n.push(...t.triggerCharacters),t?.retriggerCharacters&&i.push(...t.retriggerCharacters)});let o={triggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0,retriggerCharacters:i.length>0?Array.from(new Set(i)).sort():void 0};return o.triggerCharacters?o:void 0}var DefaultLanguageServer=class{constructor(t){this.onInitializeEmitter=new li.Emitter,this.onInitializedEmitter=new li.Emitter,this.services=t}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(t){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(t),this.onInitializeEmitter.fire(t),this.onInitializeEmitter.dispose(),this.buildInitializeResult(t)}eagerLoadServices(){eagerLoad(this.services),this.services.ServiceRegistry.all.forEach(t=>eagerLoad(t))}hasService(t){return this.services.ServiceRegistry.all.some(n=>t(n)!==void 0)}buildInitializeResult(t){let n=this.services.lsp.DocumentUpdateHandler,i=this.services.lsp.FileOperationHandler?.fileOperationOptions,o=this.services.ServiceRegistry.all,s=this.hasService(t=>t.lsp?.Formatter),c=o.map(t=>t.lsp?.Formatter?.formatOnTypeOptions).find(t=>!!t),u=this.hasService(t=>t.lsp?.CodeActionProvider),f=this.hasService(t=>t.lsp?.SemanticTokenProvider),p=mergeSemanticTokenProviderOptions(o.map(t=>t.lsp?.SemanticTokenProvider?.semanticTokensOptions)),h=this.services.lsp?.ExecuteCommandHandler?.commands,g=this.hasService(t=>t.lsp?.DocumentLinkProvider),_=mergeSignatureHelpOptions(o.map(t=>t.lsp?.SignatureHelp?.signatureHelpOptions)),x=this.hasService(t=>t.lsp?.TypeProvider),S=this.hasService(t=>t.lsp?.ImplementationProvider),T=this.hasService(t=>t.lsp?.CompletionProvider),E=mergeCompletionProviderOptions(o.map(t=>t.lsp?.CompletionProvider?.completionOptions)),D=this.hasService(t=>t.lsp?.ReferencesProvider),ee=this.hasService(t=>t.lsp?.DocumentSymbolProvider),O=this.hasService(t=>t.lsp?.DefinitionProvider),k=this.hasService(t=>t.lsp?.DocumentHighlightProvider),A=this.hasService(t=>t.lsp?.FoldingRangeProvider),j=this.hasService(t=>t.lsp?.HoverProvider),M=this.hasService(t=>t.lsp?.RenameProvider),N=this.hasService(t=>t.lsp?.CallHierarchyProvider),P=this.hasService(t=>t.lsp?.TypeHierarchyProvider),te=this.hasService(t=>t.lsp?.CodeLensProvider),F=this.hasService(t=>t.lsp?.DeclarationProvider),ne=this.hasService(t=>t.lsp?.InlayHintProvider),re=this.services.lsp?.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:i},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:li.TextDocumentSyncKind.Incremental,openClose:!0,save:!!n.didSaveDocument,willSave:!!n.willSaveDocument,willSaveWaitUntil:!!n.willSaveDocumentWaitUntil},completionProvider:T?E:void 0,referencesProvider:D,documentSymbolProvider:ee,definitionProvider:O,typeDefinitionProvider:x,documentHighlightProvider:k,codeActionProvider:u,documentFormattingProvider:s,documentRangeFormattingProvider:s,documentOnTypeFormattingProvider:c,foldingRangeProvider:A,hoverProvider:j,renameProvider:M?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:_,implementationProvider:S,callHierarchyProvider:N?{}:void 0,typeHierarchyProvider:P?{}:void 0,documentLinkProvider:g?{resolveProvider:!1}:void 0,codeLensProvider:te?{resolveProvider:!1}:void 0,declarationProvider:F,inlayHintProvider:ne?{resolveProvider:!1}:void 0,workspaceSymbolProvider:re?{resolveProvider:!!re.resolveSymbol}:void 0}}}initialized(t){this.fireInitializedOnDefaultServices(t),this.onInitializedEmitter.fire(t),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(t){this.services.workspace.ConfigurationProvider.initialize(t),this.services.workspace.WorkspaceManager.initialize(t)}fireInitializedOnDefaultServices(t){let n=this.services.lsp.Connection,i=n?Object.assign(Object.assign({},t),{register:t=>n.client.register(li.DidChangeConfigurationNotification.type,t),fetchConfiguration:t=>n.workspace.getConfiguration(t)}):t;this.services.workspace.ConfigurationProvider.initialized(i).catch(t=>console.error(`Error in ConfigurationProvider initialization:`,t)),this.services.workspace.WorkspaceManager.initialized(t).catch(t=>console.error(`Error in WorkspaceManager initialization:`,t))}};function startLanguageServer(t){let n=t.lsp.Connection;if(!n)throw Error(`Starting a language server requires the languageServer.Connection service to be set.`);addDocumentUpdateHandler(n,t),addFileOperationHandler(n,t),addDiagnosticsHandler(n,t),addCompletionHandler(n,t),addFindReferencesHandler(n,t),addDocumentSymbolHandler(n,t),addGotoDefinitionHandler(n,t),addGoToTypeDefinitionHandler(n,t),addGoToImplementationHandler(n,t),addDocumentHighlightsHandler(n,t),addFoldingRangeHandler(n,t),addFormattingHandler(n,t),addCodeActionHandler(n,t),addRenameHandler(n,t),addHoverHandler(n,t),addInlayHintHandler(n,t),addSemanticTokenHandler(n,t),addExecuteCommandHandler(n,t),addSignatureHelpHandler(n,t),addCallHierarchyHandler(n,t),addTypeHierarchyHandler(n,t),addCodeLensHandler(n,t),addDocumentLinkHandler(n,t),addConfigurationChangeHandler(n,t),addGoToDeclarationHandler(n,t),addWorkspaceSymbolHandler(n,t),n.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),n.onInitialized(n=>{t.lsp.LanguageServer.initialized(n)}),t.workspace.TextDocuments.listen(n),n.listen()}function addDocumentUpdateHandler(t,n){let i=n.lsp.DocumentUpdateHandler,o=n.workspace.TextDocuments;i.didOpenDocument&&o.onDidOpen(t=>i.didOpenDocument(t)),i.didChangeContent&&o.onDidChangeContent(t=>i.didChangeContent(t)),i.didCloseDocument&&o.onDidClose(t=>i.didCloseDocument(t)),i.didSaveDocument&&o.onDidSave(t=>i.didSaveDocument(t)),i.willSaveDocument&&o.onWillSave(t=>i.willSaveDocument(t)),i.willSaveDocumentWaitUntil&&o.onWillSaveWaitUntil(t=>i.willSaveDocumentWaitUntil(t)),i.didChangeWatchedFiles&&t.onDidChangeWatchedFiles(t=>i.didChangeWatchedFiles(t))}function addFileOperationHandler(t,n){let i=n.lsp.FileOperationHandler;i&&(i.didCreateFiles&&t.workspace.onDidCreateFiles(t=>i.didCreateFiles(t)),i.didRenameFiles&&t.workspace.onDidRenameFiles(t=>i.didRenameFiles(t)),i.didDeleteFiles&&t.workspace.onDidDeleteFiles(t=>i.didDeleteFiles(t)),i.willCreateFiles&&t.workspace.onWillCreateFiles(t=>i.willCreateFiles(t)),i.willRenameFiles&&t.workspace.onWillRenameFiles(t=>i.willRenameFiles(t)),i.willDeleteFiles&&t.workspace.onWillDeleteFiles(t=>i.willDeleteFiles(t)))}function addDiagnosticsHandler(t,n){let i=n.workspace.DocumentBuilder;i.onUpdate(async(n,i)=>{for(let n of i)t.sendDiagnostics({uri:n.toString(),diagnostics:[]})}),i.onDocumentPhase(X.Validated,async n=>{n.diagnostics&&t.sendDiagnostics({uri:n.uri.toString(),diagnostics:n.diagnostics})})}function addCompletionHandler(t,n){t.onCompletion(createRequestHandler((t,n,i,o)=>(t.lsp?.CompletionProvider)?.getCompletion(n,i,o),n,X.IndexedReferences))}function addFindReferencesHandler(t,n){t.onReferences(createRequestHandler((t,n,i,o)=>(t.lsp?.ReferencesProvider)?.findReferences(n,i,o),n,X.IndexedReferences))}function addCodeActionHandler(t,n){t.onCodeAction(createRequestHandler((t,n,i,o)=>(t.lsp?.CodeActionProvider)?.getCodeActions(n,i,o),n,X.Validated))}function addDocumentSymbolHandler(t,n){t.onDocumentSymbol(createRequestHandler((t,n,i,o)=>(t.lsp?.DocumentSymbolProvider)?.getSymbols(n,i,o),n,X.Parsed))}function addGotoDefinitionHandler(t,n){t.onDefinition(createRequestHandler((t,n,i,o)=>(t.lsp?.DefinitionProvider)?.getDefinition(n,i,o),n,X.IndexedReferences))}function addGoToTypeDefinitionHandler(t,n){t.onTypeDefinition(createRequestHandler((t,n,i,o)=>(t.lsp?.TypeProvider)?.getTypeDefinition(n,i,o),n,X.IndexedReferences))}function addGoToImplementationHandler(t,n){t.onImplementation(createRequestHandler((t,n,i,o)=>(t.lsp?.ImplementationProvider)?.getImplementation(n,i,o),n,X.IndexedReferences))}function addGoToDeclarationHandler(t,n){t.onDeclaration(createRequestHandler((t,n,i,o)=>(t.lsp?.DeclarationProvider)?.getDeclaration(n,i,o),n,X.IndexedReferences))}function addDocumentHighlightsHandler(t,n){t.onDocumentHighlight(createRequestHandler((t,n,i,o)=>(t.lsp?.DocumentHighlightProvider)?.getDocumentHighlight(n,i,o),n,X.IndexedReferences))}function addHoverHandler(t,n){t.onHover(createRequestHandler((t,n,i,o)=>(t.lsp?.HoverProvider)?.getHoverContent(n,i,o),n,X.IndexedReferences))}function addFoldingRangeHandler(t,n){t.onFoldingRanges(createRequestHandler((t,n,i,o)=>(t.lsp?.FoldingRangeProvider)?.getFoldingRanges(n,i,o),n,X.Parsed))}function addFormattingHandler(t,n){t.onDocumentFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocument(n,i,o),n,X.Parsed)),t.onDocumentRangeFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocumentRange(n,i,o),n,X.Parsed)),t.onDocumentOnTypeFormatting(createRequestHandler((t,n,i,o)=>(t.lsp?.Formatter)?.formatDocumentOnType(n,i,o),n,X.Parsed))}function addRenameHandler(t,n){t.onRenameRequest(createRequestHandler((t,n,i,o)=>(t.lsp?.RenameProvider)?.rename(n,i,o),n,X.IndexedReferences)),t.onPrepareRename(createRequestHandler((t,n,i,o)=>(t.lsp?.RenameProvider)?.prepareRename(n,i,o),n,X.IndexedReferences))}function addInlayHintHandler(t,n){t.languages.inlayHint.on(createServerRequestHandler((t,n,i,o)=>(t.lsp?.InlayHintProvider)?.getInlayHints(n,i,o),n,X.IndexedReferences))}function addSemanticTokenHandler(t,n){let i={data:[]};t.languages.semanticTokens.on(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlight(n,o,s):i,n,X.IndexedReferences)),t.languages.semanticTokens.onDelta(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlightDelta(n,o,s):i,n,X.IndexedReferences)),t.languages.semanticTokens.onRange(createServerRequestHandler((t,n,o,s)=>t.lsp?.SemanticTokenProvider?t.lsp.SemanticTokenProvider.semanticHighlightRange(n,o,s):i,n,X.IndexedReferences))}function addConfigurationChangeHandler(t,n){t.onDidChangeConfiguration(t=>{t.settings&&n.workspace.ConfigurationProvider.updateConfiguration(t)})}function addExecuteCommandHandler(t,n){let i=n.lsp.ExecuteCommandHandler;i&&t.onExecuteCommand(async(t,n)=>{try{return await i.executeCommand(t.command,t.arguments??[],n)}catch(t){return responseError(t)}})}function addDocumentLinkHandler(t,n){t.onDocumentLinks(createServerRequestHandler((t,n,i,o)=>(t.lsp?.DocumentLinkProvider)?.getDocumentLinks(n,i,o),n,X.Parsed))}function addSignatureHelpHandler(t,n){t.onSignatureHelp(createServerRequestHandler((t,n,i,o)=>(t.lsp?.SignatureHelp)?.provideSignatureHelp(n,i,o),n,X.IndexedReferences))}function addCodeLensHandler(t,n){t.onCodeLens(createServerRequestHandler((t,n,i,o)=>(t.lsp?.CodeLensProvider)?.provideCodeLens(n,i,o),n,X.IndexedReferences))}function addWorkspaceSymbolHandler(t,n){let i=n.lsp.WorkspaceSymbolProvider;if(i){let o=n.workspace.DocumentBuilder;t.onWorkspaceSymbol(async(t,n)=>{try{return await o.waitUntil(X.IndexedContent,n),await i.getSymbols(t,n)}catch(t){return responseError(t)}});let s=i.resolveSymbol?.bind(i);s&&t.onWorkspaceSymbolResolve(async(t,n)=>{try{return await o.waitUntil(X.IndexedContent,n),await s(t,n)}catch(t){return responseError(t)}})}}function addCallHierarchyHandler(t,n){t.languages.callHierarchy.onPrepare(createServerRequestHandler(async(t,n,i,o)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.prepareCallHierarchy(n,i,o)??null:null,n,X.IndexedReferences)),t.languages.callHierarchy.onIncomingCalls(createHierarchyRequestHandler(async(t,n,i)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.incomingCalls(n,i)??null:null,n)),t.languages.callHierarchy.onOutgoingCalls(createHierarchyRequestHandler(async(t,n,i)=>t.lsp?.CallHierarchyProvider?await t.lsp.CallHierarchyProvider.outgoingCalls(n,i)??null:null,n))}function addTypeHierarchyHandler(t,n){n.ServiceRegistry.all.some(t=>t.lsp?.TypeHierarchyProvider)&&(t.languages.typeHierarchy.onPrepare(createServerRequestHandler(async(t,n,i,o)=>await(t.lsp?.TypeHierarchyProvider)?.prepareTypeHierarchy(n,i,o)??null,n,X.IndexedReferences)),t.languages.typeHierarchy.onSupertypes(createHierarchyRequestHandler(async(t,n,i)=>await(t.lsp?.TypeHierarchyProvider)?.supertypes(n,i)??null,n)),t.languages.typeHierarchy.onSubtypes(createHierarchyRequestHandler(async(t,n,i)=>await(t.lsp?.TypeHierarchyProvider)?.subtypes(n,i)??null,n)))}function createHierarchyRequestHandler(t,n){let i=n.ServiceRegistry;return async(o,s)=>{let c=J.parse(o.item.uri),u=await waitUntilPhase(n,s,c,X.IndexedReferences);if(u)return u;if(!i.hasServices(c)){let t=`Could not find service instance for uri: '${c}'`;return console.debug(t),responseError(Error(t))}let f=i.getServices(c);try{return await t(f,o,s)}catch(t){return responseError(t)}}}function createServerRequestHandler(t,n,i){let o=n.workspace.LangiumDocuments,s=n.ServiceRegistry;return async(c,u)=>{let f=J.parse(c.textDocument.uri),p=await waitUntilPhase(n,u,f,i);if(p)return p;if(!s.hasServices(f)){let t=`Could not find service instance for uri: '${f}'`;return console.debug(t),responseError(Error(t))}let h=s.getServices(f);try{return await t(h,await o.getOrCreateDocument(f),c,u)}catch(t){return responseError(t)}}}function createRequestHandler(t,n,i){let o=n.workspace.LangiumDocuments,s=n.ServiceRegistry;return async(c,u)=>{let f=J.parse(c.textDocument.uri),p=await waitUntilPhase(n,u,f,i);if(p)return p;if(!s.hasServices(f))return console.debug(`Could not find service instance for uri: '${f.toString()}'`),null;let h=s.getServices(f);try{return await t(h,await o.getOrCreateDocument(f),c,u)}catch(t){return responseError(t)}}}async function waitUntilPhase(t,n,i,o){if(o!==void 0){let s=t.workspace.DocumentBuilder;try{await s.waitUntil(o,i,n)}catch(t){return responseError(t)}}}function responseError(t){if(isOperationCancelled(t))return new li.ResponseError(li.LSPErrorCodes.RequestCancelled,`The request has been cancelled.`);if(t instanceof li.ResponseError)return t;throw t}var DefaultNodeKindProvider=class{getSymbolKind(t){return $.SymbolKind.Field}getCompletionItemKind(t){return $.CompletionItemKind.Reference}},DefaultReferencesProvider=class{constructor(t){this.nameProvider=t.references.NameProvider,this.references=t.references.References,this.grammarConfig=t.parser.GrammarConfig}findReferences(t,n,i){let o=t.parseResult.value.$cstNode;if(!o)return[];let s=findDeclarationNodeAtOffset(o,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,t):[]}getReferences(t,n,i){let o=[],s=this.references.findDeclaration(t);if(s){let t={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,t).forEach(t=>{o.push($.Location.create(t.sourceUri.toString(),t.segment.range))})}return o}};vn();var DefaultRenameProvider=class{constructor(t){this.references=t.references.References,this.nameProvider=t.references.NameProvider,this.grammarConfig=t.parser.GrammarConfig}async rename(t,n,i){let o={},s=t.parseResult.value.$cstNode;if(!s)return;let c=findDeclarationNodeAtOffset(s,t.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!c)return;let u=this.references.findDeclaration(c);if(u)return this.references.findReferences(u,{onlyLocal:!1,includeDeclaration:!0}).forEach(t=>{let i=dt.replace(t.segment.range,n.newName),s=t.sourceUri.toString();o[s]?o[s].push(i):o[s]=[i]}),{changes:o}}prepareRename(t,n,i){return this.renameNodeRange(t,n.position)}renameNodeRange(t,n){let i=t.parseResult.value.$cstNode,o=t.textDocument.offsetAt(n);if(i&&o){let t=findDeclarationNodeAtOffset(i,o,this.grammarConfig.nameRegexp);if(!t)return;if(this.references.findDeclaration(t)||this.isNameNode(t))return t.range}}isNameNode(t){return t?.astNode&&isNamed(t.astNode)&&t===this.nameProvider.getNameNode(t.astNode)}},DefaultWorkspaceSymbolProvider=class{constructor(t){this.indexManager=t.workspace.IndexManager,this.nodeKindProvider=t.lsp.NodeKindProvider,this.fuzzyMatcher=t.lsp.FuzzyMatcher}async getSymbols(t,n=q.CancellationToken.None){let i=[],o=t.query.toLowerCase();for(let t of this.indexManager.allElements())if(await interruptAndCheck(n),this.fuzzyMatcher.match(o,t.name)){let n=this.getWorkspaceSymbol(t);n&&i.push(n)}return i}getWorkspaceSymbol(t){let n=t.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(t),name:t.name,location:{range:n.range,uri:t.documentUri.toString()}}}},NormalizedTextDocuments=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new $.Emitter,this._onDidOpen=new $.Emitter,this._onDidClose=new $.Emitter,this._onDidSave=new $.Emitter,this._onWillSave=new $.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(Y.normalize(t))}set(t){let n=Y.normalize(t.uri),i=!0;this._syncedDocuments.has(n)&&(i=!1),this._syncedDocuments.set(n,t);let o=Object.freeze({document:t});return this._onDidOpen.fire(o),this._onDidChangeContent.fire(o),i}delete(t){let n=Y.normalize(typeof t==`object`&&`uri`in t?t.uri:t),i=this._syncedDocuments.get(n);i!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:i})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=$.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(t=>{let n=t.textDocument,i=Y.normalize(n.uri),o=this._configuration.create(i,n.languageId,n.version,n.text);this._syncedDocuments.set(i,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(t=>{let n=t.textDocument,i=t.contentChanges;if(i.length===0)return;let{version:o}=n;if(o==null)throw Error(`Received document change event for ${n.uri} without valid version identifier`);let s=Y.normalize(n.uri),c=this._syncedDocuments.get(s);c!==void 0&&(c=this._configuration.update(c,i,o),this._syncedDocuments.set(s,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(t.onDidCloseTextDocument(t=>{let n=Y.normalize(t.textDocument.uri),i=this._syncedDocuments.get(n);i!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(t.onWillSaveTextDocument(t=>{let n=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));n!==void 0&&this._onWillSave.fire(Object.freeze({document:n,reason:t.reason}))})),n.push(t.onWillSaveTextDocumentWaitUntil((t,n)=>{let i=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:t.reason}),n):[]})),n.push(t.onDidSaveTextDocument(t=>{let n=this._syncedDocuments.get(Y.normalize(t.textDocument.uri));n!==void 0&&this._onDidSave.fire(Object.freeze({document:n}))})),$.Disposable.create(()=>{n.forEach(t=>t.dispose())})}},NormalizedNotebookDocuments=class{constructor(t){this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new $.Emitter,this._onDidSave=new $.Emitter,this._onDidChange=new $.Emitter,this._onDidClose=new $.Emitter,`listen`in t?this._cellTextDocuments=t:this._cellTextDocuments=new NormalizedTextDocuments(t)}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(Y.normalize(t))}getNotebookCell(t){let n=this.notebookCellMap.get(Y.normalize(t));return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t==`string`||`scheme`in t?t:t.document,i=this.notebookCellMap.get(Y.normalize(n));return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let n=new pi,i=[];return i.push(this.cellTextDocuments.listen(n)),i.push(t.notebooks.synchronization.onDidOpenNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri);this.notebookDocuments.set(i,t.notebookDocument);for(let i of t.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(t.notebookDocument),this._onDidOpen.fire(t.notebookDocument)})),i.push(t.notebooks.synchronization.onDidChangeNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri),o=this.notebookDocuments.get(i);if(o===void 0)return;o.version=t.notebookDocument.version;let s=o.metadata,c=!1,u=t.change;u.metadata!==void 0&&(c=!0,o.metadata=u.metadata);let f=[],p=[],h=[],g=[];if(u.cells!==void 0){let t=u.cells;if(t.structure!==void 0){let i=t.structure.array;if(o.cells.splice(i.start,i.deleteCount,...i.cells===void 0?[]:i.cells),t.structure.didOpen!==void 0)for(let i of t.structure.didOpen)n.openTextDocument({textDocument:i}),f.push(i.uri);if(t.structure.didClose)for(let i of t.structure.didClose)n.closeTextDocument({textDocument:i}),p.push(i.uri)}if(t.data!==void 0){let n=new Map(t.data.map(t=>[t.document,t]));for(let t=0;t<=o.cells.length;t++){let i=n.get(o.cells[t].document);if(i!==void 0){let s=o.cells.splice(t,1,i);if(h.push({old:s[0],new:i}),n.delete(i.document),n.size===0)break}}}if(t.textContent!==void 0)for(let i of t.textContent)n.changeTextDocument({textDocument:i.document,contentChanges:i.changes}),g.push(i.document.uri)}this.updateCellMap(o);let _={notebookDocument:o};c&&(_.metadata={old:s,new:o.metadata});let x=[];for(let t of f)x.push(this.getNotebookCell(t));let S=[];for(let t of p)S.push(this.getNotebookCell(t));let T=[];for(let t of g)T.push(this.getNotebookCell(t));(x.length>0||S.length>0||h.length>0||T.length>0)&&(_.cells={added:x,removed:S,changed:{data:h,textContent:T}}),(_.metadata!==void 0||_.cells!==void 0)&&this._onDidChange.fire(_)})),i.push(t.notebooks.synchronization.onDidSaveNotebookDocument(t=>{let n=this.getNotebookDocument(t.notebookDocument.uri);n!==void 0&&this._onDidSave.fire(n)})),i.push(t.notebooks.synchronization.onDidCloseNotebookDocument(t=>{let i=Y.normalize(t.notebookDocument.uri),o=this.notebookDocuments.get(i);if(o!==void 0){this._onDidClose.fire(o);for(let i of t.cellTextDocuments)n.closeTextDocument({textDocument:i});this.notebookDocuments.delete(i);for(let t of o.cells)this.notebookCellMap.delete(t.document)}})),$.Disposable.create(()=>{i.forEach(t=>t.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}},pi=class CellTextDocumentConnection{onDidOpenTextDocument(t){return this.openHandler=t,$.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,$.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,$.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return CellTextDocumentConnection.NULL_DISPOSE}onDidSaveTextDocument(){return CellTextDocumentConnection.NULL_DISPOSE}};pi.NULL_DISPOSE=Object.freeze({dispose:()=>{}});function createDefaultModule(t){return Wn.merge(createDefaultCoreModule(t),createDefaultLSPModule(t))}function createDefaultLSPModule(t){return{lsp:{CompletionProvider:t=>new DefaultCompletionProvider(t),DocumentSymbolProvider:t=>new DefaultDocumentSymbolProvider(t),HoverProvider:t=>new MultilineCommentHoverProvider(t),FoldingRangeProvider:t=>new DefaultFoldingRangeProvider(t),ReferencesProvider:t=>new DefaultReferencesProvider(t),DefinitionProvider:t=>new DefaultDefinitionProvider(t),DocumentHighlightProvider:t=>new DefaultDocumentHighlightProvider(t),RenameProvider:t=>new DefaultRenameProvider(t)},shared:()=>t.shared}}function createDefaultSharedModule(t){return Wn.merge(createDefaultSharedCoreModule(t),createDefaultSharedLSPModule(t))}function createDefaultSharedLSPModule(t){return{lsp:{Connection:()=>t.connection,LanguageServer:t=>new DefaultLanguageServer(t),DocumentUpdateHandler:t=>new DefaultDocumentUpdateHandler(t),WorkspaceSymbolProvider:t=>new DefaultWorkspaceSymbolProvider(t),NodeKindProvider:()=>new DefaultNodeKindProvider,FuzzyMatcher:()=>new DefaultFuzzyMatcher},workspace:{TextDocuments:()=>new NormalizedTextDocuments(An),NotebookDocuments:t=>new NormalizedNotebookDocuments(t.workspace.TextDocuments)}}}var AbstractFormatter=class{constructor(){this.collector=()=>{}}getNodeFormatter(t){return new DefaultNodeFormatter(t,this.collector)}formatDocument(t,n){let i=t.parseResult;return i.lexerErrors.length===0&&i.parserErrors.length===0?this.doDocumentFormat(t,n.options):[]}isFormatRangeErrorFree(t,n){let i=t.parseResult;return i.lexerErrors.length||i.parserErrors.length?Math.min(...i.lexerErrors.map(t=>t.line??Number.MAX_VALUE),...i.parserErrors.map(t=>t.token.startLine??Number.MAX_VALUE))>n.end.line:!0}formatDocumentRange(t,n){return this.isFormatRangeErrorFree(t,n.range)?this.doDocumentFormat(t,n.options,n.range):[]}formatDocumentOnType(t,n){let i={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(t,i)?this.doDocumentFormat(t,n.options,i):[]}get formatOnTypeOptions(){}doDocumentFormat(t,n,i){let o=new Map,collector=(t,n,i)=>{let s=this.nodeModeToKey(t,n),c=o.get(s),u=i.options.priority??0,f=c?.options.priority??0;(!c||f<=u)&&o.set(s,i)};this.collector=collector,this.iterateAstFormatting(t,i);let s=this.iterateCstFormatting(t,o,n,i);return this.avoidOverlappingEdits(t.textDocument,s)}avoidOverlappingEdits(t,n){let i=[];for(let o of n){let n=i[i.length-1];for(;n&&t.offsetAt(o.range.start)<t.offsetAt(n.range.end);)i.pop(),n=i[i.length-1];i.push(o)}return i.filter(n=>this.isNecessary(n,t))}iterateAstFormatting(t,n){let i=t.parseResult.value;this.format(i);let o=streamAllContents(i).iterator(),s;do if(s=o.next(),!s.done){let t=s.value;this.insideRange(t.$cstNode.range,n)?this.format(t):o.prune()}while(!s.done)}nodeModeToKey(t,n){return`${t.offset}:${t.end}:${n}`}insideRange(t,n){return!n||t.start.line<=n.start.line&&t.end.line>=n.end.line||t.start.line>=n.start.line&&t.end.line<=n.end.line||t.start.line<=n.end.line&&t.end.line>=n.end.line}isNecessary(t,n){return t.newText!==n.getText(t.range).replace(/\r/g,``)}iterateCstFormatting(t,n,i,o){let s={indentation:0,options:i,document:t.textDocument},c=[],u=this.iterateCstTree(t,s).iterator(),f,p;do if(p=u.next(),!p.done){let t=p.value,i=isLeafCstNode(t),u=this.nodeModeToKey(t,`prepend`),h=n.get(u);if(n.delete(u),h){let n=this.createTextEdit(f,t,h,s);for(let t of n)t&&this.insideRange(t.range,o)&&c.push(t)}let g=this.nodeModeToKey(t,`append`),_=n.get(g);if(n.delete(g),_){let n=getNextNode(t);if(n){let i=this.createTextEdit(t,n,_,s);for(let t of i)t&&this.insideRange(t.range,o)&&c.push(t)}}if(!h&&t.hidden){let n=this.createHiddenTextEdits(f,t,void 0,s);for(let t of n)t&&this.insideRange(t.range,o)&&c.push(t)}i&&(f=t)}while(!p.done);return c}createHiddenTextEdits(t,n,i,o){let s=n.range.start.line;if(t&&t.range.end.line===s)return[];let c=[],u={start:{character:0,line:s},end:n.range.start},f=o.document.getText(u),p=this.findFittingMove(u,i?.moves??[],o),h=this.getExistingIndentationCharacterCount(f,o),g=this.getIndentationCharacterCount(o,p)-h;if(g===0)return[];let _=``;g>0&&(_=(o.options.insertSpaces?` `:` `).repeat(g));let x=n.text.split(`
|
|
27
27
|
`);x[0]=f+x[0];for(let t=0;t<x.length;t++){let n=s+t,i={character:0,line:n};if(g>0)c.push({newText:_,range:{start:i,end:i}});else{let o=x[t],s=0;for(;s<o.length;s++){let t=o.charAt(s);if(t!==` `&&t!==` `)break}c.push({newText:``,range:{start:i,end:{line:n,character:Math.min(s,Math.abs(g))}}})}}return c}getExistingIndentationCharacterCount(t,n){let i=` `.repeat(n.options.tabSize);return(n.options.insertSpaces?t.replaceAll(` `,i):t.replaceAll(i,` `)).length}getIndentationCharacterCount(t,n){let i=t.indentation;return n&&n.tabs&&(i+=n.tabs),(t.options.insertSpaces?t.options.tabSize:1)*i}createTextEdit(t,n,i,o){if(n.hidden)return this.createHiddenTextEdits(t,n,i,o);if(t&&(t.range.end.line>n.range.start.line||t.range.end.line===n.range.start.line&&t.range.end.character>n.range.start.character))return[];let s={start:t?.range.end??{character:0,line:0},end:n.range.start},c=this.findFittingMove(s,i.moves,o);if(!c)return[];let u=c.characters,f=c.lines,p=c.tabs,h=o.indentation;o.indentation+=p??0;let g=[];return u===void 0?f===void 0?p!==void 0&&g.push(this.createTabTextEdit(s,!!t,o)):g.push(this.createLineTextEdit(s,f,o,i.options)):t?.hidden||g.push(this.createSpaceTextEdit(s,u,i.options)),isLeafCstNode(n)&&(o.indentation=h),g}createSpaceTextEdit(t,n,i){if(t.start.line===t.end.line){let o=t.end.character-t.start.character;n=this.fitIntoOptions(n,o,i)}return{newText:` `.repeat(n),range:t}}createLineTextEdit(t,n,i,o){let s=t.end.line-t.start.line;n=this.fitIntoOptions(n,s,o);let c=(i.options.insertSpaces?` `.repeat(i.options.tabSize):` `).repeat(i.indentation);return{newText:`${`
|
|
28
28
|
`.repeat(n)}${c}`,range:t}}createTabTextEdit(t,n,i){let o=(i.options.insertSpaces?` `.repeat(i.options.tabSize):` `).repeat(i.indentation),s=+!!n,c=Math.max(t.end.line-t.start.line,s);return{newText:`${`
|
|
29
29
|
`.repeat(c)}${o}`,range:t}}fitIntoOptions(t,n,i){return i.allowMore?t=Math.max(n,t):i.allowLess&&(t=Math.min(n,t)),t}findFittingMove(t,n,i){if(n.length===0)return;if(n.length===1)return n[0];let o=t.end.line-t.start.line;for(let t of n)if(t.lines!==void 0&&o<=t.lines)return t;else if(t.lines===void 0&&o===0)return t;return n[n.length-1]}iterateCstTree(t,n){let i=t.parseResult.value.$cstNode;return i?new TreeStreamImpl(i,t=>this.iterateCst(t,n)):A}iterateCst(t,n){if(!isCompositeCstNode(t))return A;let i=n.indentation;return new k(()=>({index:0}),o=>o.index<t.content.length?{done:!1,value:t.content[o.index++]}:(n.indentation=i,j))}},DefaultNodeFormatter=class{constructor(t,n){this.astNode=t,this.collector=n}node(t){return new mi(t.$cstNode?[t.$cstNode]:[],this.collector)}nodes(...t){let n=[];for(let i of t)i.$cstNode&&n.push(i.$cstNode);return new mi(n,this.collector)}property(t,n){let i=findNodeForProperty(this.astNode.$cstNode,t,n);return new mi(i?[i]:[],this.collector)}properties(...t){let n=[];for(let i of t){let t=findNodesForProperty(this.astNode.$cstNode,i);n.push(...t)}return new mi(n,this.collector)}keyword(t,n){let i=findNodeForKeyword(this.astNode.$cstNode,t,n);return new mi(i?[i]:[],this.collector)}keywords(...t){let n=[];for(let i of t){let t=findNodesForKeyword(this.astNode.$cstNode,i);n.push(...t)}return new mi(n,this.collector)}cst(t){return new mi([...t],this.collector)}interior(t,n){let i=t.nodes,o=n.nodes;if(i.length!==1||o.length!==1)return new mi([],this.collector);let s=i[0],c=o[0];if(s.offset>c.offset){let t=s;s=c,c=t}return new mi(getInteriorNodes(s,c),this.collector)}},mi=class FormattingRegion{constructor(t,n){this.nodes=t,this.collector=n}prepend(t){for(let n of this.nodes)this.collector(n,`prepend`,t);return this}append(t){for(let n of this.nodes)this.collector(n,`append`,t);return this}surround(t){for(let n of this.nodes)this.collector(n,`prepend`,t),this.collector(n,`append`,t);return this}slice(t,n){return new FormattingRegion(this.nodes.slice(t,n),this.collector)}},hi;(function(t){function fit(...t){return{options:{},moves:t.flatMap(t=>t.moves).sort(compareMoves)}}t.fit=fit;function noSpace(t){return spaces(0,t)}t.noSpace=noSpace;function oneSpace(t){return spaces(1,t)}t.oneSpace=oneSpace;function spaces(t,n){return{options:n??{},moves:[{characters:t}]}}t.spaces=spaces;function newLine(t){return newLines(1,t)}t.newLine=newLine;function newLines(t,n){return{options:n??{},moves:[{lines:t}]}}t.newLines=newLines;function indent(t){return{options:t??{},moves:[{tabs:1,lines:1}]}}t.indent=indent;function noIndent(t){return{options:t??{},moves:[{tabs:0}]}}t.noIndent=noIndent;function compareMoves(t,n){let i=t.lines??0,o=n.lines??0,s=t.tabs??0,c=n.tabs??0,u=t.characters??0,f=n.characters??0;return i<o?-1:i>o?1:s<c?-1:s>c?1:u<f?-1:+(u>f)}})(hi||={});var NodeFileSystemProvider=class{constructor(){this.encoding=`utf-8`}readFile(t){return O.promises.readFile(t.fsPath,this.encoding)}async readDirectory(t){return(await O.promises.readdir(t.fsPath,{withFileTypes:!0})).map(n=>({dirent:n,isFile:n.isFile(),isDirectory:n.isDirectory(),uri:Y.joinPath(t,n.name)}))}};function getSourceRegion(t){if(t){if(`astNode`in t)return getSourceRegionOfAstNode(t);if(Array.isArray(t))return t.reduce(mergeDocumentSegment,void 0);{let n=t;return copyDocumentSegment(n,isCstNode(n)?getDocumentURIOrUndefined(n?.root?.astNode??n?.astNode):void 0)}}}function isCstNode(t){return t!==void 0&&`element`in t&&`text`in t}function getDocumentURIOrUndefined(t){try{return getDocument(t).uri.toString()}catch{return}}function getSourceRegionOfAstNode(t){let{astNode:n,property:i,index:o}=t??{},s=n?.$cstNode??n?.$textRegion;if(!(n===void 0||s===void 0)){if(i===void 0)return copyDocumentSegment(s,getDocumentURI(n));{let getSingleOrCompoundRegion=t=>o!==void 0&&o>-1&&Array.isArray(n[i])?o<t.length?t[o]:void 0:t.reduce(mergeDocumentSegment,void 0);if(s.assignments?.[i]){let t=getSingleOrCompoundRegion(s.assignments[i]);return t&©DocumentSegment(t,getDocumentURI(n))}else if(n.$cstNode){let t=getSingleOrCompoundRegion(findNodesForProperty(n.$cstNode,i));return t&©DocumentSegment(t,getDocumentURI(n))}else return}}}function getDocumentURI(t){if(t.$cstNode)return(getDocument(t)?.uri)?.toString();if(t.$textRegion)return t.$textRegion.documentURI||new TreeStreamImpl(t,t=>t.$container?[t.$container]:[]).find(t=>t.$textRegion?.documentURI)?.$textRegion?.documentURI}function copyDocumentSegment(t,n){let i={offset:t.offset,end:t.end??t.offset+t.length,length:t.length??t.end-t.offset};return t.range&&(i.range=t.range),n??=t.fileURI,n&&(i.fileURI=n),i}function mergeDocumentSegment(t,n){if(!t)return n&©DocumentSegment(n);if(!n)return t&©DocumentSegment(t);let i=t.end??t.offset+t.length,o=n.end??n.offset+n.length,s=Math.min(t.offset,n.offset),c=Math.max(i,o),u={offset:s,end:c,length:c-s};if(t.range&&n.range&&(u.range={start:n.range.start.line<t.range.start.line||n.range.start.line===t.range.start.line&&n.range.start.character<t.range.start.character?n.range.start:t.range.start,end:n.range.end.line>t.range.end.line||n.range.end.line===t.range.end.line&&n.range.end.character>t.range.end.character?n.range.end:t.range.end}),t.fileURI||n.fileURI){let i=t.fileURI,o=n.fileURI;u.fileURI=i&&o&&i!==o?`<unmergable text regions of ${i}, ${o}>`:i??o}return u}var Context=class{constructor(t){this.defaultIndentation=` `,this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof t==`string`?this.defaultIndentation=t:typeof t==`number`&&(this.defaultIndentation=``.padStart(t))}get content(){return this.lines.map(t=>t.join(``)).join(``)}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join(``)}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(t,n){if(t.length>0){let i=n&&this.currentPosition;this.lines[this.currentLineNumber].push(t),this.length+=t.length,i&&this.indentPendingTraceRegions(i)}}indentPendingTraceRegions(t){for(let n=this.traceData.length-1;n>=0;n--){let i=this.traceData[n];i.targetStart&&i.targetStart.offset===t.offset&&(i.targetStart=this.currentPosition)}}increaseIndent(t){this.currentIndents.push(t),t.indentImmediately||this.recentNonImmediateIndents.push(t)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(t=>!this.recentNonImmediateIndents.includes(t))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join(``).length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0,this.recentNonImmediateIndents.length=0}addNewLine(){this.lines.push([]),this.pendingIndent=!0,this.recentNonImmediateIndents.length=0}pushTraceRegion(t){let n=createTraceRegion(t,this.currentPosition,t=>(this.traceData[this.traceData.length-1]?.children)?.push(t));return this.traceData.push(n),n}popTraceRegion(t){let n=this.traceData.pop();return this.assertTrue(n===t,`Trace region mismatch!`),n}getParentTraceSourceFileURI(){for(let t=this.traceData.length-1;t>-1;t--){let n=this.traceData[t].sourceRegion?.fileURI;if(n)return n}}assertTrue(t,n){if(!t)throw Error(n)}};function createTraceRegion(t,n,i){let o={sourceRegion:t,targetRegion:void 0,children:[],targetStart:n,complete:t=>(o.targetRegion={offset:o.targetStart.offset,end:t.offset,length:t.offset-o.targetStart.offset,range:{start:{line:o.targetStart.line,character:o.targetStart.character},end:{line:t.line,character:t.character}}},delete o.targetStart,o.children?.length===0&&delete o.children,o.targetRegion?.length&&i(o),delete o.complete,o)};return o}function processGeneratorNode(t,n){let i=new Context(n),o=i.pushTraceRegion(void 0);processNodeInternal(t,i),i.popTraceRegion(o),o.complete&&o.complete(i.currentPosition);let s=o.children&&o.children.length===1?o.children[0]:void 0,c=s?.targetRegion,u=o.targetRegion;return c&&s.sourceRegion&&c.offset===u.offset&&c.length===u.length?{text:i.content,trace:s}:{text:i.content,trace:o}}function processNodeInternal(t,n){typeof t==`string`?processStringNode(t,n):t instanceof IndentNode?processIndentNode(t,n):t instanceof bi?processCompositeNode(t,n):t instanceof NewLineNode&&processNewLineNode(t,n)}function hasContent(t,n){return typeof t==`string`?t.length!==0:t instanceof bi?t.contents.some(t=>hasContent(t,n)):t instanceof NewLineNode?!(t.ifNotEmpty&&n.currentLineContent.length===0):!1}function processStringNode(t,n){t&&(handlePendingIndent(n,!1),n.append(t))}function handlePendingIndent(t,n){if(t.pendingIndent){let i=``;for(let o of t.relevantIndents.filter(t=>t.indentEmptyLines||!n))i+=o.indentation??t.defaultIndentation;t.append(i,!0),t.pendingIndent=!1}}function processCompositeNode(t,n){let i,o=getSourceRegion(t.tracedSource);o&&(i=n.pushTraceRegion(o));for(let i of t.contents)processNodeInternal(i,n);if(i){n.popTraceRegion(i);let t=n.getParentTraceSourceFileURI();t&&o?.fileURI===t&&delete o.fileURI,i.complete&&i.complete(n.currentPosition)}}function processIndentNode(t,n){if(hasContent(t,n)){t.indentImmediately&&!n.pendingIndent&&n.append(t.indentation??n.defaultIndentation,!0);try{n.increaseIndent(t),processCompositeNode(t,n)}finally{n.decreaseIndent()}}}function processNewLineNode(t,n){t.ifNotEmpty&&!hasNonWhitespace(n.currentLineContent)?n.resetCurrentLine():(handlePendingIndent(n,!0),n.append(t.lineDelimiter),n.addNewLine())}function hasNonWhitespace(t){return t.trimStart()!==``}Object.freeze(`__«SKIP^NEW^LINE^IF^EMPTY»__`);const gi=/\S|$/;function findIndentation(t){let n=t.filter(t=>t.length>0).map(t=>t.search(gi)),i=n.length===0?0:Math.min(...n);return Math.max(0,i)}function expandToNode(t,...n){return composeFinalGeneratorNode(splitTemplateLinesAndMergeWithSubstitutions(t,n,findIndentationAndTemplateStructure(t)))}function expandTracedToNode(t,n,i){return(o,...s)=>traceToNode(t,n,i)(expandToNode(o,...s))}function findIndentationAndTemplateStructure(t){let n=t.join(`_`).split(Ve),i=n.length>1&&n[0].trim().length===0,o=i&&n.length>1&&n[n.length-1].trim().length===0;if(n.length===1||n.length!==0&&n[0].trim().length!==0||n.length===2&&n[1].trim().length===0)return{indentation:0,omitFirstLine:i,omitLastLine:o,trimLastLine:n.length!==1&&n[n.length-1].trim().length===0};{let t=i?n.slice(1):n;t=o?t.slice(0,t.length-1):t,t=t.filter(t=>t.length!==0);let s=findIndentation(t);return{indentation:s,omitFirstLine:i,omitLastLine:o&&(n[n.length-1].length<s||!n[n.length-1].startsWith(t[0].substring(0,s)))}}}function splitTemplateLinesAndMergeWithSubstitutions(t,n,{indentation:i,omitFirstLine:o,omitLastLine:s,trimLastLine:c}){let u=[];t.forEach((t,s)=>{u.push(...t.split(Ve).map((t,n)=>n===0||t.length<i?t:t.substring(i)).reduce(s===0?(t,n,i)=>i===0?o?[]:[n]:i===1&&t.length===0?[n]:t.concat(_i,n):(t,n,i)=>i===0?[n]:t.concat(_i,n),[]).filter(t=>!(typeof t==`string`&&t.length===0)).concat(isGeneratorNode(n[s])?n[s]:n[s]===void 0?s<n.length?vi:[]:{content:String(n[s])}))});let f=u.length,p=f===0?void 0:u[f-1];return(s||c)&&typeof p==`string`&&p.trim().length===0?o&&f!==1&&u[f-2]===_i?u.slice(0,f-2):u.slice(0,f-1):u}const _i={isNewLine:!0},vi={isUndefinedSegment:!0},isNewLineMarker=t=>t===_i,isUndefinedSegmentMarker=t=>t===vi,isSubstitutionWrapper=t=>t.content!==void 0;function composeFinalGeneratorNode(t){return t.reduce((n,i,o)=>isUndefinedSegmentMarker(i)?n:isNewLineMarker(i)?{node:o!==0&&(isUndefinedSegmentMarker(t[o-1])||isGeneratorNode(t[o-1]))||o>1&&typeof t[o-1]==`string`&&(isUndefinedSegmentMarker(t[o-2])||isGeneratorNode(t[o-2]))?n.node.appendNewLineIfNotEmpty():n.node.appendNewLine()}:(()=>{let s=(o===0||isNewLineMarker(t[o-1]))&&typeof i==`string`&&i.length!==0?``.padStart(i.length-i.trimStart().length):``,c=isSubstitutionWrapper(i)?i.content:i,u;return{node:n.indented?n.node:s.length===0?n.node.append(c):n.node.indent({indentation:s,indentImmediately:!1,indentedChildren:t=>u=t.append(c)}),indented:u??n.indented?.append(c)}})(),{node:new bi}).node}const yi=typeof process>`u`?`
|