mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
159 lines
504 KiB
JavaScript
159 lines
504 KiB
JavaScript
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./chunk-VELTKBKT-MF1JIm2u.js";import{R as s,T as c,m as l,y as u}from"./chunk-JIN56HTB-CgNZbRDp.js";import{n as d}from"./chunk-QU3B7NT4-Cw7PUtsg.js";import{A as f,C as p,D as m,H as h,I as g,K as _,L as ee,M as v,P as y,T as b,U as te,V as x,W as S,_ as C,b as ne,f as w,h as T,j as E,k as D,l as O,m as re,n as k,o as A,p as j,q as M,r as ie,s as ae,t as oe,u as N,w as P,x as F,y as I,z as se}from"./chunk-H3VCZNTA-BFf2tOHH.js";var ce={};t(ce,{AnnotatedTextEdit:()=>Oe,ChangeAnnotation:()=>De,ChangeAnnotationIdentifier:()=>z,CodeAction:()=>dt,CodeActionContext:()=>ut,CodeActionKind:()=>ct,CodeActionTriggerKind:()=>lt,CodeDescription:()=>Ce,CodeLens:()=>ft,Color:()=>he,ColorInformation:()=>ge,ColorPresentation:()=>_e,Command:()=>Te,CompletionItem:()=>Ye,CompletionItemKind:()=>Ue,CompletionItemLabelDetails:()=>Je,CompletionItemTag:()=>Ge,CompletionList:()=>Xe,CreateFile:()=>Ae,DeleteFile:()=>Me,Diagnostic:()=>we,DiagnosticRelatedInformation:()=>be,DiagnosticSeverity:()=>xe,DiagnosticTag:()=>Se,DocumentHighlight:()=>nt,DocumentHighlightKind:()=>tt,DocumentLink:()=>mt,DocumentSymbol:()=>st,DocumentUri:()=>le,EOL:()=>Nt,FoldingRange:()=>ye,FoldingRangeKind:()=>ve,FormattingOptions:()=>pt,Hover:()=>Qe,InlayHint:()=>Tt,InlayHintKind:()=>Ct,InlayHintLabelPart:()=>wt,InlineCompletionContext:()=>jt,InlineCompletionItem:()=>Dt,InlineCompletionList:()=>Ot,InlineCompletionTriggerKind:()=>kt,InlineValueContext:()=>St,InlineValueEvaluatableExpression:()=>xt,InlineValueText:()=>yt,InlineValueVariableLookup:()=>bt,InsertReplaceEdit:()=>Ke,InsertTextFormat:()=>We,InsertTextMode:()=>qe,Location:()=>pe,LocationLink:()=>me,MarkedString:()=>Ze,MarkupContent:()=>He,MarkupKind:()=>Ve,OptionalVersionedTextDocumentIdentifier:()=>ze,ParameterInformation:()=>$e,Position:()=>L,Range:()=>R,RenameFile:()=>je,SelectedCompletionInfo:()=>At,SelectionRange:()=>ht,SemanticTokenModifiers:()=>_t,SemanticTokenTypes:()=>gt,SemanticTokens:()=>vt,SignatureInformation:()=>et,StringValue:()=>Et,SymbolInformation:()=>at,SymbolKind:()=>rt,SymbolTag:()=>it,TextDocument:()=>Pt,TextDocumentEdit:()=>ke,TextDocumentIdentifier:()=>Le,TextDocumentItem:()=>Be,TextEdit:()=>Ee,URI:()=>ue,VersionedTextDocumentIdentifier:()=>Re,WorkspaceChange:()=>Ie,WorkspaceEdit:()=>Ne,WorkspaceFolder:()=>Mt,WorkspaceSymbol:()=>ot,integer:()=>de,uinteger:()=>fe});var le,ue,de,fe,L,R,pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,z,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,B,It=n(()=>{(function(e){function t(e){return typeof e==`string`}o(t,`is`),e.is=t})(le||={}),(function(e){function t(e){return typeof e==`string`}o(t,`is`),e.is=t})(ue||={}),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}o(t,`is`),e.is=t})(de||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}o(t,`is`),e.is=t})(fe||={}),(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=fe.MAX_VALUE),t===Number.MAX_VALUE&&(t=fe.MAX_VALUE),{line:e,character:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&B.uinteger(t.line)&&B.uinteger(t.character)}o(n,`is`),e.is=n})(L||={}),(function(e){function t(e,t,n,r){if(B.uinteger(e)&&B.uinteger(t)&&B.uinteger(n)&&B.uinteger(r))return{start:L.create(e,t),end:L.create(n,r)};if(L.is(e)&&L.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&L.is(t.start)&&L.is(t.end)}o(n,`is`),e.is=n})(R||={}),(function(e){function t(e,t){return{uri:e,range:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&R.is(t.range)&&(B.string(t.uri)||B.undefined(t.uri))}o(n,`is`),e.is=n})(pe||={}),(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&R.is(t.targetRange)&&B.string(t.targetUri)&&R.is(t.targetSelectionRange)&&(R.is(t.originSelectionRange)||B.undefined(t.originSelectionRange))}o(n,`is`),e.is=n})(me||={}),(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&B.numberRange(t.red,0,1)&&B.numberRange(t.green,0,1)&&B.numberRange(t.blue,0,1)&&B.numberRange(t.alpha,0,1)}o(n,`is`),e.is=n})(he||={}),(function(e){function t(e,t){return{range:e,color:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&R.is(t.range)&&he.is(t.color)}o(n,`is`),e.is=n})(ge||={}),(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&B.string(t.label)&&(B.undefined(t.textEdit)||Ee.is(t))&&(B.undefined(t.additionalTextEdits)||B.typedArray(t.additionalTextEdits,Ee.is))}o(n,`is`),e.is=n})(_e||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(ve||={}),(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return B.defined(n)&&(o.startCharacter=n),B.defined(r)&&(o.endCharacter=r),B.defined(i)&&(o.kind=i),B.defined(a)&&(o.collapsedText=a),o}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&B.uinteger(t.startLine)&&B.uinteger(t.startLine)&&(B.undefined(t.startCharacter)||B.uinteger(t.startCharacter))&&(B.undefined(t.endCharacter)||B.uinteger(t.endCharacter))&&(B.undefined(t.kind)||B.string(t.kind))}o(n,`is`),e.is=n})(ye||={}),(function(e){function t(e,t){return{location:e,message:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&pe.is(t.location)&&B.string(t.message)}o(n,`is`),e.is=n})(be||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(xe||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(Se||={}),(function(e){function t(e){let t=e;return B.objectLiteral(t)&&B.string(t.href)}o(t,`is`),e.is=t})(Ce||={}),(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return B.defined(n)&&(o.severity=n),B.defined(r)&&(o.code=r),B.defined(i)&&(o.source=i),B.defined(a)&&(o.relatedInformation=a),o}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&R.is(t.range)&&B.string(t.message)&&(B.number(t.severity)||B.undefined(t.severity))&&(B.integer(t.code)||B.string(t.code)||B.undefined(t.code))&&(B.undefined(t.codeDescription)||B.string(t.codeDescription?.href))&&(B.string(t.source)||B.undefined(t.source))&&(B.undefined(t.relatedInformation)||B.typedArray(t.relatedInformation,be.is))}o(n,`is`),e.is=n})(we||={}),(function(e){function t(e,t,...n){let r={title:e,command:t};return B.defined(n)&&n.length>0&&(r.arguments=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.string(t.title)&&B.string(t.command)}o(n,`is`),e.is=n})(Te||={}),(function(e){function t(e,t){return{range:e,newText:t}}o(t,`replace`),e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}o(n,`insert`),e.insert=n;function r(e){return{range:e,newText:``}}o(r,`del`),e.del=r;function i(e){let t=e;return B.objectLiteral(t)&&B.string(t.newText)&&R.is(t.range)}o(i,`is`),e.is=i})(Ee||={}),(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&B.string(t.label)&&(B.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(B.string(t.description)||t.description===void 0)}o(n,`is`),e.is=n})(De||={}),(function(e){function t(e){let t=e;return B.string(t)}o(t,`is`),e.is=t})(z||={}),(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}o(t,`replace`),e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}o(n,`insert`),e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}o(r,`del`),e.del=r;function i(e){let t=e;return Ee.is(t)&&(De.is(t.annotationId)||z.is(t.annotationId))}o(i,`is`),e.is=i})(Oe||={}),(function(e){function t(e,t){return{textDocument:e,edits:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&ze.is(t.textDocument)&&Array.isArray(t.edits)}o(n,`is`),e.is=n})(ke||={}),(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&B.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||B.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||B.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||z.is(t.annotationId))}o(n,`is`),e.is=n})(Ae||={}),(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}o(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&B.string(t.oldUri)&&B.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||B.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||B.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||z.is(t.annotationId))}o(n,`is`),e.is=n})(je||={}),(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&B.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||B.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||B.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||z.is(t.annotationId))}o(n,`is`),e.is=n})(Me||={}),(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>B.string(e.kind)?Ae.is(e)||je.is(e)||Me.is(e):ke.is(e)))}o(t,`is`),e.is=t})(Ne||={}),Pe=class{static{o(this,`TextEditChangeImpl`)}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let r,i;if(n===void 0?r=Ee.insert(e,t):z.is(n)?(i=n,r=Oe.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Oe.insert(e,t,i)),this.edits.push(r),i!==void 0)return i}replace(e,t,n){let r,i;if(n===void 0?r=Ee.replace(e,t):z.is(n)?(i=n,r=Oe.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Oe.replace(e,t,i)),this.edits.push(r),i!==void 0)return i}delete(e,t){let n,r;if(t===void 0?n=Ee.del(e):z.is(t)?(r=t,n=Oe.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=Oe.del(e,r)),this.edits.push(n),r!==void 0)return r}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error(`Text edit change is not configured to manage change annotations.`)}},Fe=class{static{o(this,`ChangeAnnotations`)}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(z.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Ie=class{static{o(this,`WorkspaceChange`)}constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Fe(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(e=>{if(ke.is(e)){let t=new Pe(e.edits,this._changeAnnotations);this._textEditChanges[e.textDocument.uri]=t}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new Pe(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(ze.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let e=[],r={textDocument:t,edits:e};this._workspaceEdit.documentChanges.push(r),n=new Pe(e,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error(`Workspace edit is not configured for normal text edit changes.`);let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new Pe(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Fe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;De.is(t)||z.is(t)?r=t:n=t;let i,a;if(r===void 0?i=Ae.create(e,n):(a=z.is(r)?r:this._changeAnnotations.manage(r),i=Ae.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}renameFile(e,t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let i;De.is(n)||z.is(n)?i=n:r=n;let a,o;if(i===void 0?a=je.create(e,t,r):(o=z.is(i)?i:this._changeAnnotations.manage(i),a=je.create(e,t,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;De.is(t)||z.is(t)?r=t:n=t;let i,a;if(r===void 0?i=Me.create(e,n):(a=z.is(r)?r:this._changeAnnotations.manage(r),i=Me.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}},(function(e){function t(e){return{uri:e}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.string(t.uri)}o(n,`is`),e.is=n})(Le||={}),(function(e){function t(e,t){return{uri:e,version:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.string(t.uri)&&B.integer(t.version)}o(n,`is`),e.is=n})(Re||={}),(function(e){function t(e,t){return{uri:e,version:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.string(t.uri)&&(t.version===null||B.integer(t.version))}o(n,`is`),e.is=n})(ze||={}),(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.string(t.uri)&&B.string(t.languageId)&&B.integer(t.version)&&B.string(t.text)}o(n,`is`),e.is=n})(Be||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}o(t,`is`),e.is=t})(Ve||={}),(function(e){function t(e){let t=e;return B.objectLiteral(e)&&Ve.is(t.kind)&&B.string(t.value)}o(t,`is`),e.is=t})(He||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Ue||={}),(function(e){e.PlainText=1,e.Snippet=2})(We||={}),(function(e){e.Deprecated=1})(Ge||={}),(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}o(t,`create`),e.create=t;function n(e){let t=e;return t&&B.string(t.newText)&&R.is(t.insert)&&R.is(t.replace)}o(n,`is`),e.is=n})(Ke||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(qe||={}),(function(e){function t(e){let t=e;return t&&(B.string(t.detail)||t.detail===void 0)&&(B.string(t.description)||t.description===void 0)}o(t,`is`),e.is=t})(Je||={}),(function(e){function t(e){return{label:e}}o(t,`create`),e.create=t})(Ye||={}),(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}o(t,`create`),e.create=t})(Xe||={}),(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}o(t,`fromPlainText`),e.fromPlainText=t;function n(e){let t=e;return B.string(t)||B.objectLiteral(t)&&B.string(t.language)&&B.string(t.value)}o(n,`is`),e.is=n})(Ze||={}),(function(e){function t(e){let t=e;return!!t&&B.objectLiteral(t)&&(He.is(t.contents)||Ze.is(t.contents)||B.typedArray(t.contents,Ze.is))&&(e.range===void 0||R.is(e.range))}o(t,`is`),e.is=t})(Qe||={}),(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}o(t,`create`),e.create=t})($e||={}),(function(e){function t(e,t,...n){let r={label:e};return B.defined(t)&&(r.documentation=t),B.defined(n)?r.parameters=n:r.parameters=[],r}o(t,`create`),e.create=t})(et||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(tt||={}),(function(e){function t(e,t){let n={range:e};return B.number(t)&&(n.kind=t),n}o(t,`create`),e.create=t})(nt||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(rt||={}),(function(e){e.Deprecated=1})(it||={}),(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}o(t,`create`),e.create=t})(at||={}),(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}o(t,`create`),e.create=t})(ot||={}),(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}o(t,`create`),e.create=t;function n(e){let t=e;return t&&B.string(t.name)&&B.number(t.kind)&&R.is(t.range)&&R.is(t.selectionRange)&&(t.detail===void 0||B.string(t.detail))&&(t.deprecated===void 0||B.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}o(n,`is`),e.is=n})(st||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(ct||={}),(function(e){e.Invoked=1,e.Automatic=2})(lt||={}),(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.typedArray(t.diagnostics,we.is)&&(t.only===void 0||B.typedArray(t.only,B.string))&&(t.triggerKind===void 0||t.triggerKind===lt.Invoked||t.triggerKind===lt.Automatic)}o(n,`is`),e.is=n})(ut||={}),(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):Te.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return t&&B.string(t.title)&&(t.diagnostics===void 0||B.typedArray(t.diagnostics,we.is))&&(t.kind===void 0||B.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||Te.is(t.command))&&(t.isPreferred===void 0||B.boolean(t.isPreferred))&&(t.edit===void 0||Ne.is(t.edit))}o(n,`is`),e.is=n})(dt||={}),(function(e){function t(e,t){let n={range:e};return B.defined(t)&&(n.data=t),n}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&R.is(t.range)&&(B.undefined(t.command)||Te.is(t.command))}o(n,`is`),e.is=n})(ft||={}),(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&B.uinteger(t.tabSize)&&B.boolean(t.insertSpaces)}o(n,`is`),e.is=n})(pt||={}),(function(e){function t(e,t,n){return{range:e,target:t,data:n}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&R.is(t.range)&&(B.undefined(t.target)||B.string(t.target))}o(n,`is`),e.is=n})(mt||={}),(function(e){function t(e,t){return{range:e,parent:t}}o(t,`create`),e.create=t;function n(t){let n=t;return B.objectLiteral(n)&&R.is(n.range)&&(n.parent===void 0||e.is(n.parent))}o(n,`is`),e.is=n})(ht||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(gt||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(_t||={}),(function(e){function t(e){let t=e;return B.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}o(t,`is`),e.is=t})(vt||={}),(function(e){function t(e,t){return{range:e,text:t}}o(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&R.is(t.range)&&B.string(t.text)}o(n,`is`),e.is=n})(yt||={}),(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}o(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&R.is(t.range)&&B.boolean(t.caseSensitiveLookup)&&(B.string(t.variableName)||t.variableName===void 0)}o(n,`is`),e.is=n})(bt||={}),(function(e){function t(e,t){return{range:e,expression:t}}o(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&R.is(t.range)&&(B.string(t.expression)||t.expression===void 0)}o(n,`is`),e.is=n})(xt||={}),(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}o(t,`create`),e.create=t;function n(e){let t=e;return B.defined(t)&&R.is(e.stoppedLocation)}o(n,`is`),e.is=n})(St||={}),(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}o(t,`is`),e.is=t})(Ct||={}),(function(e){function t(e){return{value:e}}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&(t.tooltip===void 0||B.string(t.tooltip)||He.is(t.tooltip))&&(t.location===void 0||pe.is(t.location))&&(t.command===void 0||Te.is(t.command))}o(n,`is`),e.is=n})(wt||={}),(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}o(t,`create`),e.create=t;function n(e){let t=e;return B.objectLiteral(t)&&L.is(t.position)&&(B.string(t.label)||B.typedArray(t.label,wt.is))&&(t.kind===void 0||Ct.is(t.kind))&&t.textEdits===void 0||B.typedArray(t.textEdits,Ee.is)&&(t.tooltip===void 0||B.string(t.tooltip)||He.is(t.tooltip))&&(t.paddingLeft===void 0||B.boolean(t.paddingLeft))&&(t.paddingRight===void 0||B.boolean(t.paddingRight))}o(n,`is`),e.is=n})(Tt||={}),(function(e){function t(e){return{kind:`snippet`,value:e}}o(t,`createSnippet`),e.createSnippet=t})(Et||={}),(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}o(t,`create`),e.create=t})(Dt||={}),(function(e){function t(e){return{items:e}}o(t,`create`),e.create=t})(Ot||={}),(function(e){e.Invoked=0,e.Automatic=1})(kt||={}),(function(e){function t(e,t){return{range:e,text:t}}o(t,`create`),e.create=t})(At||={}),(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}o(t,`create`),e.create=t})(jt||={}),(function(e){function t(e){let t=e;return B.objectLiteral(t)&&ue.is(t.uri)&&B.string(t.name)}o(t,`is`),e.is=t})(Mt||={}),Nt=[`
|
||
`,`\r
|
||
`,`\r`],(function(e){function t(e,t,n,r){return new Ft(e,t,n,r)}o(t,`create`),e.create=t;function n(e){let t=e;return!!(B.defined(t)&&B.string(t.uri)&&(B.undefined(t.languageId)||B.string(t.languageId))&&B.uinteger(t.lineCount)&&B.func(t.getText)&&B.func(t.positionAt)&&B.func(t.offsetAt))}o(n,`is`),e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}o(r,`applyEdits`),e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,c=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[c++]=r[o++]:e[c++]=a[s++];for(;o<r.length;)e[c++]=r[o++];for(;s<a.length;)e[c++]=a[s++];return e}o(i,`mergeSort`)})(Pt||={}),Ft=class{static{o(this,`FullTextDocument`)}constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
|
||
`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
|
||
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return L.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return L.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(e){return typeof e<`u`}o(n,`defined`),e.defined=n;function r(e){return typeof e>`u`}o(r,`undefined`),e.undefined=r;function i(e){return e===!0||e===!1}o(i,`boolean`),e.boolean=i;function a(e){return t.call(e)===`[object String]`}o(a,`string`),e.string=a;function s(e){return t.call(e)===`[object Number]`}o(s,`number`),e.number=s;function c(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}o(c,`numberRange`),e.numberRange=c;function l(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}o(l,`integer`),e.integer=l;function u(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}o(u,`uinteger`),e.uinteger=u;function d(e){return t.call(e)===`[object Function]`}o(d,`func`),e.func=d;function f(e){return typeof e==`object`&&!!e}o(f,`objectLiteral`),e.objectLiteral=f;function p(e,t){return Array.isArray(e)&&e.every(t)}o(p,`typedArray`),e.typedArray=p})(B||={})}),Lt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}o(n,`RAL`),(function(e){function n(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}o(n,`install`),e.install=n})(n||={}),e.default=n}),Rt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}o(t,`boolean`),e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}o(n,`string`),e.string=n;function r(e){return typeof e==`number`||e instanceof Number}o(r,`number`),e.number=r;function i(e){return e instanceof Error}o(i,`error`),e.error=i;function a(e){return typeof e==`function`}o(a,`func`),e.func=a;function s(e){return Array.isArray(e)}o(s,`array`),e.array=s;function c(e){return s(e)&&e.every(e=>n(e))}o(c,`stringArray`),e.stringArray=c}),zt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Emitter=e.Event=void 0;var t=Lt(),n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{static{o(this,`CallbackList`)}add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:o(()=>this.remove(e,t),`dispose`)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else n=!0;if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{n.push(r[a].apply(i[a],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class e{static{o(this,`Emitter`)}constructor(e){this._options=e}get event(){return this._event||=(t,n,i)=>{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:o(()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},`dispose`)};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}}),Bt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=Lt(),n=Rt(),r=zt(),i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function t(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}o(t,`is`),e.is=t})(i||(e.CancellationToken=i={}));var a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}}),s=class{static{o(this,`MutableToken`)}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{static{o(this,`CancellationTokenSource`)}get token(){return this._token||=new s,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}}}),Vt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Rt(),n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{static{o(this,`ResponseError`)}constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{static{o(this,`ParameterStructures`)}constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{static{o(this,`AbstractMessageSignature`)}constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{static{o(this,`RequestType0`)}constructor(e){super(e,0)}},e.RequestType=class extends i{static{o(this,`RequestType`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{static{o(this,`RequestType1`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{static{o(this,`RequestType2`)}constructor(e){super(e,2)}},e.RequestType3=class extends i{static{o(this,`RequestType3`)}constructor(e){super(e,3)}},e.RequestType4=class extends i{static{o(this,`RequestType4`)}constructor(e){super(e,4)}},e.RequestType5=class extends i{static{o(this,`RequestType5`)}constructor(e){super(e,5)}},e.RequestType6=class extends i{static{o(this,`RequestType6`)}constructor(e){super(e,6)}},e.RequestType7=class extends i{static{o(this,`RequestType7`)}constructor(e){super(e,7)}},e.RequestType8=class extends i{static{o(this,`RequestType8`)}constructor(e){super(e,8)}},e.RequestType9=class extends i{static{o(this,`RequestType9`)}constructor(e){super(e,9)}},e.NotificationType=class extends i{static{o(this,`NotificationType`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{static{o(this,`NotificationType0`)}constructor(e){super(e,0)}},e.NotificationType1=class extends i{static{o(this,`NotificationType1`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{static{o(this,`NotificationType2`)}constructor(e){super(e,2)}},e.NotificationType3=class extends i{static{o(this,`NotificationType3`)}constructor(e){super(e,3)}},e.NotificationType4=class extends i{static{o(this,`NotificationType4`)}constructor(e){super(e,4)}},e.NotificationType5=class extends i{static{o(this,`NotificationType5`)}constructor(e){super(e,5)}},e.NotificationType6=class extends i{static{o(this,`NotificationType6`)}constructor(e){super(e,6)}},e.NotificationType7=class extends i{static{o(this,`NotificationType7`)}constructor(e){super(e,7)}},e.NotificationType8=class extends i{static{o(this,`NotificationType8`)}constructor(e){super(e,8)}},e.NotificationType9=class extends i{static{o(this,`NotificationType9`)}constructor(e){super(e,9)}};var a;(function(e){function n(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))}o(n,`isRequest`),e.isRequest=n;function r(e){let n=e;return n&&t.string(n.method)&&e.id===void 0}o(r,`isNotification`),e.isNotification=r;function i(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}o(i,`isResponse`),e.isResponse=i})(a||(e.Message=a={}))}),Ht=i(e=>{var t;Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{static{o(this,`LinkedMap`)}constructor(){this[t]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:o(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}else return{value:void 0,done:!0}},`next`)};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:o(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}else return{value:void 0,done:!0}},`next`)};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:o(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}else return{value:void 0,done:!0}},`next`)};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==n.First&&t!==n.Last)){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{static{o(this,`LRUCache`)}constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}}),Ut=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Disposable=void 0;var t;(function(e){function t(e){return{dispose:e}}o(t,`create`),e.create=t})(t||(e.Disposable=t={}))}),Wt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Bt(),n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{static{o(this,`SharedArraySenderStrategy`)}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{static{o(this,`SharedArrayBufferCancellationToken`)}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{static{o(this,`SharedArrayBufferCancellationTokenSource`)}constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{static{o(this,`SharedArrayReceiverStrategy`)}constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}}),Gt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Semaphore=void 0;var t=Lt();e.Semaphore=class{static{o(this,`Semaphore`)}constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}}),Kt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=Lt(),n=Rt(),r=zt(),i=Gt(),a;(function(e){function t(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}o(t,`is`),e.is=t})(a||(e.MessageReader=a={}));var s=class{static{o(this,`AbstractMessageReader`)}constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=s;var c;(function(e){function n(e){let n,r,i=new Map,a,o=new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}o(n,`fromOptions`),e.fromOptions=n})(c||={}),e.ReadableStreamMessageReader=class extends s{static{o(this,`ReadableStreamMessageReader`)}constructor(e,n){super(),this.readable=e,this.options=c.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(Error(`Header must provide a Content-Length property.
|
||
${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}}),qt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=Lt(),n=Rt(),r=Gt(),i=zt(),a=`Content-Length: `,s=`\r
|
||
`,c;(function(e){function t(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}o(t,`is`),e.is=t})(c||(e.MessageWriter=c={}));var l=class{static{o(this,`AbstractMessageWriter`)}constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=l;var u;(function(e){function n(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}o(n,`fromOptions`),e.fromOptions=n})(u||={}),e.WriteableStreamMessageWriter=class extends l{static{o(this,`WriteableStreamMessageWriter`)}constructor(e,t){super(),this.writable=e,this.options=u.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(a,t.byteLength.toString(),s),n.push(s),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}}),Jt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,n=10,r=`\r
|
||
`;e.AbstractMessageBuffer=class{static{o(this,`AbstractMessageBuffer`)}constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let i=0,a=0,o=0,s=0;e:for(;a<this._chunks.length;){let e=this._chunks[a];for(o=0;o<e.length;){switch(e[o]){case t:switch(i){case 0:i=1;break;case 2:i=3;break;default:i=0}break;case n:switch(i){case 1:i=2;break;case 3:i=4,o++;break e;default:i=0}break;default:i=0}o++}s+=e.byteLength,a++}if(i!==4)return;let c=this._read(s+o),l=new Map,u=this.toString(c,`ascii`).split(r);if(u.length<2)return l;for(let t=0;t<u.length-2;t++){let n=u[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'
|
||
${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();l.set(e?i.toLowerCase():i,a)}return l}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}}),Yt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=Lt(),n=Rt(),r=Vt(),i=Ht(),a=zt(),s=Bt(),c;(function(e){e.type=new r.NotificationType(`$/cancelRequest`)})(c||={});var l;(function(e){function t(e){return typeof e==`string`||typeof e==`number`}o(t,`is`),e.is=t})(l||(e.ProgressToken=l={}));var u;(function(e){e.type=new r.NotificationType(`$/progress`)})(u||={}),e.ProgressType=class{static{o(this,`ProgressType`)}constructor(){}};var d;(function(e){function t(e){return n.func(e)}o(t,`is`),e.is=t})(d||={}),e.NullLogger=Object.freeze({error:o(()=>{},`error`),warn:o(()=>{},`warn`),info:o(()=>{},`info`),log:o(()=>{},`log`)});var f;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(f||(e.Trace=f={}));var p;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(p||(e.TraceValues=p={})),(function(e){function t(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}}o(t,`fromString`),e.fromString=t;function r(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}o(r,`toString`),e.toString=r})(f||(e.Trace=f={}));var m;(function(e){e.Text=`text`,e.JSON=`json`})(m||(e.TraceFormat=m={})),(function(e){function t(t){return n.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}o(t,`fromString`),e.fromString=t})(m||(e.TraceFormat=m={}));var h;(function(e){e.type=new r.NotificationType(`$/setTrace`)})(h||(e.SetTraceNotification=h={}));var g;(function(e){e.type=new r.NotificationType(`$/logTrace`)})(g||(e.LogTraceNotification=g={}));var _;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(_||(e.ConnectionErrors=_={}));var ee=class e extends Error{static{o(this,`ConnectionError`)}constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=ee;var v;(function(e){function t(e){let t=e;return t&&n.func(t.cancelUndispatched)}o(t,`is`),e.is=t})(v||(e.ConnectionStrategy=v={}));var y;(function(e){function t(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}o(t,`is`),e.is=t})(y||(e.IdCancellationReceiverStrategy=y={}));var b;(function(e){function t(e){let t=e;return t&&t.kind===`request`&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}o(t,`is`),e.is=t})(b||(e.RequestCancellationReceiverStrategy=b={}));var te;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new s.CancellationTokenSource}});function t(e){return y.is(e)||b.is(e)}o(t,`is`),e.is=t})(te||(e.CancellationReceiverStrategy=te={}));var x;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(c.type,{id:t})},cleanup(e){}});function t(e){let t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}o(t,`is`),e.is=t})(x||(e.CancellationSenderStrategy=x={}));var S;(function(e){e.Message=Object.freeze({receiver:te.Message,sender:x.Message});function t(e){let t=e;return t&&te.is(t.receiver)&&x.is(t.sender)}o(t,`is`),e.is=t})(S||(e.CancellationStrategy=S={}));var C;(function(e){function t(e){let t=e;return t&&n.func(t.handleMessage)}o(t,`is`),e.is=t})(C||(e.MessageStrategy=C={}));var ne;(function(e){function t(e){let t=e;return t&&(S.is(t.cancellationStrategy)||v.is(t.connectionStrategy)||C.is(t.messageStrategy))}o(t,`is`),e.is=t})(ne||(e.ConnectionOptions=ne={}));var w;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(w||={});function T(p,v,b,te){let x=b===void 0?e.NullLogger:b,ne=0,T=0,E=0,D,O=new Map,re,k=new Map,A=new Map,j,M=new i.LinkedMap,ie=new Map,ae=new Set,oe=new Map,N=f.Off,P=m.Text,F,I=w.New,se=new a.Emitter,ce=new a.Emitter,le=new a.Emitter,ue=new a.Emitter,de=new a.Emitter,fe=te&&te.cancellationStrategy?te.cancellationStrategy:S.Message;function L(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}o(L,`createRequestQueueKey`);function R(e){return e===null?`res-unknown-`+(++E).toString():`res-`+e.toString()}o(R,`createResponseQueueKey`);function pe(){return`not-`+(++T).toString()}o(pe,`createNotificationQueueKey`);function me(e,t){r.Message.isRequest(t)?e.set(L(t.id),t):r.Message.isResponse(t)?e.set(R(t.id),t):e.set(pe(),t)}o(me,`addMessageToQueue`);function he(e){}o(he,`cancelUndispatched`);function ge(){return I===w.Listening}o(ge,`isListening`);function _e(){return I===w.Closed}o(_e,`isClosed`);function ve(){return I===w.Disposed}o(ve,`isDisposed`);function ye(){(I===w.New||I===w.Listening)&&(I=w.Closed,ce.fire(void 0))}o(ye,`closeHandler`);function be(e){se.fire([e,void 0,void 0])}o(be,`readErrorHandler`);function xe(e){se.fire(e)}o(xe,`writeErrorHandler`),p.onClose(ye),p.onError(be),v.onClose(ye),v.onError(xe);function Se(){j||M.size===0||(j=(0,t.default)().timer.setImmediate(()=>{j=void 0,we()}))}o(Se,`triggerMessageQueue`);function Ce(e){r.Message.isRequest(e)?Ee(e):r.Message.isNotification(e)?z(e):r.Message.isResponse(e)?De(e):Oe(e)}o(Ce,`handleMessage`);function we(){if(M.size===0)return;let e=M.shift();try{let t=te?.messageStrategy;C.is(t)?t.handleMessage(e,Ce):Ce(e)}finally{Se()}}o(we,`processMessageQueue`);let Te=o(e=>{try{if(r.Message.isNotification(e)&&e.method===c.type.method){let t=e.params.id,n=L(t),i=M.get(n);if(r.Message.isRequest(i)){let r=te?.connectionStrategy,a=r&&r.cancelUndispatched?r.cancelUndispatched(i,he):void 0;if(a&&(a.error!==void 0||a.result!==void 0)){M.delete(n),oe.delete(t),a.id=i.id,Me(a,e.method,Date.now()),v.write(a).catch(()=>x.error(`Sending response for canceled message failed.`));return}}let a=oe.get(t);if(a!==void 0){a.cancel(),Pe(e);return}else ae.add(t)}me(M,e)}finally{Se()}},`callback`);function Ee(e){if(ve())return;function t(t,n,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof r.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,Me(a,n,i),v.write(a).catch(()=>x.error(`Sending response failed.`))}o(t,`reply`);function i(t,n,r){let i={jsonrpc:`2.0`,id:e.id,error:t.toJson()};Me(i,n,r),v.write(i).catch(()=>x.error(`Sending response failed.`))}o(i,`replyError`);function a(t,n,r){t===void 0&&(t=null);let i={jsonrpc:`2.0`,id:e.id,result:t};Me(i,n,r),v.write(i).catch(()=>x.error(`Sending response failed.`))}o(a,`replySuccess`),Ne(e);let s=O.get(e.method),c,l;s&&(c=s.type,l=s.handler);let u=Date.now();if(l||D){let o=e.id??String(Date.now()),s=y.is(fe.receiver)?fe.receiver.createCancellationTokenSource(o):fe.receiver.createCancellationTokenSource(e);e.id!==null&&ae.has(e.id)&&s.cancel(),e.id!==null&&oe.set(o,s);try{let d;if(l)if(e.params===void 0){if(c!==void 0&&c.numberOfParams!==0){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${c.numberOfParams} params but received none.`),e.method,u);return}d=l(s.token)}else if(Array.isArray(e.params)){if(c!==void 0&&c.parameterStructures===r.ParameterStructures.byName){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);return}d=l(...e.params,s.token)}else{if(c!==void 0&&c.parameterStructures===r.ParameterStructures.byPosition){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);return}d=l(e.params,s.token)}else D&&(d=D(e.method,e.params,s.token));let f=d;d?f.then?f.then(n=>{oe.delete(o),t(n,e.method,u)},t=>{oe.delete(o),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}):(oe.delete(o),t(d,e.method,u)):(oe.delete(o),a(d,e.method,u))}catch(a){oe.delete(o),a instanceof r.ResponseError?t(a,e.method,u):a&&n.string(a.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${a.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}o(Ee,`handleRequest`);function De(e){if(!ve())if(e.id===null)e.error?x.error(`Received response message without id: Error is:
|
||
${JSON.stringify(e.error,void 0,4)}`):x.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=ie.get(t);if(Fe(e,n),n!==void 0){ie.delete(t);try{if(e.error){let t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?x.error(`Response handler '${n.method}' failed with message: ${e.message}`):x.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}o(De,`handleResponse`);function z(e){if(ve())return;let t,n;if(e.method===c.type.method){let t=e.params.id;ae.delete(t),Pe(e);return}else{let r=k.get(e.method);r&&(n=r.handler,t=r.type)}if(n||re)try{if(Pe(e),n)if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let i=e.params;e.method===u.type.method&&i.length===2&&l.is(i[0])?n({token:i[0],value:i[1]}):(t!==void 0&&(t.parameterStructures===r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else t!==void 0&&t.parameterStructures===r.ParameterStructures.byPosition&&x.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else re&&re(e.method,e.params)}catch(t){t.message?x.error(`Notification handler '${e.method}' failed with message: ${t.message}`):x.error(`Notification handler '${e.method}' failed unexpectedly.`)}else le.fire(e)}o(z,`handleNotification`);function Oe(e){if(!e){x.error(`Received empty message.`);return}x.error(`Received message which is neither a response nor a notification message:
|
||
${JSON.stringify(e,null,4)}`);let t=e;if(n.string(t.id)||n.number(t.id)){let e=t.id,n=ie.get(e);n&&n.reject(Error(`The received response has neither a result nor an error property.`))}}o(Oe,`handleInvalidMessage`);function ke(e){if(e!=null)switch(N){case f.Verbose:return JSON.stringify(e,null,4);case f.Compact:return JSON.stringify(e);default:return}}o(ke,`stringifyTrace`);function Ae(e){if(!(N===f.Off||!F))if(P===m.Text){let t;(N===f.Verbose||N===f.Compact)&&e.params&&(t=`Params: ${ke(e.params)}
|
||
|
||
`),F.log(`Sending request '${e.method} - (${e.id})'.`,t)}else Ie(`send-request`,e)}o(Ae,`traceSendingRequest`);function je(e){if(!(N===f.Off||!F))if(P===m.Text){let t;(N===f.Verbose||N===f.Compact)&&(t=e.params?`Params: ${ke(e.params)}
|
||
|
||
`:`No parameters provided.
|
||
|
||
`),F.log(`Sending notification '${e.method}'.`,t)}else Ie(`send-notification`,e)}o(je,`traceSendingNotification`);function Me(e,t,n){if(!(N===f.Off||!F))if(P===m.Text){let r;(N===f.Verbose||N===f.Compact)&&(e.error&&e.error.data?r=`Error data: ${ke(e.error.data)}
|
||
|
||
`:e.result?r=`Result: ${ke(e.result)}
|
||
|
||
`:e.error===void 0&&(r=`No result returned.
|
||
|
||
`)),F.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else Ie(`send-response`,e)}o(Me,`traceSendingResponse`);function Ne(e){if(!(N===f.Off||!F))if(P===m.Text){let t;(N===f.Verbose||N===f.Compact)&&e.params&&(t=`Params: ${ke(e.params)}
|
||
|
||
`),F.log(`Received request '${e.method} - (${e.id})'.`,t)}else Ie(`receive-request`,e)}o(Ne,`traceReceivedRequest`);function Pe(e){if(!(N===f.Off||!F||e.method===g.type.method))if(P===m.Text){let t;(N===f.Verbose||N===f.Compact)&&(t=e.params?`Params: ${ke(e.params)}
|
||
|
||
`:`No parameters provided.
|
||
|
||
`),F.log(`Received notification '${e.method}'.`,t)}else Ie(`receive-notification`,e)}o(Pe,`traceReceivedNotification`);function Fe(e,t){if(!(N===f.Off||!F))if(P===m.Text){let n;if((N===f.Verbose||N===f.Compact)&&(e.error&&e.error.data?n=`Error data: ${ke(e.error.data)}
|
||
|
||
`:e.result?n=`Result: ${ke(e.result)}
|
||
|
||
`:e.error===void 0&&(n=`No result returned.
|
||
|
||
`)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;F.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else F.log(`Received response ${e.id} without active response promise.`,n)}else Ie(`receive-response`,e)}o(Fe,`traceReceivedResponse`);function Ie(e,t){if(!F||N===f.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};F.log(n)}o(Ie,`logLSPMessage`);function Le(){if(_e())throw new ee(_.Closed,`Connection is closed.`);if(ve())throw new ee(_.Disposed,`Connection is disposed.`)}o(Le,`throwIfClosedOrDisposed`);function Re(){if(ge())throw new ee(_.AlreadyListening,`Connection is already listening`)}o(Re,`throwIfListening`);function ze(){if(!ge())throw Error(`Call listen() first.`)}o(ze,`throwIfNotListening`);function Be(e){return e===void 0?null:e}o(Be,`undefinedToNull`);function Ve(e){if(e!==null)return e}o(Ve,`nullToUndefined`);function He(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}o(He,`isNamedParam`);function Ue(e,t){switch(e){case r.ParameterStructures.auto:return He(t)?Ve(t):[Be(t)];case r.ParameterStructures.byName:if(!He(t))throw Error(`Received parameters by name but param is not an object literal.`);return Ve(t);case r.ParameterStructures.byPosition:return[Be(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}o(Ue,`computeSingleParam`);function We(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=Ue(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Be(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null);break}return n}o(We,`computeMessageParams`);let Ge={sendNotification:o((e,...t)=>{Le();let i,a;if(n.string(e)){i=e;let n=t[0],o=0,s=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(o=1,s=n);let c=t.length,l=c-o;switch(l){case 0:a=void 0;break;case 1:a=Ue(s,t[o]);break;default:if(s===r.ParameterStructures.byName)throw Error(`Received ${l} parameters for 'by Name' notification parameter structure.`);a=t.slice(o,c).map(e=>Be(e));break}}else{let n=t;i=e.method,a=We(e,n)}let o={jsonrpc:`2.0`,method:i,params:a};return je(o),v.write(o).catch(e=>{throw x.error(`Sending notification failed.`),e})},`sendNotification`),onNotification:o((e,t)=>{Le();let r;return n.func(e)?re=e:t&&(n.string(e)?(r=e,k.set(e,{type:void 0,handler:t})):(r=e.method,k.set(e.method,{type:e,handler:t}))),{dispose:o(()=>{r===void 0?re=void 0:k.delete(r)},`dispose`)}},`onNotification`),onProgress:o((e,t,n)=>{if(A.has(t))throw Error(`Progress handler for token ${t} already registered`);return A.set(t,n),{dispose:o(()=>{A.delete(t)},`dispose`)}},`onProgress`),sendProgress:o((e,t,n)=>Ge.sendNotification(u.type,{token:t,value:n}),`sendProgress`),onUnhandledProgress:ue.event,sendRequest:o((e,...t)=>{Le(),ze();let i,a,c;if(n.string(e)){i=e;let n=t[0],o=t[t.length-1],l=0,u=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(l=1,u=n);let d=t.length;s.CancellationToken.is(o)&&(--d,c=o);let f=d-l;switch(f){case 0:a=void 0;break;case 1:a=Ue(u,t[l]);break;default:if(u===r.ParameterStructures.byName)throw Error(`Received ${f} parameters for 'by Name' request parameter structure.`);a=t.slice(l,d).map(e=>Be(e));break}}else{let n=t;i=e.method,a=We(e,n);let r=e.numberOfParams;c=s.CancellationToken.is(n[r])?n[r]:void 0}let l=ne++,u;c&&(u=c.onCancellationRequested(()=>{let e=fe.sender.sendCancellation(Ge,l);return e===void 0?(x.log(`Received no promise from cancellation strategy when cancelling id ${l}`),Promise.resolve()):e.catch(()=>{x.log(`Sending cancellation messages for id ${l} failed`)})}));let d={jsonrpc:`2.0`,id:l,method:i,params:a};return Ae(d),typeof fe.sender.enableCancellation==`function`&&fe.sender.enableCancellation(d),new Promise(async(e,t)=>{let n=o(t=>{e(t),fe.sender.cleanup(l),u?.dispose()},`resolveWithCleanup`),a=o(e=>{t(e),fe.sender.cleanup(l),u?.dispose()},`rejectWithCleanup`),s={method:i,timerStart:Date.now(),resolve:n,reject:a};try{await v.write(d),ie.set(l,s)}catch(e){throw x.error(`Sending request failed.`),s.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),e}})},`sendRequest`),onRequest:o((e,t)=>{Le();let r=null;return d.is(e)?(r=void 0,D=e):n.string(e)?(r=null,t!==void 0&&(r=e,O.set(e,{handler:t,type:void 0}))):t!==void 0&&(r=e.method,O.set(e.method,{type:e,handler:t})),{dispose:o(()=>{r!==null&&(r===void 0?D=void 0:O.delete(r))},`dispose`)}},`onRequest`),hasPendingResponse:o(()=>ie.size>0,`hasPendingResponse`),trace:o(async(e,t,r)=>{let i=!1,a=m.Text;r!==void 0&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,a=r.traceFormat||m.Text)),N=e,P=a,F=N===f.Off?void 0:t,i&&!_e()&&!ve()&&await Ge.sendNotification(h.type,{value:f.toString(e)})},`trace`),onError:se.event,onClose:ce.event,onUnhandledNotification:le.event,onDispose:de.event,end:o(()=>{v.end()},`end`),dispose:o(()=>{if(ve())return;I=w.Disposed,de.fire(void 0);let e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of ie.values())t.reject(e);ie=new Map,oe=new Map,ae=new Set,M=new i.LinkedMap,n.func(v.dispose)&&v.dispose(),n.func(p.dispose)&&p.dispose()},`dispose`),listen:o(()=>{Le(),Re(),I=w.Listening,p.listen(Te)},`listen`),inspect:o(()=>{(0,t.default)().console.log(`inspect`)},`inspect`)};return Ge.onNotification(g.type,e=>{if(N===f.Off||!F)return;let t=N===f.Verbose||N===f.Compact;F.log(e.message,t?e.verbose:void 0)}),Ge.onNotification(u.type,e=>{let t=A.get(e.token);t?t(e.value):ue.fire(e)}),Ge}o(T,`createMessageConnection`),e.createMessageConnection=T}),Xt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=Vt();Object.defineProperty(e,`Message`,{enumerable:!0,get:o(function(){return t.Message},`get`)}),Object.defineProperty(e,`RequestType`,{enumerable:!0,get:o(function(){return t.RequestType},`get`)}),Object.defineProperty(e,`RequestType0`,{enumerable:!0,get:o(function(){return t.RequestType0},`get`)}),Object.defineProperty(e,`RequestType1`,{enumerable:!0,get:o(function(){return t.RequestType1},`get`)}),Object.defineProperty(e,`RequestType2`,{enumerable:!0,get:o(function(){return t.RequestType2},`get`)}),Object.defineProperty(e,`RequestType3`,{enumerable:!0,get:o(function(){return t.RequestType3},`get`)}),Object.defineProperty(e,`RequestType4`,{enumerable:!0,get:o(function(){return t.RequestType4},`get`)}),Object.defineProperty(e,`RequestType5`,{enumerable:!0,get:o(function(){return t.RequestType5},`get`)}),Object.defineProperty(e,`RequestType6`,{enumerable:!0,get:o(function(){return t.RequestType6},`get`)}),Object.defineProperty(e,`RequestType7`,{enumerable:!0,get:o(function(){return t.RequestType7},`get`)}),Object.defineProperty(e,`RequestType8`,{enumerable:!0,get:o(function(){return t.RequestType8},`get`)}),Object.defineProperty(e,`RequestType9`,{enumerable:!0,get:o(function(){return t.RequestType9},`get`)}),Object.defineProperty(e,`ResponseError`,{enumerable:!0,get:o(function(){return t.ResponseError},`get`)}),Object.defineProperty(e,`ErrorCodes`,{enumerable:!0,get:o(function(){return t.ErrorCodes},`get`)}),Object.defineProperty(e,`NotificationType`,{enumerable:!0,get:o(function(){return t.NotificationType},`get`)}),Object.defineProperty(e,`NotificationType0`,{enumerable:!0,get:o(function(){return t.NotificationType0},`get`)}),Object.defineProperty(e,`NotificationType1`,{enumerable:!0,get:o(function(){return t.NotificationType1},`get`)}),Object.defineProperty(e,`NotificationType2`,{enumerable:!0,get:o(function(){return t.NotificationType2},`get`)}),Object.defineProperty(e,`NotificationType3`,{enumerable:!0,get:o(function(){return t.NotificationType3},`get`)}),Object.defineProperty(e,`NotificationType4`,{enumerable:!0,get:o(function(){return t.NotificationType4},`get`)}),Object.defineProperty(e,`NotificationType5`,{enumerable:!0,get:o(function(){return t.NotificationType5},`get`)}),Object.defineProperty(e,`NotificationType6`,{enumerable:!0,get:o(function(){return t.NotificationType6},`get`)}),Object.defineProperty(e,`NotificationType7`,{enumerable:!0,get:o(function(){return t.NotificationType7},`get`)}),Object.defineProperty(e,`NotificationType8`,{enumerable:!0,get:o(function(){return t.NotificationType8},`get`)}),Object.defineProperty(e,`NotificationType9`,{enumerable:!0,get:o(function(){return t.NotificationType9},`get`)}),Object.defineProperty(e,`ParameterStructures`,{enumerable:!0,get:o(function(){return t.ParameterStructures},`get`)});var n=Ht();Object.defineProperty(e,`LinkedMap`,{enumerable:!0,get:o(function(){return n.LinkedMap},`get`)}),Object.defineProperty(e,`LRUCache`,{enumerable:!0,get:o(function(){return n.LRUCache},`get`)}),Object.defineProperty(e,`Touch`,{enumerable:!0,get:o(function(){return n.Touch},`get`)});var r=Ut();Object.defineProperty(e,`Disposable`,{enumerable:!0,get:o(function(){return r.Disposable},`get`)});var i=zt();Object.defineProperty(e,`Event`,{enumerable:!0,get:o(function(){return i.Event},`get`)}),Object.defineProperty(e,`Emitter`,{enumerable:!0,get:o(function(){return i.Emitter},`get`)});var a=Bt();Object.defineProperty(e,`CancellationTokenSource`,{enumerable:!0,get:o(function(){return a.CancellationTokenSource},`get`)}),Object.defineProperty(e,`CancellationToken`,{enumerable:!0,get:o(function(){return a.CancellationToken},`get`)});var s=Wt();Object.defineProperty(e,`SharedArraySenderStrategy`,{enumerable:!0,get:o(function(){return s.SharedArraySenderStrategy},`get`)}),Object.defineProperty(e,`SharedArrayReceiverStrategy`,{enumerable:!0,get:o(function(){return s.SharedArrayReceiverStrategy},`get`)});var c=Kt();Object.defineProperty(e,`MessageReader`,{enumerable:!0,get:o(function(){return c.MessageReader},`get`)}),Object.defineProperty(e,`AbstractMessageReader`,{enumerable:!0,get:o(function(){return c.AbstractMessageReader},`get`)}),Object.defineProperty(e,`ReadableStreamMessageReader`,{enumerable:!0,get:o(function(){return c.ReadableStreamMessageReader},`get`)});var l=qt();Object.defineProperty(e,`MessageWriter`,{enumerable:!0,get:o(function(){return l.MessageWriter},`get`)}),Object.defineProperty(e,`AbstractMessageWriter`,{enumerable:!0,get:o(function(){return l.AbstractMessageWriter},`get`)}),Object.defineProperty(e,`WriteableStreamMessageWriter`,{enumerable:!0,get:o(function(){return l.WriteableStreamMessageWriter},`get`)});var u=Jt();Object.defineProperty(e,`AbstractMessageBuffer`,{enumerable:!0,get:o(function(){return u.AbstractMessageBuffer},`get`)});var d=Yt();Object.defineProperty(e,`ConnectionStrategy`,{enumerable:!0,get:o(function(){return d.ConnectionStrategy},`get`)}),Object.defineProperty(e,`ConnectionOptions`,{enumerable:!0,get:o(function(){return d.ConnectionOptions},`get`)}),Object.defineProperty(e,`NullLogger`,{enumerable:!0,get:o(function(){return d.NullLogger},`get`)}),Object.defineProperty(e,`createMessageConnection`,{enumerable:!0,get:o(function(){return d.createMessageConnection},`get`)}),Object.defineProperty(e,`ProgressToken`,{enumerable:!0,get:o(function(){return d.ProgressToken},`get`)}),Object.defineProperty(e,`ProgressType`,{enumerable:!0,get:o(function(){return d.ProgressType},`get`)}),Object.defineProperty(e,`Trace`,{enumerable:!0,get:o(function(){return d.Trace},`get`)}),Object.defineProperty(e,`TraceValues`,{enumerable:!0,get:o(function(){return d.TraceValues},`get`)}),Object.defineProperty(e,`TraceFormat`,{enumerable:!0,get:o(function(){return d.TraceFormat},`get`)}),Object.defineProperty(e,`SetTraceNotification`,{enumerable:!0,get:o(function(){return d.SetTraceNotification},`get`)}),Object.defineProperty(e,`LogTraceNotification`,{enumerable:!0,get:o(function(){return d.LogTraceNotification},`get`)}),Object.defineProperty(e,`ConnectionErrors`,{enumerable:!0,get:o(function(){return d.ConnectionErrors},`get`)}),Object.defineProperty(e,`ConnectionError`,{enumerable:!0,get:o(function(){return d.ConnectionError},`get`)}),Object.defineProperty(e,`CancellationReceiverStrategy`,{enumerable:!0,get:o(function(){return d.CancellationReceiverStrategy},`get`)}),Object.defineProperty(e,`CancellationSenderStrategy`,{enumerable:!0,get:o(function(){return d.CancellationSenderStrategy},`get`)}),Object.defineProperty(e,`CancellationStrategy`,{enumerable:!0,get:o(function(){return d.CancellationStrategy},`get`)}),Object.defineProperty(e,`MessageStrategy`,{enumerable:!0,get:o(function(){return d.MessageStrategy},`get`)}),e.RAL=Lt().default}),Zt=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Xt(),n=class e extends t.AbstractMessageBuffer{static{o(this,`MessageBuffer`)}constructor(e=`utf-8`){super(e),this.asciiDecoder=new TextDecoder(`ascii`)}emptyBuffer(){return e.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t===`ascii`?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}};n.emptyBuffer=new Uint8Array;var r=class{static{o(this,`ReadableStreamWrapper`)}constructor(e){this.socket=e,this._onData=new t.Emitter,this._messageListener=e=>{e.data.arrayBuffer().then(e=>{this._onData.fire(new Uint8Array(e))},()=>{(0,t.RAL)().console.error(`Converting blob to array buffer failed.`)})},this.socket.addEventListener(`message`,this._messageListener)}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}onData(e){return this._onData.event(e)}},i=class{static{o(this,`WritableStreamWrapper`)}constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}write(e,t){if(typeof e==`string`){if(t!==void 0&&t!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:o(e=>new n(e),`create`)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:o((e,t)=>{if(t.charset!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(a.encode(JSON.stringify(e,void 0,0)))},`encode`)}),decoder:Object.freeze({name:`application/json`,decode:o((e,t)=>{if(!(e instanceof Uint8Array))throw Error(`In a Browser environments only Uint8Arrays are supported.`);return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))},`decode`)})}),stream:Object.freeze({asReadableStream:o(e=>new r(e),`asReadableStream`),asWritableStream:o(e=>new i(e),`asWritableStream`)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:o(()=>clearTimeout(r),`dispose`)}},setImmediate(e,...t){let n=setTimeout(e,0,...t);return{dispose:o(()=>clearTimeout(n),`dispose`)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:o(()=>clearInterval(r),`dispose`)}}})});function c(){return s}o(c,`RIL`),(function(e){function n(){t.RAL.install(s)}o(n,`install`),e.install=n})(c||={}),e.default=c}),Qt=i(e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,Zt().default.install();var r=Xt();n(Xt(),e),e.BrowserMessageReader=class extends r.AbstractMessageReader{static{o(this,`BrowserMessageReader`)}constructor(e){super(),this._onData=new r.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener(`error`,e=>this.fireError(e)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}},e.BrowserMessageWriter=class extends r.AbstractMessageWriter{static{o(this,`BrowserMessageWriter`)}constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener(`error`,e=>this.fireError(e))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};function i(e,t,n,i){return n===void 0&&(n=r.NullLogger),r.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,r.createMessageConnection)(e,t,n,i)}o(i,`createMessageConnection`),e.createMessageConnection=i}),$t=i((e,t)=>{t.exports=Qt()}),V=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=Qt(),n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{static{o(this,`RegistrationType`)}constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{static{o(this,`ProtocolRequestType0`)}constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{static{o(this,`ProtocolRequestType`)}constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{static{o(this,`ProtocolNotificationType0`)}constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{static{o(this,`ProtocolNotificationType`)}constructor(e){super(e,t.ParameterStructures.byName)}}}),en=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}o(t,`boolean`),e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}o(n,`string`),e.string=n;function r(e){return typeof e==`number`||e instanceof Number}o(r,`number`),e.number=r;function i(e){return e instanceof Error}o(i,`error`),e.error=i;function a(e){return typeof e==`function`}o(a,`func`),e.func=a;function s(e){return Array.isArray(e)}o(s,`array`),e.array=s;function c(e){return s(e)&&e.every(e=>n(e))}o(c,`stringArray`),e.stringArray=c;function l(e,t){return Array.isArray(e)&&e.every(t)}o(l,`typedArray`),e.typedArray=l;function u(e){return typeof e==`object`&&!!e}o(u,`objectLiteral`),e.objectLiteral=u}),tn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ImplementationRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ImplementationRequest=n={}))}),nn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeDefinitionRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeDefinitionRequest=n={}))}),rn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=V(),n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))}),an=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConfigurationRequest=void 0;var t=V(),n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ConfigurationRequest=n={}))}),on=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.ColorPresentationRequest=r={}))}),sn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.FoldingRangeRefreshRequest=r={}))}),cn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DeclarationRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DeclarationRequest=n={}))}),ln=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SelectionRangeRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.SelectionRangeRequest=n={}))}),un=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=Qt(),n=V(),r;(function(e){e.type=new t.ProgressType;function n(t){return t===e.type}o(n,`is`),e.is=n})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))}),dn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))}),fn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=V(),n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(s||(e.SemanticTokensRefreshRequest=s={}))}),pn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ShowDocumentRequest=void 0;var t=V(),n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ShowDocumentRequest=n={}))}),mn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.LinkedEditingRangeRequest=n={}))}),hn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=V(),n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(s||(e.DidDeleteFilesNotification=s={}));var c;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(c||(e.WillDeleteFilesRequest=c={}))}),gn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=V(),n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.MonikerRequest=i={}))}),_n=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))}),vn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.InlineValueRefreshRequest=r={}))}),yn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(i||(e.InlayHintRefreshRequest=i={}))}),bn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=Qt(),n=en(),r=V(),i;(function(e){function t(e){let t=e;return t&&n.boolean(t.retriggerRequest)}o(t,`is`),e.is=t})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(a||(e.DocumentDiagnosticReportKind=a={}));var s;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(s||(e.DocumentDiagnosticRequest=s={}));var c;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(c||(e.WorkspaceDiagnosticRequest=c={}));var l;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=r.MessageDirection.serverToClient,e.type=new r.ProtocolRequestType0(e.method)})(l||(e.DiagnosticRefreshRequest=l={}))}),xn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(It(),a(ce)),n=en(),r=V(),i;(function(e){e.Markup=1,e.Code=2;function t(e){return e===1||e===2}o(t,`is`),e.is=t})(i||(e.NotebookCellKind=i={}));var s;(function(e){function r(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n}o(r,`create`),e.create=r;function i(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(r.success===void 0||n.boolean(r.success))}o(i,`is`),e.is=i;function a(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}o(a,`equals`),e.equals=a})(s||(e.ExecutionSummary=s={}));var c;(function(e){function r(e,t){return{kind:e,document:t}}o(r,`create`),e.create=r;function a(e){let r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(r.metadata===void 0||n.objectLiteral(r.metadata))}o(a,`is`),e.is=a;function c(e,t){let n=new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),(e.metadata!==void 0||t.metadata!==void 0)&&!l(e.metadata,t.metadata)&&n.add(`metadata`),(e.executionSummary!==void 0||t.executionSummary!==void 0)&&!s.equals(e.executionSummary,t.executionSummary)&&n.add(`executionSummary`),n}o(c,`diff`),e.diff=c;function l(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let r=Array.isArray(e),i=Array.isArray(t);if(r!==i)return!1;if(r&&i){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!l(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||(n.sort(),r.sort(),!l(n,r)))return!1;for(let r=0;r<n.length;r++){let i=n[r];if(!l(e[i],t[i]))return!1}}return!0}o(l,`equalsMetadata`)})(c||(e.NotebookCell=c={}));var l;(function(e){function r(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}}o(r,`create`),e.create=r;function i(e){let r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,c.is)}o(i,`is`),e.is=i})(l||(e.NotebookDocument=l={}));var u;(function(e){e.method=`notebookDocument/sync`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)})(u||(e.NotebookDocumentSyncRegistrationType=u={}));var d;(function(e){e.method=`notebookDocument/didOpen`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=u.method})(d||(e.DidOpenNotebookDocumentNotification=d={}));var f;(function(e){function r(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(r.cells===void 0||n.typedArray(r.cells,c.is))}o(r,`is`),e.is=r;function i(e,t,n){let r={start:e,deleteCount:t};return n!==void 0&&(r.cells=n),r}o(i,`create`),e.create=i})(f||(e.NotebookCellArrayChange=f={}));var p;(function(e){e.method=`notebookDocument/didChange`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=u.method})(p||(e.DidChangeNotebookDocumentNotification=p={}));var m;(function(e){e.method=`notebookDocument/didSave`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=u.method})(m||(e.DidSaveNotebookDocumentNotification=m={}));var h;(function(e){e.method=`notebookDocument/didClose`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=u.method})(h||(e.DidCloseNotebookDocumentNotification=h={}))}),Sn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineCompletionRequest=void 0;var t=V(),n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineCompletionRequest=n={}))}),Cn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=V(),n=(It(),a(ce)),r=en(),i=tn();Object.defineProperty(e,`ImplementationRequest`,{enumerable:!0,get:o(function(){return i.ImplementationRequest},`get`)});var s=nn();Object.defineProperty(e,`TypeDefinitionRequest`,{enumerable:!0,get:o(function(){return s.TypeDefinitionRequest},`get`)});var c=rn();Object.defineProperty(e,`WorkspaceFoldersRequest`,{enumerable:!0,get:o(function(){return c.WorkspaceFoldersRequest},`get`)}),Object.defineProperty(e,`DidChangeWorkspaceFoldersNotification`,{enumerable:!0,get:o(function(){return c.DidChangeWorkspaceFoldersNotification},`get`)});var l=an();Object.defineProperty(e,`ConfigurationRequest`,{enumerable:!0,get:o(function(){return l.ConfigurationRequest},`get`)});var u=on();Object.defineProperty(e,`DocumentColorRequest`,{enumerable:!0,get:o(function(){return u.DocumentColorRequest},`get`)}),Object.defineProperty(e,`ColorPresentationRequest`,{enumerable:!0,get:o(function(){return u.ColorPresentationRequest},`get`)});var d=sn();Object.defineProperty(e,`FoldingRangeRequest`,{enumerable:!0,get:o(function(){return d.FoldingRangeRequest},`get`)}),Object.defineProperty(e,`FoldingRangeRefreshRequest`,{enumerable:!0,get:o(function(){return d.FoldingRangeRefreshRequest},`get`)});var f=cn();Object.defineProperty(e,`DeclarationRequest`,{enumerable:!0,get:o(function(){return f.DeclarationRequest},`get`)});var p=ln();Object.defineProperty(e,`SelectionRangeRequest`,{enumerable:!0,get:o(function(){return p.SelectionRangeRequest},`get`)});var m=un();Object.defineProperty(e,`WorkDoneProgress`,{enumerable:!0,get:o(function(){return m.WorkDoneProgress},`get`)}),Object.defineProperty(e,`WorkDoneProgressCreateRequest`,{enumerable:!0,get:o(function(){return m.WorkDoneProgressCreateRequest},`get`)}),Object.defineProperty(e,`WorkDoneProgressCancelNotification`,{enumerable:!0,get:o(function(){return m.WorkDoneProgressCancelNotification},`get`)});var h=dn();Object.defineProperty(e,`CallHierarchyIncomingCallsRequest`,{enumerable:!0,get:o(function(){return h.CallHierarchyIncomingCallsRequest},`get`)}),Object.defineProperty(e,`CallHierarchyOutgoingCallsRequest`,{enumerable:!0,get:o(function(){return h.CallHierarchyOutgoingCallsRequest},`get`)}),Object.defineProperty(e,`CallHierarchyPrepareRequest`,{enumerable:!0,get:o(function(){return h.CallHierarchyPrepareRequest},`get`)});var g=fn();Object.defineProperty(e,`TokenFormat`,{enumerable:!0,get:o(function(){return g.TokenFormat},`get`)}),Object.defineProperty(e,`SemanticTokensRequest`,{enumerable:!0,get:o(function(){return g.SemanticTokensRequest},`get`)}),Object.defineProperty(e,`SemanticTokensDeltaRequest`,{enumerable:!0,get:o(function(){return g.SemanticTokensDeltaRequest},`get`)}),Object.defineProperty(e,`SemanticTokensRangeRequest`,{enumerable:!0,get:o(function(){return g.SemanticTokensRangeRequest},`get`)}),Object.defineProperty(e,`SemanticTokensRefreshRequest`,{enumerable:!0,get:o(function(){return g.SemanticTokensRefreshRequest},`get`)}),Object.defineProperty(e,`SemanticTokensRegistrationType`,{enumerable:!0,get:o(function(){return g.SemanticTokensRegistrationType},`get`)});var _=pn();Object.defineProperty(e,`ShowDocumentRequest`,{enumerable:!0,get:o(function(){return _.ShowDocumentRequest},`get`)});var ee=mn();Object.defineProperty(e,`LinkedEditingRangeRequest`,{enumerable:!0,get:o(function(){return ee.LinkedEditingRangeRequest},`get`)});var v=hn();Object.defineProperty(e,`FileOperationPatternKind`,{enumerable:!0,get:o(function(){return v.FileOperationPatternKind},`get`)}),Object.defineProperty(e,`DidCreateFilesNotification`,{enumerable:!0,get:o(function(){return v.DidCreateFilesNotification},`get`)}),Object.defineProperty(e,`WillCreateFilesRequest`,{enumerable:!0,get:o(function(){return v.WillCreateFilesRequest},`get`)}),Object.defineProperty(e,`DidRenameFilesNotification`,{enumerable:!0,get:o(function(){return v.DidRenameFilesNotification},`get`)}),Object.defineProperty(e,`WillRenameFilesRequest`,{enumerable:!0,get:o(function(){return v.WillRenameFilesRequest},`get`)}),Object.defineProperty(e,`DidDeleteFilesNotification`,{enumerable:!0,get:o(function(){return v.DidDeleteFilesNotification},`get`)}),Object.defineProperty(e,`WillDeleteFilesRequest`,{enumerable:!0,get:o(function(){return v.WillDeleteFilesRequest},`get`)});var y=gn();Object.defineProperty(e,`UniquenessLevel`,{enumerable:!0,get:o(function(){return y.UniquenessLevel},`get`)}),Object.defineProperty(e,`MonikerKind`,{enumerable:!0,get:o(function(){return y.MonikerKind},`get`)}),Object.defineProperty(e,`MonikerRequest`,{enumerable:!0,get:o(function(){return y.MonikerRequest},`get`)});var b=_n();Object.defineProperty(e,`TypeHierarchyPrepareRequest`,{enumerable:!0,get:o(function(){return b.TypeHierarchyPrepareRequest},`get`)}),Object.defineProperty(e,`TypeHierarchySubtypesRequest`,{enumerable:!0,get:o(function(){return b.TypeHierarchySubtypesRequest},`get`)}),Object.defineProperty(e,`TypeHierarchySupertypesRequest`,{enumerable:!0,get:o(function(){return b.TypeHierarchySupertypesRequest},`get`)});var te=vn();Object.defineProperty(e,`InlineValueRequest`,{enumerable:!0,get:o(function(){return te.InlineValueRequest},`get`)}),Object.defineProperty(e,`InlineValueRefreshRequest`,{enumerable:!0,get:o(function(){return te.InlineValueRefreshRequest},`get`)});var x=yn();Object.defineProperty(e,`InlayHintRequest`,{enumerable:!0,get:o(function(){return x.InlayHintRequest},`get`)}),Object.defineProperty(e,`InlayHintResolveRequest`,{enumerable:!0,get:o(function(){return x.InlayHintResolveRequest},`get`)}),Object.defineProperty(e,`InlayHintRefreshRequest`,{enumerable:!0,get:o(function(){return x.InlayHintRefreshRequest},`get`)});var S=bn();Object.defineProperty(e,`DiagnosticServerCancellationData`,{enumerable:!0,get:o(function(){return S.DiagnosticServerCancellationData},`get`)}),Object.defineProperty(e,`DocumentDiagnosticReportKind`,{enumerable:!0,get:o(function(){return S.DocumentDiagnosticReportKind},`get`)}),Object.defineProperty(e,`DocumentDiagnosticRequest`,{enumerable:!0,get:o(function(){return S.DocumentDiagnosticRequest},`get`)}),Object.defineProperty(e,`WorkspaceDiagnosticRequest`,{enumerable:!0,get:o(function(){return S.WorkspaceDiagnosticRequest},`get`)}),Object.defineProperty(e,`DiagnosticRefreshRequest`,{enumerable:!0,get:o(function(){return S.DiagnosticRefreshRequest},`get`)});var C=xn();Object.defineProperty(e,`NotebookCellKind`,{enumerable:!0,get:o(function(){return C.NotebookCellKind},`get`)}),Object.defineProperty(e,`ExecutionSummary`,{enumerable:!0,get:o(function(){return C.ExecutionSummary},`get`)}),Object.defineProperty(e,`NotebookCell`,{enumerable:!0,get:o(function(){return C.NotebookCell},`get`)}),Object.defineProperty(e,`NotebookDocument`,{enumerable:!0,get:o(function(){return C.NotebookDocument},`get`)}),Object.defineProperty(e,`NotebookDocumentSyncRegistrationType`,{enumerable:!0,get:o(function(){return C.NotebookDocumentSyncRegistrationType},`get`)}),Object.defineProperty(e,`DidOpenNotebookDocumentNotification`,{enumerable:!0,get:o(function(){return C.DidOpenNotebookDocumentNotification},`get`)}),Object.defineProperty(e,`NotebookCellArrayChange`,{enumerable:!0,get:o(function(){return C.NotebookCellArrayChange},`get`)}),Object.defineProperty(e,`DidChangeNotebookDocumentNotification`,{enumerable:!0,get:o(function(){return C.DidChangeNotebookDocumentNotification},`get`)}),Object.defineProperty(e,`DidSaveNotebookDocumentNotification`,{enumerable:!0,get:o(function(){return C.DidSaveNotebookDocumentNotification},`get`)}),Object.defineProperty(e,`DidCloseNotebookDocumentNotification`,{enumerable:!0,get:o(function(){return C.DidCloseNotebookDocumentNotification},`get`)});var ne=Sn();Object.defineProperty(e,`InlineCompletionRequest`,{enumerable:!0,get:o(function(){return ne.InlineCompletionRequest},`get`)});var w;(function(e){function t(e){let t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}o(t,`is`),e.is=t})(w||(e.TextDocumentFilter=w={}));var T;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}o(t,`is`),e.is=t})(T||(e.NotebookDocumentFilter=T={}));var E;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||T.is(t.notebook))&&(t.language===void 0||r.string(t.language))}o(t,`is`),e.is=t})(E||(e.NotebookCellTextDocumentFilter=E={}));var D;(function(e){function t(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!w.is(t)&&!E.is(t))return!1;return!0}o(t,`is`),e.is=t})(D||(e.DocumentSelector=D={}));var O;(function(e){e.method=`client/registerCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(O||(e.RegistrationRequest=O={}));var re;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(re||(e.UnregistrationRequest=re={}));var k;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(k||(e.ResourceOperationKind=k={}));var A;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(A||(e.FailureHandlingKind=A={}));var j;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(j||(e.PositionEncodingKind=j={}));var M;(function(e){function t(e){let t=e;return t&&r.string(t.id)&&t.id.length>0}o(t,`hasId`),e.hasId=t})(M||(e.StaticRegistrationOptions=M={}));var ie;(function(e){function t(e){let t=e;return t&&(t.documentSelector===null||D.is(t.documentSelector))}o(t,`is`),e.is=t})(ie||(e.TextDocumentRegistrationOptions=ie={}));var ae;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(t.workDoneProgress===void 0||r.boolean(t.workDoneProgress))}o(t,`is`),e.is=t;function n(e){let t=e;return t&&r.boolean(t.workDoneProgress)}o(n,`hasWorkDoneProgress`),e.hasWorkDoneProgress=n})(ae||(e.WorkDoneProgressOptions=ae={}));var oe;(function(e){e.method=`initialize`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(oe||(e.InitializeRequest=oe={}));var N;(function(e){e.unknownProtocolVersion=1})(N||(e.InitializeErrorCodes=N={}));var P;(function(e){e.method=`initialized`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(P||(e.InitializedNotification=P={}));var F;(function(e){e.method=`shutdown`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)})(F||(e.ShutdownRequest=F={}));var I;(function(e){e.method=`exit`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)})(I||(e.ExitNotification=I={}));var se;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(se||(e.DidChangeConfigurationNotification=se={}));var le;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(le||(e.MessageType=le={}));var ue;(function(e){e.method=`window/showMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(ue||(e.ShowMessageNotification=ue={}));var de;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(de||(e.ShowMessageRequest=de={}));var fe;(function(e){e.method=`window/logMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(fe||(e.LogMessageNotification=fe={}));var L;(function(e){e.method=`telemetry/event`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(L||(e.TelemetryEventNotification=L={}));var R;(function(e){e.None=0,e.Full=1,e.Incremental=2})(R||(e.TextDocumentSyncKind=R={}));var pe;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(pe||(e.DidOpenTextDocumentNotification=pe={}));var me;(function(e){function t(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}o(t,`isIncremental`),e.isIncremental=t;function n(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}o(n,`isFull`),e.isFull=n})(me||(e.TextDocumentContentChangeEvent=me={}));var he;(function(e){e.method=`textDocument/didChange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(he||(e.DidChangeTextDocumentNotification=he={}));var ge;(function(e){e.method=`textDocument/didClose`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ge||(e.DidCloseTextDocumentNotification=ge={}));var _e;(function(e){e.method=`textDocument/didSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(_e||(e.DidSaveTextDocumentNotification=_e={}));var ve;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(ve||(e.TextDocumentSaveReason=ve={}));var ye;(function(e){e.method=`textDocument/willSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ye||(e.WillSaveTextDocumentNotification=ye={}));var be;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(be||(e.WillSaveTextDocumentWaitUntilRequest=be={}));var xe;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(xe||(e.DidChangeWatchedFilesNotification=xe={}));var Se;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(Se||(e.FileChangeType=Se={}));var Ce;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}o(t,`is`),e.is=t})(Ce||(e.RelativePattern=Ce={}));var we;(function(e){e.Create=1,e.Change=2,e.Delete=4})(we||(e.WatchKind=we={}));var Te;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Te||(e.PublishDiagnosticsNotification=Te={}));var Ee;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Ee||(e.CompletionTriggerKind=Ee={}));var De;(function(e){e.method=`textDocument/completion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(De||(e.CompletionRequest=De={}));var z;(function(e){e.method=`completionItem/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(z||(e.CompletionResolveRequest=z={}));var Oe;(function(e){e.method=`textDocument/hover`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Oe||(e.HoverRequest=Oe={}));var ke;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(ke||(e.SignatureHelpTriggerKind=ke={}));var Ae;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ae||(e.SignatureHelpRequest=Ae={}));var je;(function(e){e.method=`textDocument/definition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(je||(e.DefinitionRequest=je={}));var Me;(function(e){e.method=`textDocument/references`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Me||(e.ReferencesRequest=Me={}));var Ne;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ne||(e.DocumentHighlightRequest=Ne={}));var Pe;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Pe||(e.DocumentSymbolRequest=Pe={}));var Fe;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Fe||(e.CodeActionRequest=Fe={}));var Ie;(function(e){e.method=`codeAction/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ie||(e.CodeActionResolveRequest=Ie={}));var Le;(function(e){e.method=`workspace/symbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Le||(e.WorkspaceSymbolRequest=Le={}));var Re;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Re||(e.WorkspaceSymbolResolveRequest=Re={}));var ze;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ze||(e.CodeLensRequest=ze={}));var Be;(function(e){e.method=`codeLens/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Be||(e.CodeLensResolveRequest=Be={}));var Ve;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(Ve||(e.CodeLensRefreshRequest=Ve={}));var He;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(He||(e.DocumentLinkRequest=He={}));var Ue;(function(e){e.method=`documentLink/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ue||(e.DocumentLinkResolveRequest=Ue={}));var We;(function(e){e.method=`textDocument/formatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(We||(e.DocumentFormattingRequest=We={}));var Ge;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ge||(e.DocumentRangeFormattingRequest=Ge={}));var Ke;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ke||(e.DocumentRangesFormattingRequest=Ke={}));var qe;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(qe||(e.DocumentOnTypeFormattingRequest=qe={}));var Je;(function(e){e.Identifier=1})(Je||(e.PrepareSupportDefaultBehavior=Je={}));var Ye;(function(e){e.method=`textDocument/rename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ye||(e.RenameRequest=Ye={}));var Xe;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Xe||(e.PrepareRenameRequest=Xe={}));var Ze;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ze||(e.ExecuteCommandRequest=Ze={}));var Qe;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(`workspace/applyEdit`)})(Qe||(e.ApplyWorkspaceEditRequest=Qe={}))}),wn=i(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createProtocolConnection=void 0;var t=Qt();function n(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}o(n,`createProtocolConnection`),e.createProtocolConnection=n}),Tn=i(e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(Qt(),e),n((It(),a(ce)),e),n(V(),e),n(Cn(),e);var r=wn();Object.defineProperty(e,`createProtocolConnection`,{enumerable:!0,get:o(function(){return r.createProtocolConnection},`get`)});var i;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))}),En=i(e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.createProtocolConnection=void 0;var r=$t();n($t(),e),n(Tn(),e);function i(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}o(i,`createProtocolConnection`),e.createProtocolConnection=i}),Dn={};t(Dn,{AbstractAstReflection:()=>Nn,AbstractCstNode:()=>_f,AbstractLangiumParser:()=>Ef,AbstractParserErrorMessageProvider:()=>Of,AbstractThreadedAsyncParser:()=>Xm,AstUtils:()=>Wn,BiMap:()=>Np,Cancellation:()=>Z,CompositeCstNodeImpl:()=>yf,ContextCache:()=>Vp,CstNodeBuilder:()=>gf,CstUtils:()=>On,DEFAULT_TOKENIZE_OPTIONS:()=>hm,DONE_RESULT:()=>Vn,DatatypeSymbol:()=>Sf,DefaultAstNodeDescriptionProvider:()=>im,DefaultAstNodeLocator:()=>om,DefaultAsyncParser:()=>Ym,DefaultCommentProvider:()=>Jm,DefaultConfigurationProvider:()=>cm,DefaultDocumentBuilder:()=>dm,DefaultDocumentValidator:()=>$p,DefaultHydrator:()=>$m,DefaultIndexManager:()=>fm,DefaultJsonSerializer:()=>qp,DefaultLangiumDocumentFactory:()=>Tp,DefaultLangiumDocuments:()=>Ep,DefaultLangiumProfiler:()=>xh,DefaultLexer:()=>gm,DefaultLexerErrorMessageProvider:()=>mm,DefaultLinker:()=>Op,DefaultNameProvider:()=>Ap,DefaultReferenceDescriptionProvider:()=>am,DefaultReferences:()=>jp,DefaultScopeComputation:()=>Pp,DefaultScopeProvider:()=>Wp,DefaultServiceRegistry:()=>Jp,DefaultTokenBuilder:()=>tp,DefaultValueConverter:()=>np,DefaultWorkspaceLock:()=>Qm,DefaultWorkspaceManager:()=>pm,Deferred:()=>fp,Disposable:()=>um,DisposableCache:()=>zp,DocumentCache:()=>Hp,DocumentState:()=>Q,DocumentValidator:()=>rm,EMPTY_SCOPE:()=>Rp,EMPTY_STREAM:()=>Bn,EmptyFileSystem:()=>gh,EmptyFileSystemProvider:()=>hh,ErrorWithLocation:()=>Ta,GrammarAST:()=>ar,GrammarUtils:()=>wa,IndentationAwareLexer:()=>ph,IndentationAwareTokenBuilder:()=>fh,JSDocDocumentationProvider:()=>qm,LangiumCompletionParser:()=>Af,LangiumParser:()=>Df,LangiumParserErrorMessageProvider:()=>kf,LeafCstNodeImpl:()=>vf,LexingMode:()=>dh,MapScope:()=>Ip,Module:()=>nh,MultiMap:()=>Mp,MultiMapScope:()=>Lp,OperationCancelled:()=>lp,ParserWorker:()=>Zm,ProfilingTask:()=>Sh,Reduction:()=>Un,RefResolving:()=>Dp,RegExpUtils:()=>Oa,RootCstNodeImpl:()=>xf,SimpleCache:()=>Bp,StreamImpl:()=>Ln,StreamScope:()=>Fp,TextDocument:()=>mp,TreeStreamImpl:()=>Hn,URI:()=>xp,UriTrie:()=>wp,UriUtils:()=>Cp,VALIDATE_EACH_NODE:()=>Qp,ValidationCategory:()=>Xp,ValidationRegistry:()=>Zp,ValueConverter:()=>rp,WorkspaceCache:()=>Up,assertCondition:()=>Da,assertUnreachable:()=>Ea,createCompletionParser:()=>Qf,createDefaultCoreModule:()=>eh,createDefaultSharedCoreModule:()=>th,createGrammarConfig:()=>Ro,createLangiumParser:()=>$f,createParser:()=>Pf,delayNextTick:()=>ip,diagnosticData:()=>Yp,eagerLoad:()=>ah,getDiagnosticRange:()=>em,indentationBuilderDefaultOptions:()=>uh,inject:()=>rh,interruptAndCheck:()=>dp,isAstNode:()=>H,isAstNodeDescription:()=>jn,isAstNodeWithComment:()=>Gp,isCompositeCstNode:()=>Pn,isIMultiModeLexerDefinition:()=>vm,isJSDoc:()=>xm,isLeafCstNode:()=>Fn,isLinkingError:()=>Mn,isMultiReference:()=>An,isNamed:()=>kp,isOperationCancelled:()=>up,isReference:()=>kn,isRootCstNode:()=>In,isTokenTypeArray:()=>_m,isTokenTypeDictionary:()=>ym,loadGrammarFromJson:()=>bh,parseJSDoc:()=>bm,prepareLangiumParser:()=>ep,setInterruptionPeriod:()=>cp,startCancelableOperation:()=>sp,stream:()=>U,toDiagnosticData:()=>nm,toDiagnosticSeverity:()=>tm});var On={};t(On,{DefaultNameRegexp:()=>da,RangeComparison:()=>ca,compareRange:()=>la,findCommentNode:()=>pa,findDeclarationNodeAtOffset:()=>fa,findLeafNodeAtOffset:()=>ha,findLeafNodeBeforeOffset:()=>ga,flattenCst:()=>ia,getDatatypeNode:()=>na,getInteriorNodes:()=>xa,getNextNode:()=>ya,getPreviousNode:()=>va,getStartlineNode:()=>ba,inRange:()=>ua,isChildNode:()=>aa,isCommentNode:()=>ma,streamCst:()=>ra,toDocumentSegment:()=>sa,tokenToRange:()=>oa});function H(e){return typeof e==`object`&&!!e&&typeof e.$type==`string`}o(H,`isAstNode`);function kn(e){return typeof e==`object`&&!!e&&typeof e.$refText==`string`&&`ref`in e}o(kn,`isReference`);function An(e){return typeof e==`object`&&!!e&&typeof e.$refText==`string`&&`items`in e}o(An,`isMultiReference`);function jn(e){return typeof e==`object`&&!!e&&typeof e.name==`string`&&typeof e.type==`string`&&typeof e.path==`string`}o(jn,`isAstNodeDescription`);function Mn(e){return typeof e==`object`&&!!e&&typeof e.info==`object`&&typeof e.message==`string`}o(Mn,`isLinkingError`);var Nn=class{static{o(this,`AbstractAstReflection`)}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let t=this.types[e.container.$type];if(!t)throw Error(`Type ${e.container.$type||`undefined`} not found.`);let n=t.properties[e.property]?.referenceType;if(!n)throw Error(`Property ${e.property||`undefined`} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){return this.types[e]||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return H(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||=this.subtypes[e]={};let r=n[t];if(r!==void 0)return r;{let r=this.types[e],i=r?r.superTypes.some(e=>this.isSubtype(e,t)):!1;return n[t]=i,i}}getAllSubTypes(e){let t=this.allSubtypes[e];if(t)return t;{let t=this.getAllTypes(),n=[];for(let r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}};function Pn(e){return typeof e==`object`&&!!e&&Array.isArray(e.content)}o(Pn,`isCompositeCstNode`);function Fn(e){return typeof e==`object`&&!!e&&typeof e.tokenType==`object`}o(Fn,`isLeafCstNode`);function In(e){return Pn(e)&&typeof e.fullText==`string`}o(In,`isRootCstNode`);var Ln=class e{static{o(this,`StreamImpl`)}constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),`next`),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){let e=[],t=this.iterator(),n;do n=t.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){let n=this.map(n=>[e?e(n):n,t?t(n):n]);return new Map(n)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),e=>{let t;if(!e.firstDone){do if(t=this.nextFn(e.first),!t.done)return t;while(!t.done);e.firstDone=!0}do if(t=e.iterator.next(),!t.done)return t;while(!t.done);return Vn})}join(e=`,`){let t=this.iterator(),n=``,r,i=!1;do r=t.next(),r.done||(i&&(n+=e),n+=Rn(r.value)),i=!0;while(!r.done);return n}indexOf(e,t=0){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(t){return new e(this.startFn,e=>{let{done:n,value:r}=this.nextFn(e);return n?Vn:{done:!1,value:t(r)}})}filter(t){return new e(this.startFn,e=>{let n;do if(n=this.nextFn(e),!n.done&&t(n.value))return n;while(!n.done);return Vn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,t){let n=this.iterator(),r=t,i=n.next();for(;!i.done;)r=r===void 0?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){let r=e.next();if(r.done)return n;let i=this.recursiveReduce(e,t,n);return i===void 0?r.value:t(i,r.value)}find(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){let t=this.iterator(),n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),e=>{do{if(e.iterator){let t=e.iterator.next();if(t.done)e.iterator=void 0;else return t}let{done:n,value:r}=this.nextFn(e.this);if(!n){let n=t(r);if(zn(n))e.iterator=n[Symbol.iterator]();else return{done:!1,value:n}}}while(e.iterator);return Vn})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),e=>{do{if(e.iterator){let t=e.iterator.next();if(t.done)e.iterator=void 0;else return t}let{done:t,value:r}=n.nextFn(e.this);if(!t)if(zn(r))e.iterator=r[Symbol.iterator]();else return{done:!1,value:r}}while(e.iterator);return Vn})}head(){let e=this.iterator().next();if(!e.done)return e.value}tail(t=1){return new e(()=>{let e=this.startFn();for(let n=0;n<t;n++)if(this.nextFn(e).done)return e;return e},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),e=>(e.size++,e.size>t?Vn:this.nextFn(e.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),e=>{let n;do if(n=this.nextFn(e.internalState),!n.done){let r=t?t(n.value):n.value;if(!e.set.has(r))return e.set.add(r),n}while(!n.done);return Vn})}exclude(e,t){let n=new Set;for(let r of e){let e=t?t(r):r;n.add(e)}return this.filter(e=>{let r=t?t(e):e;return!n.has(r)})}};function Rn(e){return typeof e==`string`?e:typeof e>`u`?`undefined`:typeof e.toString==`function`?e.toString():Object.prototype.toString.call(e)}o(Rn,`toString`);function zn(e){return!!e&&typeof e[Symbol.iterator]==`function`}o(zn,`isIterable`);var Bn=new Ln(()=>{},()=>Vn),Vn=Object.freeze({done:!0,value:void 0});function U(...e){if(e.length===1){let t=e[0];if(t instanceof Ln)return t;if(zn(t))return new Ln(()=>t[Symbol.iterator](),e=>e.next());if(typeof t.length==`number`)return new Ln(()=>({index:0}),e=>e.index<t.length?{done:!1,value:t[e.index++]}:Vn)}return e.length>1?new Ln(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];zn(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length==`number`&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return Vn}):Bn}o(U,`stream`);var Hn=class extends Ln{static{o(this,`TreeStreamImpl`)}constructor(e,t,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),e=>{for(e.pruned&&=(e.iterators.pop(),!1);e.iterators.length>0;){let n=e.iterators[e.iterators.length-1].next();if(n.done)e.iterators.pop();else return e.iterators.push(t(n.value)[Symbol.iterator]()),n}return Vn})}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),`next`),prune:o(()=>{e.state.pruned=!0},`prune`),[Symbol.iterator]:()=>e};return e}},Un;(function(e){function t(e){return e.reduce((e,t)=>e+t,0)}o(t,`sum`),e.sum=t;function n(e){return e.reduce((e,t)=>e*t,0)}o(n,`product`),e.product=n;function r(e){return e.reduce((e,t)=>Math.min(e,t))}o(r,`min`),e.min=r;function i(e){return e.reduce((e,t)=>Math.max(e,t))}o(i,`max`),e.max=i})(Un||={});var Wn={};t(Wn,{assignMandatoryProperties:()=>nr,copyAstNode:()=>ir,findRootNode:()=>Yn,getContainerOfType:()=>Kn,getDocument:()=>Jn,getReferenceNodes:()=>Xn,hasContainerOfType:()=>qn,linkContentToContainer:()=>Gn,streamAllContents:()=>Qn,streamAst:()=>$n,streamContents:()=>Zn,streamReferences:()=>tr});function Gn(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith(`$`)||(Array.isArray(r)?r.forEach((r,i)=>{H(r)&&(r.$container=e,r.$containerProperty=n,r.$containerIndex=i,t.deep&&Gn(r,t))}):H(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Gn(r,t)))}o(Gn,`linkContentToContainer`);function Kn(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}o(Kn,`getContainerOfType`);function qn(e,t){let n=e;for(;n;){if(t(n))return!0;n=n.$container}return!1}o(qn,`hasContainerOfType`);function Jn(e){let t=Yn(e).$document;if(!t)throw Error(`AST node has no document.`);return t}o(Jn,`getDocument`);function Yn(e){for(;e.$container;)e=e.$container;return e}o(Yn,`findRootNode`);function Xn(e){return kn(e)?e.ref?[e.ref]:[]:An(e)?e.items.map(e=>e.ref):[]}o(Xn,`getReferenceNodes`);function Zn(e,t){if(!e)throw Error(`Node must be an AstNode.`);let n=t?.range;return new Ln(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let r=t.keys[t.keyIndex];if(!r.startsWith(`$`)){let i=e[r];if(H(i)){if(t.keyIndex++,er(i,n))return{done:!1,value:i}}else if(Array.isArray(i)){for(;t.arrayIndex<i.length;){let e=i[t.arrayIndex++];if(H(e)&&er(e,n))return{done:!1,value:e}}t.arrayIndex=0}}t.keyIndex++}return Vn})}o(Zn,`streamContents`);function Qn(e,t){if(!e)throw Error(`Root node must be an AstNode.`);return new Hn(e,e=>Zn(e,t))}o(Qn,`streamAllContents`);function $n(e,t){if(e){if(t?.range&&!er(e,t.range))return new Hn(e,()=>[])}else throw Error(`Root node must be an AstNode.`);return new Hn(e,e=>Zn(e,t),{includeRoot:!0})}o($n,`streamAst`);function er(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?ua(n,t):!1}o(er,`isAstNodeInRange`);function tr(e){return new Ln(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith(`$`)){let r=e[n];if(kn(r)||An(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,a=r[i];if(kn(a)||An(r))return{done:!1,value:{reference:a,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return Vn})}o(tr,`streamReferences`);function nr(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let e of Object.values(n.properties))e.defaultValue!==void 0&&r[e.name]===void 0&&(r[e.name]=rr(e.defaultValue))}o(nr,`assignMandatoryProperties`);function rr(e){return Array.isArray(e)?[...e.map(rr)]:e}o(rr,`copyDefaultValue`);function ir(e,t,n){let r={$type:e.$type};n&&(n.set(e,r),n.set(r,e));for(let[i,a]of Object.entries(e))if(!i.startsWith(`$`))if(H(a))r[i]=ir(a,t,n);else if(kn(a))r[i]=t(r,i,a.$refNode,a.$refText,a);else if(Array.isArray(a)){let e=[];for(let o of a)H(o)?e.push(ir(o,t,n)):kn(o)?e.push(t(r,i,o.$refNode,o.$refText,o)):e.push(o);r[i]=e}else r[i]=a;return Gn(r,{deep:!0}),r}o(ir,`copyAstNode`);var ar={};t(ar,{AbstractElement:()=>sr,AbstractParserRule:()=>lr,AbstractRule:()=>dr,AbstractType:()=>pr,Action:()=>hr,Alternatives:()=>_r,ArrayLiteral:()=>yr,ArrayType:()=>xr,Assignment:()=>Cr,BooleanLiteral:()=>Tr,CharacterRange:()=>Dr,Condition:()=>kr,Conjunction:()=>jr,CrossReference:()=>Nr,Disjunction:()=>Fr,EndOfFile:()=>Lr,Grammar:()=>zr,GrammarImport:()=>Vr,Group:()=>Ur,InferredType:()=>Gr,InfixRule:()=>qr,InfixRuleOperatorList:()=>Yr,InfixRuleOperators:()=>Zr,Interface:()=>$r,Keyword:()=>ti,LangiumGrammarAstReflection:()=>ta,LangiumGrammarTerminals:()=>or,NamedArgument:()=>ri,NegatedToken:()=>ai,Negation:()=>si,NumberLiteral:()=>li,Parameter:()=>di,ParameterReference:()=>pi,ParserRule:()=>hi,ReferenceType:()=>_i,RegexToken:()=>yi,ReturnType:()=>xi,RuleCall:()=>Ci,SimpleType:()=>Ti,StringLiteral:()=>Di,TerminalAlternatives:()=>ki,TerminalElement:()=>ji,TerminalGroup:()=>Ni,TerminalRule:()=>Fi,TerminalRuleCall:()=>Li,Type:()=>zi,TypeAttribute:()=>Vi,TypeDefinition:()=>Ui,UnionType:()=>Gi,UnorderedGroup:()=>qi,UntilToken:()=>Yi,ValueLiteral:()=>Zi,Wildcard:()=>$i,isAbstractElement:()=>cr,isAbstractParserRule:()=>ur,isAbstractRule:()=>fr,isAbstractType:()=>mr,isAction:()=>gr,isAlternatives:()=>vr,isArrayLiteral:()=>br,isArrayType:()=>Sr,isAssignment:()=>wr,isBooleanLiteral:()=>Er,isCharacterRange:()=>Or,isCondition:()=>Ar,isConjunction:()=>Mr,isCrossReference:()=>Pr,isDisjunction:()=>Ir,isEndOfFile:()=>Rr,isGrammar:()=>Br,isGrammarImport:()=>Hr,isGroup:()=>Wr,isInferredType:()=>Kr,isInfixRule:()=>Jr,isInfixRuleOperatorList:()=>Xr,isInfixRuleOperators:()=>Qr,isInterface:()=>ei,isKeyword:()=>ni,isNamedArgument:()=>ii,isNegatedToken:()=>oi,isNegation:()=>ci,isNumberLiteral:()=>ui,isParameter:()=>fi,isParameterReference:()=>mi,isParserRule:()=>gi,isReferenceType:()=>vi,isRegexToken:()=>bi,isReturnType:()=>Si,isRuleCall:()=>wi,isSimpleType:()=>Ei,isStringLiteral:()=>Oi,isTerminalAlternatives:()=>Ai,isTerminalElement:()=>Mi,isTerminalGroup:()=>Pi,isTerminalRule:()=>Ii,isTerminalRuleCall:()=>Ri,isType:()=>Bi,isTypeAttribute:()=>Hi,isTypeDefinition:()=>Wi,isUnionType:()=>Ki,isUnorderedGroup:()=>Ji,isUntilToken:()=>Xi,isValueLiteral:()=>Qi,isWildcard:()=>ea,reflection:()=>W});var or={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},sr={$type:`AbstractElement`,cardinality:`cardinality`};function cr(e){return W.isInstance(e,sr.$type)}o(cr,`isAbstractElement`);var lr={$type:`AbstractParserRule`};function ur(e){return W.isInstance(e,lr.$type)}o(ur,`isAbstractParserRule`);var dr={$type:`AbstractRule`};function fr(e){return W.isInstance(e,dr.$type)}o(fr,`isAbstractRule`);var pr={$type:`AbstractType`};function mr(e){return W.isInstance(e,pr.$type)}o(mr,`isAbstractType`);var hr={$type:`Action`,cardinality:`cardinality`,feature:`feature`,inferredType:`inferredType`,operator:`operator`,type:`type`};function gr(e){return W.isInstance(e,hr.$type)}o(gr,`isAction`);var _r={$type:`Alternatives`,cardinality:`cardinality`,elements:`elements`};function vr(e){return W.isInstance(e,_r.$type)}o(vr,`isAlternatives`);var yr={$type:`ArrayLiteral`,elements:`elements`};function br(e){return W.isInstance(e,yr.$type)}o(br,`isArrayLiteral`);var xr={$type:`ArrayType`,elementType:`elementType`};function Sr(e){return W.isInstance(e,xr.$type)}o(Sr,`isArrayType`);var Cr={$type:`Assignment`,cardinality:`cardinality`,feature:`feature`,operator:`operator`,predicate:`predicate`,terminal:`terminal`};function wr(e){return W.isInstance(e,Cr.$type)}o(wr,`isAssignment`);var Tr={$type:`BooleanLiteral`,true:`true`};function Er(e){return W.isInstance(e,Tr.$type)}o(Er,`isBooleanLiteral`);var Dr={$type:`CharacterRange`,cardinality:`cardinality`,left:`left`,lookahead:`lookahead`,parenthesized:`parenthesized`,right:`right`};function Or(e){return W.isInstance(e,Dr.$type)}o(Or,`isCharacterRange`);var kr={$type:`Condition`};function Ar(e){return W.isInstance(e,kr.$type)}o(Ar,`isCondition`);var jr={$type:`Conjunction`,left:`left`,right:`right`};function Mr(e){return W.isInstance(e,jr.$type)}o(Mr,`isConjunction`);var Nr={$type:`CrossReference`,cardinality:`cardinality`,deprecatedSyntax:`deprecatedSyntax`,isMulti:`isMulti`,terminal:`terminal`,type:`type`};function Pr(e){return W.isInstance(e,Nr.$type)}o(Pr,`isCrossReference`);var Fr={$type:`Disjunction`,left:`left`,right:`right`};function Ir(e){return W.isInstance(e,Fr.$type)}o(Ir,`isDisjunction`);var Lr={$type:`EndOfFile`,cardinality:`cardinality`};function Rr(e){return W.isInstance(e,Lr.$type)}o(Rr,`isEndOfFile`);var zr={$type:`Grammar`,imports:`imports`,interfaces:`interfaces`,isDeclared:`isDeclared`,name:`name`,rules:`rules`,types:`types`};function Br(e){return W.isInstance(e,zr.$type)}o(Br,`isGrammar`);var Vr={$type:`GrammarImport`,path:`path`};function Hr(e){return W.isInstance(e,Vr.$type)}o(Hr,`isGrammarImport`);var Ur={$type:`Group`,cardinality:`cardinality`,elements:`elements`,guardCondition:`guardCondition`,predicate:`predicate`};function Wr(e){return W.isInstance(e,Ur.$type)}o(Wr,`isGroup`);var Gr={$type:`InferredType`,name:`name`};function Kr(e){return W.isInstance(e,Gr.$type)}o(Kr,`isInferredType`);var qr={$type:`InfixRule`,call:`call`,dataType:`dataType`,inferredType:`inferredType`,name:`name`,operators:`operators`,parameters:`parameters`,returnType:`returnType`};function Jr(e){return W.isInstance(e,qr.$type)}o(Jr,`isInfixRule`);var Yr={$type:`InfixRuleOperatorList`,associativity:`associativity`,operators:`operators`};function Xr(e){return W.isInstance(e,Yr.$type)}o(Xr,`isInfixRuleOperatorList`);var Zr={$type:`InfixRuleOperators`,precedences:`precedences`};function Qr(e){return W.isInstance(e,Zr.$type)}o(Qr,`isInfixRuleOperators`);var $r={$type:`Interface`,attributes:`attributes`,name:`name`,superTypes:`superTypes`};function ei(e){return W.isInstance(e,$r.$type)}o(ei,`isInterface`);var ti={$type:`Keyword`,cardinality:`cardinality`,predicate:`predicate`,value:`value`};function ni(e){return W.isInstance(e,ti.$type)}o(ni,`isKeyword`);var ri={$type:`NamedArgument`,calledByName:`calledByName`,parameter:`parameter`,value:`value`};function ii(e){return W.isInstance(e,ri.$type)}o(ii,`isNamedArgument`);var ai={$type:`NegatedToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,terminal:`terminal`};function oi(e){return W.isInstance(e,ai.$type)}o(oi,`isNegatedToken`);var si={$type:`Negation`,value:`value`};function ci(e){return W.isInstance(e,si.$type)}o(ci,`isNegation`);var li={$type:`NumberLiteral`,value:`value`};function ui(e){return W.isInstance(e,li.$type)}o(ui,`isNumberLiteral`);var di={$type:`Parameter`,name:`name`};function fi(e){return W.isInstance(e,di.$type)}o(fi,`isParameter`);var pi={$type:`ParameterReference`,parameter:`parameter`};function mi(e){return W.isInstance(e,pi.$type)}o(mi,`isParameterReference`);var hi={$type:`ParserRule`,dataType:`dataType`,definition:`definition`,entry:`entry`,fragment:`fragment`,inferredType:`inferredType`,name:`name`,parameters:`parameters`,returnType:`returnType`};function gi(e){return W.isInstance(e,hi.$type)}o(gi,`isParserRule`);var _i={$type:`ReferenceType`,isMulti:`isMulti`,referenceType:`referenceType`};function vi(e){return W.isInstance(e,_i.$type)}o(vi,`isReferenceType`);var yi={$type:`RegexToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,regex:`regex`};function bi(e){return W.isInstance(e,yi.$type)}o(bi,`isRegexToken`);var xi={$type:`ReturnType`,name:`name`};function Si(e){return W.isInstance(e,xi.$type)}o(Si,`isReturnType`);var Ci={$type:`RuleCall`,arguments:`arguments`,cardinality:`cardinality`,predicate:`predicate`,rule:`rule`};function wi(e){return W.isInstance(e,Ci.$type)}o(wi,`isRuleCall`);var Ti={$type:`SimpleType`,primitiveType:`primitiveType`,stringType:`stringType`,typeRef:`typeRef`};function Ei(e){return W.isInstance(e,Ti.$type)}o(Ei,`isSimpleType`);var Di={$type:`StringLiteral`,value:`value`};function Oi(e){return W.isInstance(e,Di.$type)}o(Oi,`isStringLiteral`);var ki={$type:`TerminalAlternatives`,cardinality:`cardinality`,elements:`elements`,lookahead:`lookahead`,parenthesized:`parenthesized`};function Ai(e){return W.isInstance(e,ki.$type)}o(Ai,`isTerminalAlternatives`);var ji={$type:`TerminalElement`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`};function Mi(e){return W.isInstance(e,ji.$type)}o(Mi,`isTerminalElement`);var Ni={$type:`TerminalGroup`,cardinality:`cardinality`,elements:`elements`,lookahead:`lookahead`,parenthesized:`parenthesized`};function Pi(e){return W.isInstance(e,Ni.$type)}o(Pi,`isTerminalGroup`);var Fi={$type:`TerminalRule`,definition:`definition`,fragment:`fragment`,hidden:`hidden`,name:`name`,type:`type`};function Ii(e){return W.isInstance(e,Fi.$type)}o(Ii,`isTerminalRule`);var Li={$type:`TerminalRuleCall`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,rule:`rule`};function Ri(e){return W.isInstance(e,Li.$type)}o(Ri,`isTerminalRuleCall`);var zi={$type:`Type`,name:`name`,type:`type`};function Bi(e){return W.isInstance(e,zi.$type)}o(Bi,`isType`);var Vi={$type:`TypeAttribute`,defaultValue:`defaultValue`,isOptional:`isOptional`,name:`name`,type:`type`};function Hi(e){return W.isInstance(e,Vi.$type)}o(Hi,`isTypeAttribute`);var Ui={$type:`TypeDefinition`};function Wi(e){return W.isInstance(e,Ui.$type)}o(Wi,`isTypeDefinition`);var Gi={$type:`UnionType`,types:`types`};function Ki(e){return W.isInstance(e,Gi.$type)}o(Ki,`isUnionType`);var qi={$type:`UnorderedGroup`,cardinality:`cardinality`,elements:`elements`};function Ji(e){return W.isInstance(e,qi.$type)}o(Ji,`isUnorderedGroup`);var Yi={$type:`UntilToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,terminal:`terminal`};function Xi(e){return W.isInstance(e,Yi.$type)}o(Xi,`isUntilToken`);var Zi={$type:`ValueLiteral`};function Qi(e){return W.isInstance(e,Zi.$type)}o(Qi,`isValueLiteral`);var $i={$type:`Wildcard`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`};function ea(e){return W.isInstance(e,$i.$type)}o(ea,`isWildcard`);var ta=class extends Nn{static{o(this,`LangiumGrammarAstReflection`)}constructor(){super(...arguments),this.types={AbstractElement:{name:sr.$type,properties:{cardinality:{name:sr.cardinality}},superTypes:[]},AbstractParserRule:{name:lr.$type,properties:{},superTypes:[dr.$type,pr.$type]},AbstractRule:{name:dr.$type,properties:{},superTypes:[]},AbstractType:{name:pr.$type,properties:{},superTypes:[]},Action:{name:hr.$type,properties:{cardinality:{name:hr.cardinality},feature:{name:hr.feature},inferredType:{name:hr.inferredType},operator:{name:hr.operator},type:{name:hr.type,referenceType:pr.$type}},superTypes:[sr.$type]},Alternatives:{name:_r.$type,properties:{cardinality:{name:_r.cardinality},elements:{name:_r.elements,defaultValue:[]}},superTypes:[sr.$type]},ArrayLiteral:{name:yr.$type,properties:{elements:{name:yr.elements,defaultValue:[]}},superTypes:[Zi.$type]},ArrayType:{name:xr.$type,properties:{elementType:{name:xr.elementType}},superTypes:[Ui.$type]},Assignment:{name:Cr.$type,properties:{cardinality:{name:Cr.cardinality},feature:{name:Cr.feature},operator:{name:Cr.operator},predicate:{name:Cr.predicate},terminal:{name:Cr.terminal}},superTypes:[sr.$type]},BooleanLiteral:{name:Tr.$type,properties:{true:{name:Tr.true,defaultValue:!1}},superTypes:[kr.$type,Zi.$type]},CharacterRange:{name:Dr.$type,properties:{cardinality:{name:Dr.cardinality},left:{name:Dr.left},lookahead:{name:Dr.lookahead},parenthesized:{name:Dr.parenthesized,defaultValue:!1},right:{name:Dr.right}},superTypes:[ji.$type]},Condition:{name:kr.$type,properties:{},superTypes:[]},Conjunction:{name:jr.$type,properties:{left:{name:jr.left},right:{name:jr.right}},superTypes:[kr.$type]},CrossReference:{name:Nr.$type,properties:{cardinality:{name:Nr.cardinality},deprecatedSyntax:{name:Nr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Nr.isMulti,defaultValue:!1},terminal:{name:Nr.terminal},type:{name:Nr.type,referenceType:pr.$type}},superTypes:[sr.$type]},Disjunction:{name:Fr.$type,properties:{left:{name:Fr.left},right:{name:Fr.right}},superTypes:[kr.$type]},EndOfFile:{name:Lr.$type,properties:{cardinality:{name:Lr.cardinality}},superTypes:[sr.$type]},Grammar:{name:zr.$type,properties:{imports:{name:zr.imports,defaultValue:[]},interfaces:{name:zr.interfaces,defaultValue:[]},isDeclared:{name:zr.isDeclared,defaultValue:!1},name:{name:zr.name},rules:{name:zr.rules,defaultValue:[]},types:{name:zr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Vr.$type,properties:{path:{name:Vr.path}},superTypes:[]},Group:{name:Ur.$type,properties:{cardinality:{name:Ur.cardinality},elements:{name:Ur.elements,defaultValue:[]},guardCondition:{name:Ur.guardCondition},predicate:{name:Ur.predicate}},superTypes:[sr.$type]},InferredType:{name:Gr.$type,properties:{name:{name:Gr.name}},superTypes:[pr.$type]},InfixRule:{name:qr.$type,properties:{call:{name:qr.call},dataType:{name:qr.dataType},inferredType:{name:qr.inferredType},name:{name:qr.name},operators:{name:qr.operators},parameters:{name:qr.parameters,defaultValue:[]},returnType:{name:qr.returnType,referenceType:pr.$type}},superTypes:[lr.$type]},InfixRuleOperatorList:{name:Yr.$type,properties:{associativity:{name:Yr.associativity},operators:{name:Yr.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Zr.$type,properties:{precedences:{name:Zr.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:$r.$type,properties:{attributes:{name:$r.attributes,defaultValue:[]},name:{name:$r.name},superTypes:{name:$r.superTypes,defaultValue:[],referenceType:pr.$type}},superTypes:[pr.$type]},Keyword:{name:ti.$type,properties:{cardinality:{name:ti.cardinality},predicate:{name:ti.predicate},value:{name:ti.value}},superTypes:[sr.$type]},NamedArgument:{name:ri.$type,properties:{calledByName:{name:ri.calledByName,defaultValue:!1},parameter:{name:ri.parameter,referenceType:di.$type},value:{name:ri.value}},superTypes:[]},NegatedToken:{name:ai.$type,properties:{cardinality:{name:ai.cardinality},lookahead:{name:ai.lookahead},parenthesized:{name:ai.parenthesized,defaultValue:!1},terminal:{name:ai.terminal}},superTypes:[ji.$type]},Negation:{name:si.$type,properties:{value:{name:si.value}},superTypes:[kr.$type]},NumberLiteral:{name:li.$type,properties:{value:{name:li.value}},superTypes:[Zi.$type]},Parameter:{name:di.$type,properties:{name:{name:di.name}},superTypes:[]},ParameterReference:{name:pi.$type,properties:{parameter:{name:pi.parameter,referenceType:di.$type}},superTypes:[kr.$type]},ParserRule:{name:hi.$type,properties:{dataType:{name:hi.dataType},definition:{name:hi.definition},entry:{name:hi.entry,defaultValue:!1},fragment:{name:hi.fragment,defaultValue:!1},inferredType:{name:hi.inferredType},name:{name:hi.name},parameters:{name:hi.parameters,defaultValue:[]},returnType:{name:hi.returnType,referenceType:pr.$type}},superTypes:[lr.$type]},ReferenceType:{name:_i.$type,properties:{isMulti:{name:_i.isMulti,defaultValue:!1},referenceType:{name:_i.referenceType}},superTypes:[Ui.$type]},RegexToken:{name:yi.$type,properties:{cardinality:{name:yi.cardinality},lookahead:{name:yi.lookahead},parenthesized:{name:yi.parenthesized,defaultValue:!1},regex:{name:yi.regex}},superTypes:[ji.$type]},ReturnType:{name:xi.$type,properties:{name:{name:xi.name}},superTypes:[]},RuleCall:{name:Ci.$type,properties:{arguments:{name:Ci.arguments,defaultValue:[]},cardinality:{name:Ci.cardinality},predicate:{name:Ci.predicate},rule:{name:Ci.rule,referenceType:dr.$type}},superTypes:[sr.$type]},SimpleType:{name:Ti.$type,properties:{primitiveType:{name:Ti.primitiveType},stringType:{name:Ti.stringType},typeRef:{name:Ti.typeRef,referenceType:pr.$type}},superTypes:[Ui.$type]},StringLiteral:{name:Di.$type,properties:{value:{name:Di.value}},superTypes:[Zi.$type]},TerminalAlternatives:{name:ki.$type,properties:{cardinality:{name:ki.cardinality},elements:{name:ki.elements,defaultValue:[]},lookahead:{name:ki.lookahead},parenthesized:{name:ki.parenthesized,defaultValue:!1}},superTypes:[ji.$type]},TerminalElement:{name:ji.$type,properties:{cardinality:{name:ji.cardinality},lookahead:{name:ji.lookahead},parenthesized:{name:ji.parenthesized,defaultValue:!1}},superTypes:[sr.$type]},TerminalGroup:{name:Ni.$type,properties:{cardinality:{name:Ni.cardinality},elements:{name:Ni.elements,defaultValue:[]},lookahead:{name:Ni.lookahead},parenthesized:{name:Ni.parenthesized,defaultValue:!1}},superTypes:[ji.$type]},TerminalRule:{name:Fi.$type,properties:{definition:{name:Fi.definition},fragment:{name:Fi.fragment,defaultValue:!1},hidden:{name:Fi.hidden,defaultValue:!1},name:{name:Fi.name},type:{name:Fi.type}},superTypes:[dr.$type]},TerminalRuleCall:{name:Li.$type,properties:{cardinality:{name:Li.cardinality},lookahead:{name:Li.lookahead},parenthesized:{name:Li.parenthesized,defaultValue:!1},rule:{name:Li.rule,referenceType:Fi.$type}},superTypes:[ji.$type]},Type:{name:zi.$type,properties:{name:{name:zi.name},type:{name:zi.type}},superTypes:[pr.$type]},TypeAttribute:{name:Vi.$type,properties:{defaultValue:{name:Vi.defaultValue},isOptional:{name:Vi.isOptional,defaultValue:!1},name:{name:Vi.name},type:{name:Vi.type}},superTypes:[]},TypeDefinition:{name:Ui.$type,properties:{},superTypes:[]},UnionType:{name:Gi.$type,properties:{types:{name:Gi.types,defaultValue:[]}},superTypes:[Ui.$type]},UnorderedGroup:{name:qi.$type,properties:{cardinality:{name:qi.cardinality},elements:{name:qi.elements,defaultValue:[]}},superTypes:[sr.$type]},UntilToken:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality},lookahead:{name:Yi.lookahead},parenthesized:{name:Yi.parenthesized,defaultValue:!1},terminal:{name:Yi.terminal}},superTypes:[ji.$type]},ValueLiteral:{name:Zi.$type,properties:{},superTypes:[]},Wildcard:{name:$i.$type,properties:{cardinality:{name:$i.cardinality},lookahead:{name:$i.lookahead},parenthesized:{name:$i.parenthesized,defaultValue:!1}},superTypes:[ji.$type]}}}},W=new ta;function na(e){let t=e,n=!1;for(;t;){let e=Kn(t.grammarSource,gi);if(e&&e.dataType)t=t.container,n=!0;else return n?t:void 0}}o(na,`getDatatypeNode`);function ra(e){return new Hn(e,e=>Pn(e)?e.content:[],{includeRoot:!0})}o(ra,`streamCst`);function ia(e){return ra(e).filter(Fn)}o(ia,`flattenCst`);function aa(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}o(aa,`isChildNode`);function oa(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}o(oa,`tokenToRange`);function sa(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}o(sa,`toDocumentSegment`);var ca;(function(e){e[e.Before=0]=`Before`,e[e.After=1]=`After`,e[e.OverlapFront=2]=`OverlapFront`,e[e.OverlapBack=3]=`OverlapBack`,e[e.Inside=4]=`Inside`,e[e.Outside=5]=`Outside`})(ca||={});function la(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return ca.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return ca.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?ca.Inside:n?ca.OverlapBack:r?ca.OverlapFront:ca.Outside}o(la,`compareRange`);function ua(e,t){return la(e,t)>ca.After}o(ua,`inRange`);var da=/^[\w\p{L}]$/u;function fa(e,t,n=da){if(e){if(t>0){let r=t-e.offset,i=e.text.charAt(r);n.test(i)||t--}return ha(e,t)}}o(fa,`findDeclarationNodeAtOffset`);function pa(e,t){if(e){let n=va(e,!0);if(n&&ma(n,t))return n;if(In(e)){let n=e.content.findIndex(e=>!e.hidden);for(let r=n-1;r>=0;r--){let n=e.content[r];if(ma(n,t))return n}}}}o(pa,`findCommentNode`);function ma(e,t){return Fn(e)&&t.includes(e.tokenType.name)}o(ma,`isCommentNode`);function ha(e,t){if(Fn(e))return e;if(Pn(e)){let n=_a(e,t,!1);if(n)return ha(n,t)}}o(ha,`findLeafNodeAtOffset`);function ga(e,t){if(Fn(e))return e;if(Pn(e)){let n=_a(e,t,!0);if(n)return ga(n,t)}}o(ga,`findLeafNodeBeforeOffset`);function _a(e,t,n){let r=0,i=e.content.length-1,a;for(;r<=i;){let o=Math.floor((r+i)/2),s=e.content[o];if(s.offset<=t&&s.end>t)return s;s.end<=t?(a=n?s:void 0,r=o+1):i=o-1}return a}o(_a,`binarySearch`);function va(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let e=n.content[r];if(t||!e.hidden)return e}e=n}}o(va,`getPreviousNode`);function ya(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e),i=n.content.length-1;for(;r<i;){r++;let e=n.content[r];if(t||!e.hidden)return e}e=n}}o(ya,`getNextNode`);function ba(e){if(e.range.start.character===0)return e;let t=e.range.start.line,n=e,r;for(;e.container;){let i=e.container,a=r??i.content.indexOf(e);if(a===0?(e=i,r=void 0):(r=a-1,e=i.content[r]),e.range.start.line!==t)break;n=e}return n}o(ba,`getStartlineNode`);function xa(e,t){let n=Sa(e,t);return n?n.parent.content.slice(n.a+1,n.b):[]}o(xa,`getInteriorNodes`);function Sa(e,t){let n=Ca(e),r=Ca(t),i;for(let e=0;e<n.length&&e<r.length;e++){let t=n[e],a=r[e];if(t.parent===a.parent)i={parent:t.parent,a:t.index,b:a.index};else break}return i}o(Sa,`getCommonParent`);function Ca(e){let t=[];for(;e.container;){let n=e.container,r=n.content.indexOf(e);t.push({parent:n,index:r}),e=n}return t.reverse()}o(Ca,`getParentChain`);var wa={};t(wa,{findAssignment:()=>fo,findNameAssignment:()=>po,findNodeForKeyword:()=>lo,findNodeForProperty:()=>oo,findNodesForKeyword:()=>co,findNodesForKeywordInternal:()=>uo,findNodesForProperty:()=>ao,getActionAtElement:()=>ho,getActionType:()=>To,getAllReachableRules:()=>eo,getAllRulesUsedForCrossReferences:()=>no,getCrossReferenceTerminal:()=>ro,getEntryRule:()=>Qa,getExplicitRuleType:()=>Co,getHiddenRules:()=>$a,getRuleType:()=>Do,getRuleTypeName:()=>Eo,getTypeName:()=>wo,isArrayCardinality:()=>_o,isArrayOperator:()=>vo,isCommentTerminal:()=>io,isDataType:()=>xo,isDataTypeRule:()=>yo,isOptionalCardinality:()=>go,terminalRegex:()=>Oo});var Ta=class extends Error{static{o(this,`ErrorWithLocation`)}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function Ea(e,t=`Error: Got unexpected value.`){throw Error(t)}o(Ea,`assertUnreachable`);function Da(e,t=`Error: Condition is violated.`){if(!e)throw Error(t)}o(Da,`assertCondition`);var Oa={};t(Oa,{NEWLINE_REGEXP:()=>Ha,escapeRegExp:()=>Ya,getTerminalParts:()=>Ga,isMultilineComment:()=>Ka,isWhitespace:()=>Ja,partialMatches:()=>Xa,partialRegExp:()=>Za,whitespaceCharacters:()=>qa});function G(e){return e.charCodeAt(0)}o(G,`cc`);function ka(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}o(ka,`insertToSet`);function Aa(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}o(Aa,`addFlag`);function ja(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}o(ja,`ASSERT_EXISTS`);function Ma(){throw Error(`Internal Error - Should never get here!`)}o(Ma,`ASSERT_NEVER_REACH_HERE`);function Na(e){return e.type===`Character`}o(Na,`isCharacter`);var Pa=[];for(let e=G(`0`);e<=G(`9`);e++)Pa.push(e);var Fa=[G(`_`)].concat(Pa);for(let e=G(`a`);e<=G(`z`);e++)Fa.push(e);for(let e=G(`A`);e<=G(`Z`);e++)Fa.push(e);var Ia=[G(` `),G(`\f`),G(`
|
||
`),G(`\r`),G(` `),G(`\v`),G(` `),G(`\xA0`),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(` `),G(`\u2028`),G(`\u2029`),G(` `),G(` `),G(` `),G(``)],La=/[0-9a-fA-F]/,Ra=/[0-9]/,za=/[1-9]/,Ba=class{static{o(this,`RegExpParser`)}constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:Aa(n,`global`);break;case`i`:Aa(n,`ignoreCase`);break;case`m`:Aa(n,`multiLine`);break;case`u`:Aa(n,`unicode`);break;case`y`:Aa(n,`sticky`);break}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}break}ja(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return Ma()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`);break}if(e===!0&&t===void 0)return;ja(t);break}if(!(e===!0&&t===void 0)&&ja(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ja(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ma()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[G(`
|
||
`),G(`\r`),G(`\u2028`),G(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=Pa;break;case`D`:e=Pa,t=!0;break;case`s`:e=Ia;break;case`S`:e=Ia,t=!0;break;case`w`:e=Fa;break;case`W`:e=Fa,t=!0;break}return ja(e)?{type:`Set`,value:e,complement:t}:Ma()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=G(`\f`);break;case`n`:e=G(`
|
||
`);break;case`r`:e=G(`\r`);break;case`t`:e=G(` `);break;case`v`:e=G(`\v`);break}return ja(e)?{type:`Character`,value:e}:Ma()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:G(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:G(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
||
`:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:G(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,Na(t)&&this.isRangeDash()){this.consumeChar(`-`);let n=this.classAtom();if(n.type,Na(n)){if(n.value<t.value)throw Error(`Range out of order in character class`);e.push({from:t.value,to:n.value})}else ka(t.value,e),e.push(G(`-`)),ka(n.value,e)}else ka(t.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}}classAtom(){switch(this.peekChar()){case`]`:case`
|
||
`:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:G(`\b`)};case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++;break}let t=this.disjunction();this.consumeChar(`)`);let n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(za.test(e)===!1)throw Error(`Expecting a positive integer`);for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ra.test(e)===!1)throw Error(`Expecting an integer`);for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
|
||
`:case`\r`:case`\u2028`:case`\u2029`:case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:throw Error(`TBD`);default:return{type:`Character`,value:G(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}}isRangeDash(){return this.peekChar()===`-`&&this.isClassAtom(1)}isDigit(){return Ra.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case`]`:case`
|
||
`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case`^`:case`$`:return!0;case`\\`:switch(this.peekChar(1)){case`b`:case`B`:return!0;default:return!1}case`(`:return this.peekChar(1)===`?`&&(this.peekChar(2)===`=`||this.peekChar(2)===`!`||this.peekChar(2)===`<`&&(this.peekChar(3)===`=`||this.peekChar(3)===`!`));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`
|
||
`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}parseHexDigits(e){let t=``;for(let n=0;n<e;n++){let e=this.popChar();if(La.test(e)===!1)throw Error(`Expecting a HexDecimal digits`);t+=e}return{type:`Character`,value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++}loc(e){return{begin:e,end:this.idx}}},Va=class{static{o(this,`BaseRegExpVisitor`)}visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this):this.visit(n))}}visit(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Lookbehind`:this.visitLookbehind(e);break;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Ha=/\r?\n/gm,Ua=new Ba,Wa=new class extends Va{static{o(this,`TerminalRegExpVisitor`)}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join(``)}reset(e){this.multiline=!1,this.regex=e,this.startRegexp=``,this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let t=String.fromCharCode(e.value);if(!this.multiline&&t===`
|
||
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let e=Ya(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){let t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=!!`
|
||
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type===`Group`&&e.quantifier||super.visitChildren(e)}};function Ga(e){try{typeof e!=`string`&&(e=e.source),e=`/${e}/`;let t=Ua.pattern(e),n=[];for(let r of t.value.value)Wa.reset(e),Wa.visit(r),n.push({start:Wa.startRegexp,end:Wa.endRegex});return n}catch{return[]}}o(Ga,`getTerminalParts`);function Ka(e){try{return typeof e==`string`&&(e=new RegExp(e)),e=e.toString(),Wa.reset(e),Wa.visit(Ua.pattern(e)),Wa.multiline}catch{return!1}}o(Ka,`isMultilineComment`);var qa=`\f
|
||
\r \v \xA0 \u2028\u2029 `.split(``);function Ja(e){let t=typeof e==`string`?new RegExp(e):e;return qa.some(e=>t.test(e))}o(Ja,`isWhitespace`);function Ya(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}o(Ya,`escapeRegExp`);function Xa(e,t){let n=Za(e),r=t.match(n);return!!r&&r[0].length>0}o(Xa,`partialMatches`);function Za(e){typeof e==`string`&&(e=new RegExp(e));let t=e,n=e.source,r=0;function i(){let e=``,a;function s(t){e+=n.substr(r,t),r+=t}o(s,`appendRaw`);function c(t){e+=`(?:`+n.substr(r,t)+`|$)`,r+=t}for(o(c,`appendOptional`);r<n.length;)switch(n[r]){case`\\`:switch(n[r+1]){case`c`:c(3);break;case`x`:c(4);break;case`u`:t.unicode?n[r+2]===`{`?c(n.indexOf(`}`,r)-r+1):c(6):c(2);break;case`p`:case`P`:t.unicode?c(n.indexOf(`}`,r)-r+1):c(2);break;case`k`:c(n.indexOf(`>`,r)-r+1);break;default:c(2);break}break;case`[`:a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],c(a[0].length);break;case`|`:case`^`:case`$`:case`*`:case`+`:case`?`:s(1);break;case`{`:a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?s(a[0].length):c(1);break;case`(`:if(n[r+1]===`?`)switch(n[r+2]){case`:`:e+=`(?:`,r+=3,e+=i()+`|$)`;break;case`=`:e+=`(?=`,r+=3,e+=i()+`)`;break;case`!`:a=r,r+=3,i(),e+=n.substr(a,r-a);break;case`<`:switch(n[r+3]){case`=`:case`!`:a=r,r+=4,i(),e+=n.substr(a,r-a);break;default:s(n.indexOf(`>`,r)-r+1),e+=i()+`|$)`;break}break}else s(1),e+=i()+`|$)`;break;case`)`:return++r,e;default:c(1);break}return e}return o(i,`process`),new RegExp(i(),e.flags)}o(Za,`partialRegExp`);function Qa(e){return e.rules.find(e=>gi(e)&&e.entry)}o(Qa,`getEntryRule`);function $a(e){return e.rules.filter(e=>Ii(e)&&e.hidden)}o($a,`getHiddenRules`);function eo(e,t){let n=new Set,r=Qa(e);if(!r)return new Set(e.rules);let i=[r].concat($a(e));for(let e of i)to(e,n,t);let a=new Set;for(let t of e.rules)(n.has(t.name)||Ii(t)&&t.hidden)&&a.add(t);return a}o(eo,`getAllReachableRules`);function to(e,t,n){t.add(e.name),Qn(e).forEach(e=>{if(wi(e)||n&&Ri(e)){let r=e.rule.ref;r&&!t.has(r.name)&&to(r,t,n)}})}o(to,`ruleDfs`);function no(e){let t=new Set;return Qn(e).forEach(e=>{Pr(e)&&(gi(e.type.ref)&&t.add(e.type.ref),Kr(e.type.ref)&&gi(e.type.ref.$container)&&t.add(e.type.ref.$container))}),t}o(no,`getAllRulesUsedForCrossReferences`);function ro(e){if(e.terminal)return e.terminal;if(e.type.ref)return po(e.type.ref)?.terminal}o(ro,`getCrossReferenceTerminal`);function io(e){return e.hidden&&!Ja(Oo(e))}o(io,`isCommentTerminal`);function ao(e,t){return!e||!t?[]:so(e,t,e.astNode,!0)}o(ao,`findNodesForProperty`);function oo(e,t,n){if(!e||!t)return;let r=so(e,t,e.astNode,!0);if(r.length!==0)return n=n===void 0?0:Math.max(0,Math.min(n,r.length-1)),r[n]}o(oo,`findNodeForProperty`);function so(e,t,n,r){if(!r){let n=Kn(e.grammarSource,wr);if(n&&n.feature===t)return[e]}return Pn(e)&&e.astNode===n?e.content.flatMap(e=>so(e,t,n,!1)):[]}o(so,`findNodesForPropertyInternal`);function co(e,t){return e?uo(e,t,e?.astNode):[]}o(co,`findNodesForKeyword`);function lo(e,t,n){if(!e)return;let r=uo(e,t,e?.astNode);if(r.length!==0)return n=n===void 0?0:Math.max(0,Math.min(n,r.length-1)),r[n]}o(lo,`findNodeForKeyword`);function uo(e,t,n){if(e.astNode!==n)return[];if(ni(e.grammarSource)&&e.grammarSource.value===t)return[e];let r=ra(e).iterator(),i,a=[];do if(i=r.next(),!i.done){let e=i.value;e.astNode===n?ni(e.grammarSource)&&e.grammarSource.value===t&&a.push(e):r.prune()}while(!i.done);return a}o(uo,`findNodesForKeywordInternal`);function fo(e){let t=e.astNode;for(;t===e.container?.astNode;){let t=Kn(e.grammarSource,wr);if(t)return t;e=e.container}}o(fo,`findAssignment`);function po(e){let t=e;return Kr(t)&&(gr(t.$container)?t=t.$container.$container:ur(t.$container)?t=t.$container:Ea(t.$container)),mo(e,t,new Map)}o(po,`findNameAssignment`);function mo(e,t,n){function r(t,r){let i;return Kn(t,wr)||(i=mo(r,r,n)),n.set(e,i),i}if(o(r,`go`),n.has(e))return n.get(e);n.set(e,void 0);for(let i of Qn(t)){if(wr(i)&&i.feature.toLowerCase()===`name`)return n.set(e,i),i;if(wi(i)&&gi(i.rule.ref))return r(i,i.rule.ref);if(Ei(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}}o(mo,`findNameAssignmentInternal`);function ho(e){let t=e.$container;if(Wr(t)){let n=t.elements,r=n.indexOf(e);for(let e=r-1;e>=0;e--){let t=n[e];if(gr(t))return t;{let t=Qn(n[e]).find(gr);if(t)return t}}}if(cr(t))return ho(t)}o(ho,`getActionAtElement`);function go(e,t){return e===`?`||e===`*`||Wr(t)&&!!t.guardCondition}o(go,`isOptionalCardinality`);function _o(e){return e===`*`||e===`+`}o(_o,`isArrayCardinality`);function vo(e){return e===`+=`}o(vo,`isArrayOperator`);function yo(e){return bo(e,new Set)}o(yo,`isDataTypeRule`);function bo(e,t){if(t.has(e))return!0;t.add(e);for(let n of Qn(e))if(wi(n)){if(!n.rule.ref||gi(n.rule.ref)&&!bo(n.rule.ref,t)||Jr(n.rule.ref))return!1}else if(wr(n)||gr(n))return!1;return!!e.definition}o(bo,`isDataTypeRuleInternal`);function xo(e){return So(e.type,new Set)}o(xo,`isDataType`);function So(e,t){if(t.has(e))return!0;if(t.add(e),Sr(e)||vi(e))return!1;if(Ki(e))return e.types.every(e=>So(e,t));if(Ei(e)){if(e.primitiveType!==void 0||e.stringType!==void 0)return!0;if(e.typeRef!==void 0){let n=e.typeRef.ref;return Bi(n)?So(n.type,t):!1}else return!1}else return!1}o(So,`isDataTypeInternal`);function Co(e){if(!Ii(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){let t=e.returnType.ref;if(t)return t.name}}}o(Co,`getExplicitRuleType`);function wo(e){if(ur(e))return gi(e)&&yo(e)?e.name:Co(e)??e.name;if(ei(e)||Bi(e)||Si(e))return e.name;if(gr(e)){let t=To(e);if(t)return t}else if(Kr(e))return e.name;throw Error(`Cannot get name of Unknown Type`)}o(wo,`getTypeName`);function To(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return wo(e.type.ref)}o(To,`getActionType`);function Eo(e){return Ii(e)?e.type?.name??`string`:gi(e)&&yo(e)?e.name:Co(e)??e.name}o(Eo,`getRuleTypeName`);function Do(e){return Ii(e)?e.type?.name??`string`:Co(e)??e.name}o(Do,`getRuleType`);function Oo(e){let t={s:!1,i:!1,u:!1},n=Ao(e.definition,t),r=Object.entries(t).filter(([,e])=>e).map(([e])=>e).join(``);return new RegExp(n,r)}o(Oo,`terminalRegex`);var ko=`[\\s\\S]`;function Ao(e,t){if(Ai(e))return jo(e);if(Pi(e))return Mo(e);if(Or(e))return Fo(e);if(Ri(e)){let t=e.rule.ref;if(!t)throw Error(`Missing rule reference.`);return Lo(Ao(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(oi(e))return Po(e);if(Xi(e))return No(e);if(bi(e)){let n=e.regex.lastIndexOf(`/`),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes(`i`),t.s=i.includes(`s`),t.u=i.includes(`u`)),Lo(r,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(ea(e))return Lo(ko,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}o(Ao,`abstractElementToRegex`);function jo(e){return Lo(e.elements.map(e=>Ao(e)).join(`|`),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}o(jo,`terminalAlternativesToRegex`);function Mo(e){return Lo(e.elements.map(e=>Ao(e)).join(``),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}o(Mo,`terminalGroupToRegex`);function No(e){return Lo(`${ko}*?${Ao(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}o(No,`untilTokenToRegex`);function Po(e){return Lo(`(?!${Ao(e.terminal)})${ko}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}o(Po,`negateTokenToRegex`);function Fo(e){return e.right?Lo(`[${Io(e.left)}-${Io(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):Lo(Io(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}o(Fo,`characterRangeToRegex`);function Io(e){return Ya(e.value)}o(Io,`keywordToRegex`);function Lo(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?``:`?:`)}${e})`),t.cardinality?`${e}${t.cardinality}`:e}o(Lo,`withCardinality`);function Ro(e){let t=[],n=e.Grammar;for(let e of n.rules)Ii(e)&&io(e)&&Ka(Oo(e))&&t.push(e.name);return{multilineCommentRules:t,nameRegexp:da}}o(Ro,`createGrammarConfig`);function zo(e){console&&console.error&&console.error(`Error: ${e}`)}o(zo,`PRINT_ERROR`);function Bo(e){console&&console.warn&&console.warn(`Warning: ${e}`)}o(Bo,`PRINT_WARNING`);function Vo(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}o(Vo,`timer`);function Ho(e){function t(){}o(t,`FakeConstructor`),t.prototype=e;let n=new t;function r(){return typeof n.bar}return o(r,`fakeAccess`),r(),r(),e}o(Ho,`toFastProperties`);function Uo(e){return Wo(e)?e.LABEL:e.name}o(Uo,`tokenLabel`);function Wo(e){return h(e.LABEL)&&e.LABEL!==``}o(Wo,`hasTokenLabel`);var Go=class{static{o(this,`AbstractProduction`)}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),p(this.definition,t=>{t.accept(e)})}},Ko=class extends Go{static{o(this,`NonTerminal`)}constructor(e){super([]),this.idx=1,D(this,C(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},qo=class extends Go{static{o(this,`Rule`)}constructor(e){super(e.definition),this.orgText=``,D(this,C(e,e=>e!==void 0))}},Jo=class extends Go{static{o(this,`Alternative`)}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,D(this,C(e,e=>e!==void 0))}},Yo=class extends Go{static{o(this,`Option`)}constructor(e){super(e.definition),this.idx=1,D(this,C(e,e=>e!==void 0))}},Xo=class extends Go{static{o(this,`RepetitionMandatory`)}constructor(e){super(e.definition),this.idx=1,D(this,C(e,e=>e!==void 0))}},Zo=class extends Go{static{o(this,`RepetitionMandatoryWithSeparator`)}constructor(e){super(e.definition),this.idx=1,D(this,C(e,e=>e!==void 0))}},K=class extends Go{static{o(this,`Repetition`)}constructor(e){super(e.definition),this.idx=1,D(this,C(e,e=>e!==void 0))}},Qo=class extends Go{static{o(this,`RepetitionWithSeparator`)}constructor(e){super(e.definition),this.idx=1,D(this,C(e,e=>e!==void 0))}},$o=class extends Go{static{o(this,`Alternation`)}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,D(this,C(e,e=>e!==void 0))}},q=class{static{o(this,`Terminal`)}constructor(e){this.idx=1,D(this,C(e,e=>e!==void 0))}accept(e){e.visit(this)}};function es(e){return A(e,ts)}o(es,`serializeGrammar`);function ts(e){function t(e){return A(e,ts)}if(o(t,`convertDefinition`),e instanceof Ko){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return h(e.label)&&(t.label=e.label),t}else{if(e instanceof Jo)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof Yo)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof Xo)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof Zo)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:ts(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Qo)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:ts(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof K)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof $o)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof q){let t={type:`Terminal`,name:e.terminalType.name,label:Uo(e.terminalType),idx:e.idx};h(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=m(n)?n.source:n),t}else{if(e instanceof qo)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}}}o(ts,`serializeProduction`);var ns=class{static{o(this,`GAstVisitor`)}visit(e){let t=e;switch(t.constructor){case Ko:return this.visitNonTerminal(t);case Jo:return this.visitAlternative(t);case Yo:return this.visitOption(t);case Xo:return this.visitRepetitionMandatory(t);case Zo:return this.visitRepetitionMandatoryWithSeparator(t);case Qo:return this.visitRepetitionWithSeparator(t);case K:return this.visitRepetition(t);case $o:return this.visitAlternation(t);case q:return this.visitTerminal(t);case qo:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function rs(e){return e instanceof Jo||e instanceof Yo||e instanceof K||e instanceof Xo||e instanceof Zo||e instanceof Qo||e instanceof q||e instanceof qo}o(rs,`isSequenceProd`);function is(e,t=[]){return e instanceof Yo||e instanceof K||e instanceof Qo?!0:e instanceof $o?v(e.definition,e=>is(e,t)):e instanceof Ko&&x(t,e)?!1:e instanceof Go?(e instanceof Ko&&t.push(e),I(e.definition,e=>is(e,t))):!1}o(is,`isOptionalProd`);function as(e){return e instanceof $o}o(as,`isBranchingProd`);function os(e){if(e instanceof Ko)return`SUBRULE`;if(e instanceof Yo)return`OPTION`;if(e instanceof $o)return`OR`;if(e instanceof Xo)return`AT_LEAST_ONE`;if(e instanceof Zo)return`AT_LEAST_ONE_SEP`;if(e instanceof Qo)return`MANY_SEP`;if(e instanceof K)return`MANY`;if(e instanceof q)return`CONSUME`;throw Error(`non exhaustive match`)}o(os,`getProductionDslName`);var ss=class{static{o(this,`RestWalker`)}walk(e,t=[]){p(e.definition,(n,r)=>{let i=O(e.definition,r+1);if(n instanceof Ko)this.walkProdRef(n,i,t);else if(n instanceof q)this.walkTerminal(n,i,t);else if(n instanceof Jo)this.walkFlat(n,i,t);else if(n instanceof Yo)this.walkOption(n,i,t);else if(n instanceof Xo)this.walkAtLeastOne(n,i,t);else if(n instanceof Zo)this.walkAtLeastOneSep(n,i,t);else if(n instanceof Qo)this.walkManySep(n,i,t);else if(n instanceof K)this.walkMany(n,i,t);else if(n instanceof $o)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new Yo({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=cs(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new Yo({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=cs(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);p(e.definition,e=>{let t=new Jo({definition:[e]});this.walk(t,r)})}};function cs(e,t,n){return[new Yo({definition:[new q({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}o(cs,`restForRepetitionWithSeparator`);function ls(e){if(e instanceof Ko)return ls(e.referencedRule);if(e instanceof q)return fs(e);if(rs(e))return us(e);if(as(e))return ds(e);throw Error(`non exhaustive match`)}o(ls,`first`);function us(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=is(a),t=t.concat(ls(a)),r+=1,i=n.length>r;return se(t)}o(us,`firstForSequence`);function ds(e){return se(j(A(e.definition,e=>ls(e))))}o(ds,`firstForBranching`);function fs(e){return[e.terminalType]}o(fs,`firstForTerminal`);var ps=`_~IN~_`,ms=class extends ss{static{o(this,`ResyncFollowsWalker`)}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=gs(e.referencedRule,e.idx)+this.topProd.name,i=ls(new Jo({definition:t.concat(n)}));this.follows[r]=i}};function hs(e){let t={};return p(e,e=>{D(t,new ms(e).startWalking())}),t}o(hs,`computeAllProdsFollows`);function gs(e,t){return e.name+t+ps}o(gs,`buildBetweenProdsFollowPrefix`);var _s={},vs=new Ba;function ys(e){let t=e.toString();if(_s.hasOwnProperty(t))return _s[t];{let e=vs.pattern(t);return _s[t]=e,e}}o(ys,`getRegExpAst`);function bs(){_s={}}o(bs,`clearRegExpParserCache`);var xs=`Complement Sets are not supported for first char optimization`,Ss=`Unable to use "first char" lexer optimizations:
|
||
`;function Cs(e,t=!1){try{let t=ys(e);return ws(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===xs)t&&Bo(`${Ss} Unable to optimize: < ${e.toString()} >
|
||
Complement Sets cannot be automatically optimized.
|
||
This will disable the lexer's first char optimizations.
|
||
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=``;t&&(n=`
|
||
This will disable the lexer's first char optimizations.
|
||
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),zo(`${Ss}
|
||
Failed parsing: < ${e.toString()} >
|
||
Using the @chevrotain/regexp-to-ast library
|
||
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}o(Cs,`getOptimizedStartCodesIndices`);function ws(e,t,n){switch(e.type){case`Disjunction`:for(let r=0;r<e.value.length;r++)ws(e.value[r],t,n);break;case`Alternative`:let r=e.value;for(let e=0;e<r.length;e++){let i=r[e];switch(i.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`Lookbehind`:case`NegativeLookbehind`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}let a=i;switch(a.type){case`Character`:Ts(a.value,t,n);break;case`Set`:if(a.complement===!0)throw Error(xs);p(a.value,e=>{if(typeof e==`number`)Ts(e,t,n);else{let r=e;if(n===!0)for(let e=r.from;e<=r.to;e++)Ts(e,t,n);else{for(let e=r.from;e<=r.to&&e<dc;e++)Ts(e,t,n);if(r.to>=dc){let e=r.from>=dc?r.from:dc,n=r.to,i=pc(e),a=pc(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case`Group`:ws(a.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type===`Group`&&Os(a)===!1||a.type!==`Group`&&o===!1)break}break;default:throw Error(`non exhaustive match!`)}return F(t)}o(ws,`firstCharOptimizedIndices`);function Ts(e,t,n){let r=pc(e);t[r]=r,n===!0&&Es(e,t)}o(Ts,`addOptimizedIdxToResult`);function Es(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=pc(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=pc(e.charCodeAt(0));t[n]=n}}}o(Es,`handleIgnoreCase`);function Ds(e,t){return ae(e.value,e=>{if(typeof e==`number`)return x(t,e);{let n=e;return ae(t,e=>n.from<=e&&e<=n.to)!==void 0}})}o(Ds,`findCode`);function Os(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?l(e.value)?I(e.value,Os):Os(e.value):!1}o(Os,`isWholeOptional`);var ks=class extends Va{static{o(this,`CharCodeFinder`)}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case`Lookahead`:this.visitLookahead(e);return;case`NegativeLookahead`:this.visitNegativeLookahead(e);return;case`Lookbehind`:this.visitLookbehind(e);return;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){x(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ds(e,this.targetCharCodes)===void 0&&(this.found=!0):Ds(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function As(e,t){if(t instanceof RegExp){let n=ys(t),r=new ks(e);return r.visit(n),r.found}else return ae(t,t=>x(e,t.charCodeAt(0)))!==void 0}o(As,`canMatchCharCode`);var js=`PATTERN`,Ms=`defaultMode`,Ns=`modes`,Ps=typeof RegExp(`(?:)`).sticky==`boolean`;function Fs(e,t){t=N(t,{useSticky:Ps,debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
|
||
`],tracer:o((e,t)=>t(),`tracer`)});let n=t.tracer;n(`initCharCodeToOptimizedIndexMap`,()=>{mc()});let r;n(`Reject Lexer.NA`,()=>{r=w(e,e=>e[js]===Mc.NA)});let i=!1,a;n(`Transform Patterns`,()=>{i=!1,a=A(r,e=>{let n=e[js];if(m(n)){let e=n.source;return e.length===1&&e!==`^`&&e!==`$`&&e!==`.`&&!n.ignoreCase?e:e.length===2&&e[0]===`\\`&&!x([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],e[1])?e[1]:t.useSticky?ec(n):$s(n)}else{if(u(n))return i=!0,{exec:n};if(typeof n==`object`)return i=!0,n;if(typeof n==`string`){if(n.length===1)return n;{let e=n.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),r=new RegExp(e);return t.useSticky?ec(r):$s(r)}}else throw Error(`non exhaustive match`)}})});let s,c,g,_,v;n(`misc mapping`,()=>{s=A(r,e=>e.tokenTypeIdx),c=A(r,e=>{let t=e.GROUP;if(t!==Mc.SKIPPED){if(h(t))return t;if(S(t))return!1;throw Error(`non exhaustive match`)}}),g=A(r,e=>{let t=e.LONGER_ALT;if(t)return l(t)?A(t,e=>ee(r,e)):[ee(r,t)]}),_=A(r,e=>e.PUSH_MODE),v=A(r,e=>f(e,`POP_MODE`))});let y;n(`Line Terminator Handling`,()=>{let e=lc(t.lineTerminatorCharacters);y=A(r,e=>!1),t.positionTracking!==`onlyOffset`&&(y=A(r,t=>f(t,`LINE_BREAKS`)?!!t.LINE_BREAKS:sc(t,e)===!1&&As(e,t.PATTERN)))});let b,te,C,ne;n(`Misc Mapping #2`,()=>{b=A(r,ic),te=A(a,ac),C=T(r,(e,t)=>{let n=t.GROUP;return h(n)&&n!==Mc.SKIPPED&&(e[n]=[]),e},{}),ne=A(a,(e,t)=>({pattern:a[t],longerAlt:g[t],canLineTerminator:y[t],isCustom:b[t],short:te[t],group:c[t],push:_[t],pop:v[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let E=!0,D=[];return t.safeMode||n(`First Char Optimization`,()=>{D=T(r,(e,n,r)=>{if(typeof n.PATTERN==`string`)uc(e,pc(n.PATTERN.charCodeAt(0)),ne[r]);else if(l(n.START_CHARS_HINT)){let t;p(n.START_CHARS_HINT,n=>{let i=pc(typeof n==`string`?n.charCodeAt(0):n);t!==i&&(t=i,uc(e,i,ne[r]))})}else if(m(n.PATTERN))if(n.PATTERN.unicode)E=!1,t.ensureOptimizations&&zo(`${Ss} Unable to analyze < ${n.PATTERN.toString()} > pattern.
|
||
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
||
This will disable the lexer's first char optimizations.
|
||
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=Cs(n.PATTERN,t.ensureOptimizations);d(i)&&(E=!1),p(i,t=>{uc(e,t,ne[r])})}else t.ensureOptimizations&&zo(`${Ss} TokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
||
This will disable the lexer's first char optimizations.
|
||
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return e},[])}),{emptyGroups:C,patternIdxToConfig:ne,charCodeToPatternIdxToConfig:D,hasCustom:i,canBeOptimized:E}}o(Fs,`analyzeTokenTypes`);function Is(e,t){let n=[],r=Rs(e);n=n.concat(r.errors);let i=zs(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(Ls(a)),n=n.concat(qs(a)),n=n.concat(Js(a,t)),n=n.concat(Ys(a)),n}o(Is,`validatePatterns`);function Ls(e){let t=[],n=E(e,e=>m(e[js]));return t=t.concat(Vs(n)),t=t.concat(Ws(n)),t=t.concat(Gs(n)),t=t.concat(Ks(n)),t=t.concat(Hs(n)),t}o(Ls,`validateRegExpPattern`);function Rs(e){let t=E(e,e=>!f(e,js));return{errors:A(t,e=>({message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:J.MISSING_PATTERN,tokenTypes:[e]})),valid:re(e,t)}}o(Rs,`findMissingPatterns`);function zs(e){let t=E(e,e=>{let t=e[js];return!m(t)&&!u(t)&&!f(t,`exec`)&&!h(t)});return{errors:A(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:J.INVALID_PATTERN,tokenTypes:[e]})),valid:re(e,t)}}o(zs,`findInvalidPatterns`);var Bs=/[^\\][$]/;function Vs(e){class t extends Va{static{o(this,`EndAnchorFinder`)}constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return A(E(e,e=>{let n=e.PATTERN;try{let e=ys(n),r=new t;return r.visit(e),r.found}catch{return Bs.test(n.source)}}),e=>({message:`Unexpected RegExp Anchor Error:
|
||
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
||
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:J.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}o(Vs,`findEndOfInputAnchor`);function Hs(e){return A(E(e,e=>e.PATTERN.test(``)),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:J.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}o(Hs,`findEmptyMatchRegExps`);var Us=/[^\\[][\^]|^\^/;function Ws(e){class t extends Va{static{o(this,`StartAnchorFinder`)}constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return A(E(e,e=>{let n=e.PATTERN;try{let e=ys(n),r=new t;return r.visit(e),r.found}catch{return Us.test(n.source)}}),e=>({message:`Unexpected RegExp Anchor Error:
|
||
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
||
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:J.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}o(Ws,`findStartOfInputAnchor`);function Gs(e){return A(E(e,e=>{let t=e[js];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:J.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}o(Gs,`findUnsupportedFlags`);function Ks(e){let t=[],n=A(e,n=>T(e,(e,r)=>(n.PATTERN.source===r.PATTERN.source&&!x(t,r)&&r.PATTERN!==Mc.NA&&(t.push(r),e.push(r)),e),[]));return n=oe(n),A(E(n,e=>e.length>1),e=>{let t=A(e,e=>e.name);return{message:`The same RegExp pattern ->${k(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:J.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}o(Ks,`findDuplicatePatterns`);function qs(e){return A(E(e,e=>{if(!f(e,`GROUP`))return!1;let t=e.GROUP;return t!==Mc.SKIPPED&&t!==Mc.NA&&!h(t)}),e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:J.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}o(qs,`findInvalidGroupType`);function Js(e,t){return A(E(e,e=>e.PUSH_MODE!==void 0&&!x(t,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:J.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}o(Js,`findModesThatDoNotExist`);function Ys(e){let t=[],n=T(e,(e,t,n)=>{let r=t.PATTERN;return r===Mc.NA||(h(r)?e.push({str:r,idx:n,tokenType:t}):m(r)&&Zs(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return p(e,(e,r)=>{p(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&Xs(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.
|
||
Because it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.
|
||
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:J.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}o(Ys,`findUnreachablePatterns`);function Xs(e,t){if(m(t)){if(Qs(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}else{if(u(t))return t(e,0,[],{});if(f(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}}o(Xs,`tryToMatchStrToPattern`);function Zs(e){return ae([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}o(Zs,`noMetaChar`);function Qs(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}o(Qs,`usesLookAheadOrBehind`);function $s(e){let t=e.ignoreCase?`i`:``;return RegExp(`^(?:${e.source})`,t)}o($s,`addStartOfInput`);function ec(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}o(ec,`addStickyFlag`);function tc(e,t,n){let r=[];return f(e,Ms)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+Ms+`> property in its definition
|
||
`,type:J.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),f(e,Ns)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+Ns+`> property in its definition
|
||
`,type:J.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),f(e,Ns)&&f(e,Ms)&&!f(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Ms}: <${e.defaultMode}>which does not exist
|
||
`,type:J.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),f(e,Ns)&&p(e.modes,(e,t)=>{p(e,(n,i)=>{S(n)?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>
|
||
`,type:J.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):f(n,`LONGER_ALT`)&&p(l(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],i=>{!S(i)&&!x(e,i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>
|
||
`,type:J.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}o(tc,`performRuntimeChecks`);function nc(e,t,n){let r=[],i=!1,a=w(oe(j(F(e.modes))),e=>e[js]===Mc.NA),o=lc(n);return t&&p(a,e=>{let t=sc(e,o);if(t!==!1){let n={message:cc(e,t),type:t.issue,tokenType:e};r.push(n)}else f(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):As(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
||
This Lexer has been defined to track line and column information,
|
||
But none of the Token Types can be identified as matching a line terminator.
|
||
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
||
for details.`,type:J.NO_LINE_BREAKS_FLAGS}),r}o(nc,`performWarningRuntimeChecks`);function rc(e){let t={};return p(y(e),n=>{let r=e[n];if(l(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}o(rc,`cloneEmptyGroups`);function ic(e){let t=e.PATTERN;if(m(t))return!1;if(u(t)||f(t,`exec`))return!0;if(h(t))return!1;throw Error(`non exhaustive match`)}o(ic,`isCustomPattern`);function ac(e){return h(e)&&e.length===1?e.charCodeAt(0):!1}o(ac,`isShortPattern`);var oc={test:o(function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(t===10)return this.lastIndex=n+1,!0;if(t===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},`test`),lastIndex:0};function sc(e,t){if(f(e,`LINE_BREAKS`))return!1;if(m(e.PATTERN)){try{As(t,e.PATTERN)}catch(e){return{issue:J.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}else{if(h(e.PATTERN))return!1;if(ic(e))return{issue:J.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}}o(sc,`checkLineBreaksIssues`);function cc(e,t){if(t.issue===J.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
||
The problem is in the <${e.name}> Token Type
|
||
Root cause: ${t.errMsg}.
|
||
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===J.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
||
The problem is in the <${e.name}> Token Type
|
||
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}o(cc,`buildLineBreakIssueMessage`);function lc(e){return A(e,e=>h(e)?e.charCodeAt(0):e)}o(lc,`getCharCodes`);function uc(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}o(uc,`addToMapOfArrays`);var dc=256,fc=[];function pc(e){return e<dc?e:fc[e]}o(pc,`charCodeToOptimizedIndex`);function mc(){if(d(fc)){fc=Array(65536);for(let e=0;e<65536;e++)fc[e]=e>255?255+~~(e/255):e}}o(mc,`initCharCodeToOptimizedIndexMap`);function hc(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}o(hc,`tokenStructuredMatcher`);function gc(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}o(gc,`tokenStructuredMatcherNoCategories`);var _c=1,vc={};function yc(e){let t=bc(e);xc(t),Cc(t),Sc(t),p(t,e=>{e.isParent=e.categoryMatches.length>0})}o(yc,`augmentTokenTypes`);function bc(e){let t=P(e),n=e,r=!0;for(;r;){n=oe(j(A(n,e=>e.CATEGORIES)));let e=re(n,t);t=t.concat(e),d(e)?r=!1:n=e}return t}o(bc,`expandCategories`);function xc(e){p(e,e=>{Tc(e)||(vc[_c]=e,e.tokenTypeIdx=_c++),Ec(e)&&!l(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Ec(e)||(e.CATEGORIES=[]),Dc(e)||(e.categoryMatches=[]),Oc(e)||(e.categoryMatchesMap={})})}o(xc,`assignTokenDefaultProps`);function Sc(e){p(e,e=>{e.categoryMatches=[],p(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(vc[n].tokenTypeIdx)})})}o(Sc,`assignCategoriesTokensProp`);function Cc(e){p(e,e=>{wc([],e)})}o(Cc,`assignCategoriesMapProp`);function wc(e,t){p(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),p(t.CATEGORIES,n=>{let r=e.concat(t);x(r,n)||wc(r,n)})}o(wc,`singleAssignCategoriesToksMap`);function Tc(e){return f(e,`tokenTypeIdx`)}o(Tc,`hasShortKeyProperty`);function Ec(e){return f(e,`CATEGORIES`)}o(Ec,`hasCategoriesProperty`);function Dc(e){return f(e,`categoryMatches`)}o(Dc,`hasExtendingTokensTypesProperty`);function Oc(e){return f(e,`categoryMatchesMap`)}o(Oc,`hasExtendingTokensTypesMapProperty`);function kc(e){return f(e,`tokenTypeIdx`)}o(kc,`isTokenType`);var Ac={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i,a){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}},J;(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`,e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=`MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE`})(J||={});var jc={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
||
`,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ac,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(jc);var Mc=class{static{o(this,`Lexer`)}constructor(e,t=jc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=Vo(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}else return t()},typeof t==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
||
a boolean 2nd argument is no longer supported`);this.config=D({},jc,t);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n==`number`&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,()=>{let n,r=!0;this.TRACE_INIT(`Lexer Config handling`,()=>{if(this.config.lineTerminatorsPattern===jc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=oc;else if(this.config.lineTerminatorCharacters===jc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
||
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),l(e)?n={modes:{defaultMode:P(e)},defaultMode:Ms}:(r=!1,n=P(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT(`performRuntimeChecks`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(tc(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(`performWarningRuntimeChecks`,()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(nc(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},p(n.modes,(e,t)=>{n.modes[t]=w(e,e=>S(e))});let i=y(n.modes);if(p(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),this.config.skipValidations===!1&&this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Is(e,i))}),d(this.lexerDefinitionErrors)){yc(e);let r;this.TRACE_INIT(`analyzeTokenTypes`,()=>{r=Fs(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=D({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!d(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let e=A(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
|
||
`);throw Error(`Errors detected in definition of Lexer:
|
||
`+e)}p(this.lexerDefinitionWarning,e=>{Bo(e.message)}),this.TRACE_INIT(`Choosing sub-methods implementations`,()=>{if(Ps?(this.chopInput=c,this.match=this.matchWithTest):(this.updateLastIndex=g,this.match=this.matchWithExec),r&&(this.handleModes=g),this.trackStartLines===!1&&(this.computeNewColumn=c),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=g),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT(`Failed Optimization Warnings`,()=>{let e=T(this.canModeBeOptimized,(e,t,n)=>(t===!1&&e.push(n),e),[]);if(t.ensureOptimizations&&!d(e))throw Error(`Lexer Modes: < ${e.join(`, `)} > cannot be optimized.
|
||
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
||
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(`clearRegExpParserCache`,()=>{bs()}),this.TRACE_INIT(`toFastProperties`,()=>{Ho(this)})})}tokenize(e,t=this.defaultMode){if(!d(this.lexerDefinitionErrors)){let e=A(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
|
||
`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
||
`+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,s,c,l,u,d,f,p,m,h,g,_,ee=e,v=ee.length,y=0,b=0,te=this.hasCustom?0:Math.floor(e.length/10),x=Array(te),S=[],C=this.trackStartLines?1:void 0,ne=this.trackStartLines?1:void 0,w=rc(this.emptyGroups),T=this.trackStartLines,E=this.config.lineTerminatorsPattern,D=0,O=[],re=[],k=[],A=[];Object.freeze(A);let j;function M(){return O}o(M,`getPossiblePatternsSlow`);function ae(e){let t=pc(e),n=re[t];return n===void 0?A:n}o(ae,`getPossiblePatternsOptimized`);let oe=o(e=>{if(k.length===1&&e.tokenType.PUSH_MODE===void 0){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);S.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{k.pop();let e=ie(k);O=this.patternIdxToConfig[e],re=this.charCodeToPatternIdxToConfig[e],D=O.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;j=re&&t?ae:M}},`pop_mode`);function N(e){k.push(e),re=this.charCodeToPatternIdxToConfig[e],O=this.patternIdxToConfig[e],D=O.length,D=O.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;j=re&&t?ae:M}o(N,`push_mode`),N.call(this,t);let P,F=this.config.recoveryEnabled;for(;y<v;){c=null;let t=ee.charCodeAt(y),o=j(t),te=o.length;for(n=0;n<te;n++){P=o[n];let r=P.pattern;l=null;let d=P.short;if(d===!1?P.isCustom===!0?(_=r.exec(ee,y,x,w),_===null?c=null:(c=_[0],_.payload!==void 0&&(l=_.payload))):(this.updateLastIndex(r,y),c=this.match(r,e,y)):t===d&&(c=r),c!==null){if(s=P.longerAlt,s!==void 0){let t=s.length;for(i=0;i<t;i++){let t=O[s[i]],n=t.pattern;if(u=null,t.isCustom===!0?(_=n.exec(ee,y,x,w),_===null?a=null:(a=_[0],_.payload!==void 0&&(u=_.payload))):(this.updateLastIndex(n,y),a=this.match(n,e,y)),a&&a.length>c.length){c=a,l=u,P=t;break}}}break}}if(c!==null){if(d=c.length,f=P.group,f!==void 0&&(p=P.tokenTypeIdx,m=this.createTokenInstance(c,y,p,P.tokenType,C,ne,d),this.handlePayload(m,l),f===!1?b=this.addToken(x,b,m):w[f].push(m)),e=this.chopInput(e,d),y+=d,ne=this.computeNewColumn(ne,d),T===!0&&P.canLineTerminator===!0){let e=0,t,n;E.lastIndex=0;do t=E.test(c),t===!0&&(n=E.lastIndex-1,e++);while(t===!0);e!==0&&(C+=e,ne=d-n,this.updateTokenEndLineColumnLocation(m,f,n,e,C,ne,d))}this.handleModes(P,oe,N,m)}else{let t=y,n=C,i=ne,a=F===!1;for(;a===!1&&y<v;)for(e=this.chopInput(e,1),y++,r=0;r<D;r++){let t=O[r],n=t.pattern,i=t.short;if(i===!1?t.isCustom===!0?a=n.exec(ee,y,x,w)!==null:(this.updateLastIndex(n,y),a=n.exec(e)!==null):ee.charCodeAt(y)===i&&(a=!0),a===!0)break}if(h=y-t,ne=this.computeNewColumn(ne,h),g=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(ee,t,h,n,i,ie(k)),S.push({offset:t,line:n,column:i,length:h,message:g}),F===!1)break}}return this.hasCustom||(x.length=b),{tokens:x,groups:w,errors:S}}handleModes(e,t,n,r){if(e.pop===!0){let i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,r,i,a,o){let s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,r===1&&s===!0||(e.endLine=i+c,e.endColumn=a-1+-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}matchWithTest(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null}matchWithExec(e,t){let n=e.exec(t);return n===null?null:n[0]}};Mc.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,Mc.NA=/NOT_APPLICABLE/;function Nc(e){return Pc(e)?e.LABEL:e.name}o(Nc,`tokenLabel`);function Pc(e){return h(e.LABEL)&&e.LABEL!==``}o(Pc,`hasTokenLabel`);var Fc=`parent`,Ic=`categories`,Lc=`label`,Rc=`group`,zc=`push_mode`,Bc=`pop_mode`,Vc=`longer_alt`,Hc=`line_breaks`,Uc=`start_chars_hint`;function Wc(e){return Gc(e)}o(Wc,`createToken`);function Gc(e){let t=e.pattern,n={};if(n.name=e.name,S(t)||(n.PATTERN=t),f(e,Fc))throw`The parent property is no longer supported.
|
||
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return f(e,Ic)&&(n.CATEGORIES=e[Ic]),yc([n]),f(e,Lc)&&(n.LABEL=e[Lc]),f(e,Rc)&&(n.GROUP=e[Rc]),f(e,Bc)&&(n.POP_MODE=e[Bc]),f(e,zc)&&(n.PUSH_MODE=e[zc]),f(e,Vc)&&(n.LONGER_ALT=e[Vc]),f(e,Hc)&&(n.LINE_BREAKS=e[Hc]),f(e,Uc)&&(n.START_CHARS_HINT=e[Uc]),n}o(Gc,`createTokenInternal`);var Kc=Wc({name:`EOF`,pattern:Mc.NA});yc([Kc]);function qc(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}o(qc,`createTokenInstance`);function Jc(e,t){return hc(e,t)}o(Jc,`tokenMatcher`);var Yc={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){return`Expecting ${Pc(e)?`--> ${Nc(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return`Redundant input, expecting EOF but found: `+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let a=`
|
||
but found: '`+k(t).image+`'`;return r?`Expecting: `+r+a:`Expecting: one of these possible Token sequences:
|
||
${A(A(T(e,(e,t)=>e.concat(t),[]),e=>`[${A(e,e=>Nc(e)).join(`, `)}]`),(e,t)=>` ${t+1}. ${e}`).join(`
|
||
`)}`+a},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i=`
|
||
but found: '`+k(t).image+`'`;return n?`Expecting: `+n+i:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
|
||
<${A(e,e=>`[${A(e,e=>Nc(e)).join(`,`)}]`).join(` ,`)}>`+i}};Object.freeze(Yc);var Xc={buildRuleNotFoundError(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
|
||
inside top level rule: ->`+e.name+`<-`}},Zc={buildDuplicateFoundError(e,t){function n(e){return e instanceof q?e.terminalType.name:e instanceof Ko?e.nonTerminalName:``}o(n,`getExtraProductionArgument`);let r=e.name,i=k(t),a=i.idx,s=os(i),c=n(i),l=`->${s}${a>0?a:``}<- ${c?`with argument: ->${c}<-`:``}
|
||
appears more than once (${t.length} times) in the top level rule: ->${r}<-.
|
||
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
||
`;return l=l.replace(/[ \t]+/g,` `),l=l.replace(/\s\s+/g,`
|
||
`),l},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
|
||
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
|
||
To resolve this make sure each Terminal and Non-Terminal names are unique
|
||
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
||
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=A(e.prefixPath,e=>Nc(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix
|
||
in <OR${n}> inside <${e.topLevelRule.name}> Rule,
|
||
<${t}> may appears as a prefix path in all these alternatives.
|
||
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
||
For Further details.`},buildAlternationAmbiguityError(e){let t=A(e.prefixPath,e=>Nc(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,
|
||
<${t}> may appears as a prefix path in all these alternatives.
|
||
`;return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
||
For Further details.`,r},buildEmptyRepetitionError(e){let t=os(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
|
||
This could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
||
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:
|
||
<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
||
has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.
|
||
rule: <${t}> can be invoked from itself (directly or indirectly)
|
||
without consuming any Tokens. The grammar path that causes this is:
|
||
${`${t} --> ${A(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}
|
||
To fix this refactor your grammar to remove the left recursion.
|
||
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof qo?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function Qc(e,t){let n=new $c(e,t);return n.resolveRefs(),n.errors}o(Qc,`resolveGrammar`);var $c=class extends ns{static{o(this,`GastRefResolverVisitor`)}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){p(F(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:Yu.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},el=class extends ss{static{o(this,`AbstractNextPossibleTokensWalker`)}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=P(this.path.ruleStack).reverse(),this.occurrenceStack=P(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){d(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},tl=class extends el{static{o(this,`NextAfterTokenWalker`)}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found&&(this.possibleTokTypes=ls(new Jo({definition:t.concat(n)})),this.found=!0)}},nl=class extends ss{static{o(this,`AbstractNextTerminalAfterProductionWalker`)}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},rl=class extends nl{static{o(this,`NextTerminalAfterManyWalker`)}walkMany(e,t,n){if(e.idx===this.occurrence){let e=k(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof q&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},il=class extends nl{static{o(this,`NextTerminalAfterManySepWalker`)}walkManySep(e,t,n){if(e.idx===this.occurrence){let e=k(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof q&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},al=class extends nl{static{o(this,`NextTerminalAfterAtLeastOneWalker`)}walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=k(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof q&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},ol=class extends nl{static{o(this,`NextTerminalAfterAtLeastOneSepWalker`)}walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=k(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof q&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function sl(e,t,n=[]){n=P(n);let r=[],i=0;function a(t){return t.concat(O(e,i+1))}o(a,`remainingPathWith`);function s(e){let i=sl(a(e),t,n);return r.concat(i)}for(o(s,`getAlternativesForProd`);n.length<t&&i<e.length;){let t=e[i];if(t instanceof Jo||t instanceof Ko)return s(t.definition);if(t instanceof Yo)r=s(t.definition);else if(t instanceof Xo)return s(t.definition.concat([new K({definition:t.definition})]));else if(t instanceof Zo)return s([new Jo({definition:t.definition}),new K({definition:[new q({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof Qo)r=s(t.definition.concat([new K({definition:[new q({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof K)r=s(t.definition.concat([new K({definition:t.definition})]));else{if(t instanceof $o)return p(t.definition,e=>{d(e.definition)===!1&&(r=s(e.definition))}),r;if(t instanceof q)n.push(t.terminalType);else throw Error(`non exhaustive match`)}i++}return r.push({partialPath:n,suffixDef:O(e,i)}),r}o(sl,`possiblePathsFrom`);function cl(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,c=t.length,l=c-r-1,u=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!d(f);){let e=f.pop();if(e===o){s&&ie(f).idx<=l&&f.pop();continue}let r=e.def,p=e.idx,m=e.ruleStack,h=e.occurrenceStack;if(d(r))continue;let g=r[0];if(g===i){let e={idx:p,def:O(r),ruleStack:b(m),occurrenceStack:b(h)};f.push(e)}else if(g instanceof q)if(p<c-1){let e=p+1,i=t[e];if(n(i,g.terminalType)){let t={idx:e,def:O(r),ruleStack:m,occurrenceStack:h};f.push(t)}}else if(p===c-1)u.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:m,occurrenceStack:h}),s=!0;else throw Error(`non exhaustive match`);else if(g instanceof Ko){let e=P(m);e.push(g.nonTerminalName);let t=P(h);t.push(g.idx);let n={idx:p,def:g.definition.concat(a,O(r)),ruleStack:e,occurrenceStack:t};f.push(n)}else if(g instanceof Yo){let e={idx:p,def:O(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t={idx:p,def:g.definition.concat(O(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof Xo){let e=new K({definition:g.definition,idx:g.idx}),t={idx:p,def:g.definition.concat([e],O(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof Zo){let e=new K({definition:[new q({terminalType:g.separator})].concat(g.definition),idx:g.idx}),t={idx:p,def:g.definition.concat([e],O(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof Qo){let e={idx:p,def:O(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t=new K({definition:[new q({terminalType:g.separator})].concat(g.definition),idx:g.idx}),n={idx:p,def:g.definition.concat([t],O(r)),ruleStack:m,occurrenceStack:h};f.push(n)}else if(g instanceof K){let e={idx:p,def:O(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t=new K({definition:g.definition,idx:g.idx}),n={idx:p,def:g.definition.concat([t],O(r)),ruleStack:m,occurrenceStack:h};f.push(n)}else if(g instanceof $o)for(let e=g.definition.length-1;e>=0;e--){let t={idx:p,def:g.definition[e].definition.concat(O(r)),ruleStack:m,occurrenceStack:h};f.push(t),f.push(o)}else if(g instanceof Jo)f.push({idx:p,def:g.definition.concat(O(r)),ruleStack:m,occurrenceStack:h});else if(g instanceof qo)f.push(ll(g,p,m,h));else throw Error(`non exhaustive match`)}return u}o(cl,`nextPossibleTokensAfter`);function ll(e,t,n,r){let i=P(n);i.push(e.name);let a=P(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}o(ll,`expandTopLevelRule`);var Y;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(Y||={});function ul(e){if(e instanceof Yo||e===`Option`)return Y.OPTION;if(e instanceof K||e===`Repetition`)return Y.REPETITION;if(e instanceof Xo||e===`RepetitionMandatory`)return Y.REPETITION_MANDATORY;if(e instanceof Zo||e===`RepetitionMandatoryWithSeparator`)return Y.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Qo||e===`RepetitionWithSeparator`)return Y.REPETITION_WITH_SEPARATOR;if(e instanceof $o||e===`Alternation`)return Y.ALTERNATION;throw Error(`non exhaustive match`)}o(ul,`getProdType`);function dl(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=ul(r);return a===Y.ALTERNATION?Sl(t,n,i):Cl(t,n,a,i)}o(dl,`getLookaheadPaths`);function fl(e,t,n,r,i,a){let o=Sl(e,t,n);return a(o,r,El(o)?gc:hc,i)}o(fl,`buildLookaheadFuncForOr`);function pl(e,t,n,r,i,a){let o=Cl(e,t,i,n),s=El(o)?gc:hc;return a(o[0],s,r)}o(pl,`buildLookaheadFuncForOptionalProd`);function ml(e,t,n,r){let i=e.length,a=I(e,e=>I(e,e=>e.length===1));if(t)return function(t){let r=A(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(!(o!==void 0&&o.call(this)===!1))e:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue e;return t}}};if(a&&!r){let t=T(A(e,e=>j(e)),(e,t,n)=>(p(t,t=>{f(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),p(t.categoryMatches,t=>{f(e,t)||(e[t]=n)})}),e),{});return function(){return t[this.LA(1).tokenTypeIdx]}}else return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;e:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue e;return t}}}}o(ml,`buildAlternativesLookAheadFunc`);function hl(e,t,n){let r=I(e,e=>e.length===1),i=e.length;if(r&&!n){let t=j(e);if(t.length===1&&d(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=T(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,p(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}else return function(){e:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue e;return!0}return!1}}o(hl,`buildSingleAlternativeLookaheadFunction`);var gl=class extends ss{static{o(this,`RestDefinitionFinderWalker`)}constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1}walkOption(e,t,n){this.checkIsTarget(e,Y.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Y.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Y.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Y.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Y.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},_l=class extends ns{static{o(this,`InsideDefinitionFinderVisitor`)}constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Y.OPTION)}visitRepetition(e){this.checkIsTarget(e,Y.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Y.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Y.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Y.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Y.ALTERNATION)}};function vl(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}o(vl,`initializeArrayOfArrays`);function yl(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}o(yl,`pathToHashKeys`);function bl(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}o(bl,`isUniquePrefixHash`);function xl(e,t){let n=A(e,e=>sl([e],1)),r=vl(n.length),i=A(n,e=>{let t={};return p(e,e=>{p(yl(e.partialPath),e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=vl(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let c=s[n].partialPath,l=s[n].suffixDef,u=yl(c);if(bl(i,u,o)||d(l)||c.length===t){let e=r[o];if(wl(e,c)===!1){e.push(c);for(let e=0;e<u.length;e++){let t=u[e];i[o][t]=!0}}}else{let t=sl(l,e+1,c);a[o]=a[o].concat(t),p(t,e=>{p(yl(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}o(xl,`lookAheadSequenceFromAlternatives`);function Sl(e,t,n,r){let i=new _l(e,Y.ALTERNATION,r);return t.accept(i),xl(i.result,n)}o(Sl,`getLookaheadPathsForOr`);function Cl(e,t,n,r){let i=new _l(e,n);t.accept(i);let a=i.result,o=new gl(t,e,n).startWalking();return xl([new Jo({definition:a}),new Jo({definition:o})],r)}o(Cl,`getLookaheadPathsForOptionalProd`);function wl(e,t){e:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(!(n===i||i.categoryMatchesMap[n.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}o(wl,`containsPath`);function Tl(e,t){return e.length<t.length&&I(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}o(Tl,`isStrictPrefixOfPath`);function El(e){return I(e,e=>I(e,e=>I(e,e=>d(e.categoryMatches))))}o(El,`areTokenCategoriesNotUsed`);function Dl(e){return A(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:Yu.CUSTOM_LOOKAHEAD_VALIDATION},e))}o(Dl,`validateLookahead`);function Ol(e,t,n,r){let i=M(e,e=>kl(e,n)),a=Gl(e,t,n),o=M(e,e=>Vl(e,n)),s=M(e,t=>Nl(t,e,r,n));return i.concat(a,o,s)}o(Ol,`validateGrammar`);function kl(e,t){let n=new Ml;e.accept(n);let r=n.allProductions;return A(F(C(ne(r,Al),e=>e.length>1)),n=>{let r=k(n),i=t.buildDuplicateFoundError(e,n),a=os(r),o={message:i,type:Yu.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=jl(r);return s&&(o.parameter=s),o})}o(kl,`validateDuplicateProductions`);function Al(e){return`${os(e)}_#_${e.idx}_#_${jl(e)}`}o(Al,`identifyProductionForDuplicates`);function jl(e){return e instanceof q?e.terminalType.name:e instanceof Ko?e.nonTerminalName:``}o(jl,`getExtraProductionArgument`);var Ml=class extends ns{static{o(this,`OccurrenceValidationCollector`)}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function Nl(e,t,n,r){let i=[];if(T(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:Yu.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}o(Nl,`validateRuleDoesNotAlreadyExist`);function Pl(e,t,n){let r=[],i;return x(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Yu.INVALID_RULE_OVERRIDE,ruleName:e})),r}o(Pl,`validateRuleIsOverridden`);function Fl(e,t,n,r=[]){let i=[],a=Il(t.definition);if(d(a))return[];{let t=e.name;x(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Yu.LEFT_RECURSION,ruleName:t});let o=M(re(a,r.concat([e])),t=>{let i=P(r);return i.push(t),Fl(e,t,n,i)});return i.concat(o)}}o(Fl,`validateNoLeftRecursion`);function Il(e){let t=[];if(d(e))return t;let n=k(e);if(n instanceof Ko)t.push(n.referencedRule);else if(n instanceof Jo||n instanceof Yo||n instanceof Xo||n instanceof Zo||n instanceof Qo||n instanceof K)t=t.concat(Il(n.definition));else if(n instanceof $o)t=j(A(n.definition,e=>Il(e.definition)));else if(!(n instanceof q))throw Error(`non exhaustive match`);let r=is(n),i=e.length>1;if(r&&i){let n=O(e);return t.concat(Il(n))}else return t}o(Il,`getFirstNoneTerminal`);var Ll=class extends ns{static{o(this,`OrCollector`)}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Rl(e,t){let n=new Ll;e.accept(n);let r=n.alternations;return M(r,n=>M(b(n.definition),(r,i)=>d(cl([r],[],hc,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:Yu.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}o(Rl,`validateEmptyOrAlternative`);function zl(e,t,n){let r=new Ll;e.accept(r);let i=r.alternations;return i=w(i,e=>e.ignoreAmbiguities===!0),M(i,r=>{let i=r.idx,a=Sl(i,e,r.maxLookahead||t,r),o=Ul(a,r,e,n),s=Wl(a,r,e,n);return o.concat(s)})}o(zl,`validateAmbiguousAlternationAlternatives`);var Bl=class extends ns{static{o(this,`RepetitionCollector`)}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function Vl(e,t){let n=new Ll;e.accept(n);let r=n.alternations;return M(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:Yu.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}o(Vl,`validateTooManyAlts`);function Hl(e,t,n){let r=[];return p(e,e=>{let i=new Bl;e.accept(i);let a=i.allProductions;p(a,i=>{let a=ul(i),o=i.maxLookahead||t,s=i.idx,c=Cl(s,e,a,o)[0];if(d(j(c))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:Yu.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}o(Hl,`validateSomeNonEmptyLookaheadPath`);function Ul(e,t,n,r){let i=[];return A(T(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||p(r,r=>{let o=[a];p(e,(e,n)=>{a!==n&&wl(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!wl(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),e=>{let i=A(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Yu.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}o(Ul,`checkAlternativesAmbiguities`);function Wl(e,t,n,r){let i=T(e,(e,t,n)=>{let r=A(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return oe(M(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,o=e.path;return A(E(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&Tl(e.path,o)),e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Yu.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}o(Wl,`checkPrefixAlternativesAmbiguities`);function Gl(e,t,n){let r=[],i=A(t,e=>e.name);return p(e,e=>{let t=e.name;if(x(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:Yu.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}o(Gl,`checkTerminalAndNoneTerminalsNameSpace`);function Kl(e){let t=N(e,{errMsgProvider:Xc}),n={};return p(e.rules,e=>{n[e.name]=e}),Qc(n,t.errMsgProvider)}o(Kl,`resolveGrammar`);function ql(e){return e=N(e,{errMsgProvider:Zc}),Ol(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}o(ql,`validateGrammar`);var Jl=`MismatchedTokenException`,Yl=`NoViableAltException`,Xl=`EarlyExitException`,Zl=`NotAllInputParsedException`,Ql=[Jl,Yl,Xl,Zl];Object.freeze(Ql);function $l(e){return x(Ql,e.name)}o($l,`isRecognitionException`);var eu=class extends Error{static{o(this,`RecognitionException`)}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},tu=class extends eu{static{o(this,`MismatchedTokenException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Jl}},nu=class extends eu{static{o(this,`NoViableAltException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Yl}},ru=class extends eu{static{o(this,`NotAllInputParsedException`)}constructor(e,t){super(e,t),this.name=Zl}},iu=class extends eu{static{o(this,`EarlyExitException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Xl}},au={},ou=`InRuleRecoveryException`,su=class extends Error{static{o(this,`InRuleRecoveryException`)}constructor(e){super(e),this.name=ou}},cu=class{static{o(this,`Recoverable`)}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=f(e,`recoveryEnabled`)?e.recoveryEnabled:qu.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=lu)}getTokenToInsert(e){let t=qc(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),s=[],c=!1,l=this.LA(1),u=this.LA(1),d=o(()=>{let e=this.LA(0),t=new tu(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),l,this.LA(0));t.resyncedTokens=b(s),this.SAVE_ERROR(t)},`generateErrorMessage`);for(;!c;)if(this.tokenMatcher(u,r)){d();return}else if(n.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,i)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,s));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new su(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||d(t))return!1;let n=this.LA(1);return ae(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return x(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=ae(e,e=>Jc(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return au;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return A(e,(n,r)=>r===0?au:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return j(A(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===au)return[Kc];let t=e.ruleName+e.idxInCallingRule+ps+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Kc)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return b(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:P(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return A(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function lu(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),c=this.firstAfterRepMap[s];if(c===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];c=new a(t,i).startWalking(),this.firstAfterRepMap[s]=c}let l=c.token,u=c.occurrence,d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=Kc,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}o(lu,`attemptInRepetitionRecovery`);function uu(e,t,n){return n|t|e}o(uu,`getKeyForAutomaticLookahead`);var du=class{static{o(this,`LLkLookaheadStrategy`)}constructor(e){this.maxLookahead=e?.maxLookahead??qu.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(d(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return M(e,e=>Fl(e,e,Zc))}validateEmptyOrAlternatives(e){return M(e,e=>Rl(e,Zc))}validateAmbiguousAlternationAlternatives(e,t){return M(e,e=>zl(e,t,Zc))}validateSomeNonEmptyLookaheadPath(e,t){return Hl(e,t,Zc)}buildLookaheadForAlternation(e){return fl(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ml)}buildLookaheadForOptional(e){return pl(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ul(e.prodType),hl)}},fu=class{static{o(this,`LooksAhead`)}initLooksAhead(e){this.dynamicTokensEnabled=f(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:qu.dynamicTokensEnabled,this.maxLookahead=f(e,`maxLookahead`)?e.maxLookahead:qu.maxLookahead,this.lookaheadStrategy=f(e,`lookaheadStrategy`)?e.lookaheadStrategy:new du({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){p(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=mu(e);p(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${os(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=uu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),p(n,t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,os(t))}),p(r,t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,os(t))}),p(i,t=>{this.computeLookaheadFunc(e,t.idx,1024,`RepetitionMandatory`,t.maxLookahead,os(t))}),p(a,t=>{this.computeLookaheadFunc(e,t.idx,1536,`RepetitionMandatoryWithSeparator`,t.maxLookahead,os(t))}),p(o,t=>{this.computeLookaheadFunc(e,t.idx,1280,`RepetitionWithSeparator`,t.maxLookahead,os(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=uu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return uu(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},pu=new class extends ns{static{o(this,`DslMethodsCollectorVisitor`)}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function mu(e){pu.reset(),e.accept(pu);let t=pu.dslMethods;return pu.reset(),t}o(mu,`collectMethods`);function hu(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}o(hu,`setNodeLocationOnlyOffset`);function gu(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}o(gu,`setNodeLocationFull`);function _u(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}o(_u,`addTerminalToCst`);function vu(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}o(vu,`addNoneTerminalToCst`);var yu=`name`;function bu(e,t){Object.defineProperty(e,yu,{enumerable:!1,configurable:!0,writable:!1,value:t})}o(bu,`defineNameProp`);function xu(e,t){let n=y(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}o(xu,`defaultVisit`);function Su(e,t){let n=o(function(){},`derivedConstructor`);return bu(n,e+`BaseSemantics`),n.prototype={visit:o(function(e,t){if(l(e)&&(e=e[0]),!S(e))return this[e.name](e.children,t)},`visit`),validateVisitor:o(function(){let e=Tu(this,t);if(!d(e)){let t=A(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
||
${t.join(`
|
||
|
||
`).replace(/\n/g,`
|
||
`)}`)}},`validateVisitor`)},n.prototype.constructor=n,n._RULE_NAMES=t,n}o(Su,`createBaseSemanticVisitorConstructor`);function Cu(e,t,n){let r=o(function(){},`derivedConstructor`);bu(r,e+`BaseSemanticsWithDefaults`);let i=Object.create(n.prototype);return p(t,e=>{i[e]=xu}),r.prototype=i,r.prototype.constructor=r,r}o(Cu,`createBaseVisitorConstructorWithDefaults`);var wu;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(wu||={});function Tu(e,t){return Eu(e,t)}o(Tu,`validateVisitor`);function Eu(e,t){return oe(A(E(t,t=>u(e[t])===!1),t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:wu.MISSING_METHOD,methodName:t})))}o(Eu,`validateMissingCstMethods`);var Du=class{static{o(this,`TreeBuilder`)}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=f(e,`nodeLocationTracking`)?e.nodeLocationTracking:qu.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=g,this.cstFinallyStateUpdate=g,this.cstPostTerminal=g,this.cstPostNonTerminal=g,this.cstPostRule=g;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gu,this.setNodeLocationFromNode=gu,this.cstPostRule=g,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=g,this.setNodeLocationFromNode=g,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=hu,this.setNodeLocationFromNode=hu,this.cstPostRule=g,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=g,this.setNodeLocationFromNode=g,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=g,this.setNodeLocationFromNode=g,this.cstPostRule=g,this.setInitialNodeLocation=g;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];_u(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];vu(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(S(this.baseCstVisitorConstructor)){let e=Su(this.className,y(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(S(this.baseCstVisitorWithDefaultsConstructor)){let e=Cu(this.className,y(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},Ou=class{static{o(this,`LexerAdapter`)}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ku}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Ku:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},ku=class{static{o(this,`RecognizerApi`)}ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Ju){if(x(this.definedRulesNames,e)){let t={message:Zc.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Yu.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Ju){let r=Pl(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if($l(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return es(F(this.gastProductionsCache))}},Au=class{static{o(this,`RecognizerEngine`)}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=gc,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},f(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
||
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
||
For Further details.`);if(l(e)){if(d(e))throw Error(`A Token Vocabulary cannot be empty.
|
||
Note that the first argument for the parser constructor
|
||
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
||
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
||
For Further details.`)}if(l(e))this.tokensMap=T(e,(e,t)=>(e[t.name]=t,e),{});else if(f(e,`modes`)&&I(j(F(e.modes)),kc))this.tokensMap=T(se(j(F(e.modes))),(e,t)=>(e[t.name]=t,e),{});else if(s(e))this.tokensMap=P(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=Kc,this.tokenMatcher=I(f(e,`modes`)?j(F(e.modes)):F(e),e=>d(e.categoryMatches))?gc:hc,yc(F(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
||
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=f(n,`resyncEnabled`)?n.resyncEnabled:Ju.resyncEnabled,i=f(n,`recoveryValueFunc`)?n.recoveryValueFunc:Ju.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let s;return s=this.outputCst===!0?o(function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);let r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},`invokeRuleWithTry`):o(function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},`invokeRuleWithTryCst`),Object.assign(s,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let r=this.RULE_STACK.length===1,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if($l(e)){let t=e;if(i){let r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r))if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}else return n(e);else{if(this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}}else{if(r)return this.moveToTerminatedState(),n(e);throw t}}else throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof e!=`function`){i=e.DEF;let t=e.GATE;if(t!==void 0){let e=r;r=o(()=>t.call(this)&&e.call(this),`lookAheadFunc`)}}else i=e;if(r.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=o(()=>e.call(this)&&t.call(this),`lookAheadFunc`)}}else i=t;if(r.call(this)===!0){let e=this.doSingleRepetition(i);for(;r.call(this)===!0&&e===!0;)e=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Y.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],r,1024,e,al)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=o(()=>this.tokenMatcher(this.LA(1),i),`separatorLookAheadFunc`);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,ol],t,1536,e,ol)}else throw this.raiseEarlyExitException(e,Y.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=o(()=>e.call(this)&&t.call(this),`lookaheadFunction`)}}else i=t;let a=!0;for(;r.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],r,768,e,rl,a)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=o(()=>this.tokenMatcher(this.LA(1),i),`separatorLookAheadFunc`);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,il],t,1280,e,il)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,1536,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(256,t),r=l(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(i!==void 0)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ru(t,e))}}subruleInternal(e,t,n){let r;try{let i=n===void 0?void 0:n.ARGS;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw $l(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA(1);this.tokenMatcher(t,e)===!0?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new tu(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===ou?n:e}}else throw n}saveRecogState(){let e=this.errors,t=P(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Kc)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},ju=class{static{o(this,`ErrorHandler`)}initErrorHandler(e){this._errors=[],this.errorMessageProvider=f(e,`errorMessageProvider`)?e.errorMessageProvider:qu.errorMessageProvider}SAVE_ERROR(e){if($l(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:P(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)}get errors(){return P(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],a=Cl(e,i,t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));let s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new iu(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],i=Sl(e,r,this.maxLookahead),a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));let o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new nu(s,this.LA(1),o))}},Mu=class{static{o(this,`ContentAssist`)}initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(S(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return cl([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=k(e.ruleStack),n=this.getGAstProductions()[t];return new tl(n,e).startWalking()}},Nu={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(Nu);var Pu=!0,Fu=2**8-1,Iu=Wc({name:`RECORDING_PHASE_TOKEN`,pattern:Mc.NA});yc([Iu]);var Lu=qc(Iu,`This IToken indicates the Parser is in Recording Phase
|
||
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Lu);var Ru={name:`This CSTNode indicates the Parser is in Recording Phase
|
||
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},zu=class{static{o(this,`GastRecorder`)}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,()=>{for(let e=0;e<10;e++){let t=e>0?e:``;this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,()=>{let e=this;for(let t=0;t<10;t++){let n=t>0?t:``;delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Ku}topLevelRuleRecord(e,t){try{let n=new qo({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`
|
||
This error was thrown during the "grammar recording phase" For more info see:
|
||
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}}optionInternalRecord(e,t){return Bu.call(this,Yo,e,t)}atLeastOneInternalRecord(e,t){Bu.call(this,Xo,t,e)}atLeastOneSepFirstInternalRecord(e,t){Bu.call(this,Zo,t,e,Pu)}manyInternalRecord(e,t){Bu.call(this,K,t,e)}manySepFirstInternalRecord(e,t){Bu.call(this,Qo,t,e,Pu)}orInternalRecord(e,t){return Vu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Uu(t),!e||f(e,`ruleName`)===!1){let n=Error(`<SUBRULE${Hu(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
||
inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=ie(this.recordingProdStack),i=e.ruleName,a=new Ko({idx:t,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?Ru:Nu}consumeInternalRecord(e,t,n){if(Uu(t),!Tc(e)){let n=Error(`<CONSUME${Hu(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
||
inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=ie(this.recordingProdStack),i=new q({idx:t,terminalType:e,label:n?.LABEL});return r.definition.push(i),Lu}};function Bu(e,t,n,r=!1){Uu(n);let i=ie(this.recordingProdStack),a=u(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),f(t,`MAX_LOOKAHEAD`)&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),Nu}o(Bu,`recordProd`);function Vu(e,t){Uu(t);let n=ie(this.recordingProdStack),r=l(e)===!1,i=r===!1?e:e.DEF,a=new $o({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});return f(e,`MAX_LOOKAHEAD`)&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=v(i,e=>u(e.GATE)),n.definition.push(a),p(i,e=>{let t=new Jo({definition:[]});a.definition.push(t),f(e,`IGNORE_AMBIGUITIES`)?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:f(e,`GATE`)&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Nu}o(Vu,`recordOrProd`);function Hu(e){return e===0?``:`${e}`}o(Hu,`getIdxSuffix`);function Uu(e){if(e<0||e>Fu){let t=Error(`Invalid DSL Method idx value: <${e}>
|
||
Idx value must be a none negative value smaller than ${Fu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}o(Uu,`assertMethodIdxIsValid`);var Wu=class{static{o(this,`PerformanceTracer`)}initPerformanceTracer(e){if(f(e,`traceInitPerf`)){let t=e.traceInitPerf,n=typeof t==`number`;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=qu.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=Vo(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}else return t()}};function Gu(e,t){t.forEach(t=>{let n=t.prototype;Object.getOwnPropertyNames(n).forEach(r=>{if(r===`constructor`)return;let i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]})})}o(Gu,`applyMixins`);var Ku=qc(Kc,``,NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ku);var qu=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Yc,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),Ju=Object.freeze({recoveryValueFunc:o(()=>{},`recoveryValueFunc`),resyncEnabled:!0}),Yu;(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`,e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]=`CUSTOM_LOOKAHEAD_VALIDATION`})(Yu||={});function Xu(e=void 0){return function(){return e}}o(Xu,`EMPTY_ALT`);var Zu=class e{static{o(this,`Parser`)}static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT(`performSelfAnalysis`,()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT(`toFastProps`,()=>{Ho(this)}),this.TRACE_INIT(`Grammar Recording`,()=>{try{this.enableRecording(),p(this.definedRulesNames,e=>{let t=this[e].originalGrammarAction,n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT(`Grammar Resolving`,()=>{r=Kl({rules:F(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT(`Grammar Validations`,()=>{if(d(r)&&this.skipValidations===!1){let e=ql({rules:F(this.gastProductionsCache),tokenTypes:F(this.tokensMap),errMsgProvider:Zc,grammarName:n}),t=Dl({lookaheadStrategy:this.lookaheadStrategy,rules:F(this.gastProductionsCache),tokenTypes:F(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(e,t)}}),d(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT(`computeAllProdsFollows`,()=>{this.resyncFollows=hs(F(this.gastProductionsCache))}),this.TRACE_INIT(`ComputeLookaheadFunctions`,()=>{var e,t;(t=(e=this.lookaheadStrategy).initialize)==null||t.call(e,{rules:F(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(F(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!d(this.definitionErrors))throw t=A(this.definitionErrors,e=>e.message),Error(`Parser Definition Errors detected:
|
||
${t.join(`
|
||
-------------------------------
|
||
`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),f(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
||
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
||
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
||
For further details.`);this.skipValidations=f(t,`skipValidations`)?t.skipValidations:qu.skipValidations}};Zu.DEFER_DEFINITION_ERRORS_HANDLING=!1,Gu(Zu,[cu,fu,Du,Ou,Au,ku,ju,Mu,zu,Wu]);var Qu=class extends Zu{static{o(this,`EmbeddedActionsParser`)}constructor(e,t=qu){let n=P(t);n.outputCst=!1,super(e,n)}};function $u(e,t,n){return`${e.name}_${t}_${n}`}o($u,`buildATNKey`);var ed=1,td=2,nd=4,rd=5,id=7,ad=8,od=9,sd=10,cd=11,ld=12,ud=class{static{o(this,`AbstractTransition`)}constructor(e){this.target=e}isEpsilon(){return!1}},dd=class extends ud{static{o(this,`AtomTransition`)}constructor(e,t){super(e),this.tokenType=t}},fd=class extends ud{static{o(this,`EpsilonTransition`)}constructor(e){super(e)}isEpsilon(){return!0}},pd=class extends ud{static{o(this,`RuleTransition`)}constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function md(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};hd(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=Cd(t,n,n);i!==void 0&&Nd(t,n,i)}return t}o(md,`createATN`);function hd(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=Pd(e,n,void 0,{type:td}),a=Pd(e,n,void 0,{type:id});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}o(hd,`createRuleStartAndStopATNStates`);function gd(e,t,n){return n instanceof q?jd(e,t,n.terminalType,n):n instanceof Ko?Md(e,t,n):n instanceof $o?xd(e,t,n):n instanceof Yo?Sd(e,t,n):n instanceof K?_d(e,t,n):n instanceof Qo?vd(e,t,n):n instanceof Xo?yd(e,t,n):n instanceof Zo?bd(e,t,n):Cd(e,t,n)}o(gd,`atom`);function _d(e,t,n){let r=Pd(e,t,n,{type:rd});return Dd(e,r),Td(e,t,n,Od(e,t,r,n,Cd(e,t,n)))}o(_d,`repetition`);function vd(e,t,n){let r=Pd(e,t,n,{type:rd});return Dd(e,r),Td(e,t,n,Od(e,t,r,n,Cd(e,t,n)),jd(e,t,n.separator,n))}o(vd,`repetitionSep`);function yd(e,t,n){let r=Pd(e,t,n,{type:nd});return Dd(e,r),wd(e,t,n,Od(e,t,r,n,Cd(e,t,n)))}o(yd,`repetitionMandatory`);function bd(e,t,n){let r=Pd(e,t,n,{type:nd});return Dd(e,r),wd(e,t,n,Od(e,t,r,n,Cd(e,t,n)),jd(e,t,n.separator,n))}o(bd,`repetitionMandatorySep`);function xd(e,t,n){let r=Pd(e,t,n,{type:ed});return Dd(e,r),Od(e,t,r,n,...A(n.definition,n=>gd(e,t,n)))}o(xd,`alternation`);function Sd(e,t,n){let r=Pd(e,t,n,{type:ed});return Dd(e,r),Ed(e,t,n,Od(e,t,r,n,Cd(e,t,n)))}o(Sd,`option`);function Cd(e,t,n){let r=E(A(n.definition,n=>gd(e,t,n)),e=>e!==void 0);return r.length===1?r[0]:r.length===0?void 0:Ad(e,r)}o(Cd,`block`);function wd(e,t,n,r,i){let a=r.left,o=r.right,s=Pd(e,t,n,{type:cd});Dd(e,s);let c=Pd(e,t,n,{type:ld});return a.loopback=s,c.loopback=s,e.decisionMap[$u(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,X(o,s),i===void 0?(X(s,a),X(s,c)):(X(s,c),X(s,i.left),X(i.right,a)),{left:a,right:c}}o(wd,`plus`);function Td(e,t,n,r,i){let a=r.left,o=r.right,s=Pd(e,t,n,{type:sd});Dd(e,s);let c=Pd(e,t,n,{type:ld}),l=Pd(e,t,n,{type:od});return s.loopback=l,c.loopback=l,X(s,a),X(s,c),X(o,l),i===void 0?X(l,s):(X(l,c),X(l,i.left),X(i.right,a)),e.decisionMap[$u(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:c}}o(Td,`star`);function Ed(e,t,n,r){let i=r.left,a=r.right;return X(i,a),e.decisionMap[$u(t,`Option`,n.idx)]=i,r}o(Ed,`optional`);function Dd(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}o(Dd,`defineDecisionState`);function Od(e,t,n,r,...i){let a=Pd(e,t,r,{type:ad,start:n});n.end=a;for(let e of i)e===void 0?X(n,a):(X(n,e.left),X(e.right,a));let o={left:n,right:a};return e.decisionMap[$u(t,kd(r),r.idx)]=n,o}o(Od,`makeAlts`);function kd(e){if(e instanceof $o)return`Alternation`;if(e instanceof Yo)return`Option`;if(e instanceof K)return`Repetition`;if(e instanceof Qo)return`RepetitionWithSeparator`;if(e instanceof Xo)return`RepetitionMandatory`;if(e instanceof Zo)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}o(kd,`getProdType`);function Ad(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof pd,o=i,s=t[r+1].left;n.left.type===ed&&n.right.type===ed&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,Id(e,n.right)):X(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}o(Ad,`makeBlock`);function jd(e,t,n,r){let i=Pd(e,t,r,{type:ed}),a=Pd(e,t,r,{type:ed});return Fd(i,new dd(a,n)),{left:i,right:a}}o(jd,`tokenRef`);function Md(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=Pd(e,t,n,{type:ed}),o=Pd(e,t,n,{type:ed});return Fd(a,new pd(i,r,o)),{left:a,right:o}}o(Md,`ruleRef`);function Nd(e,t,n){let r=e.ruleToStartState.get(t);X(r,n.left);let i=e.ruleToStopState.get(t);return X(n.right,i),{left:r,right:i}}o(Nd,`buildRuleHandle`);function X(e,t){Fd(e,new fd(t))}o(X,`epsilon`);function Pd(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}o(Pd,`newState`);function Fd(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}o(Fd,`addTransition`);function Id(e,t){e.states.splice(e.states.indexOf(t),1)}o(Id,`removeState`);var Ld={},Rd=class{static{o(this,`ATNConfigSet`)}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=zd(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return A(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}};function zd(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}o(zd,`getATNConfigKey`);function Bd(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a!==void 0||(a={atnStartState:e,decision:t,states:{}},n[i]=a),a}}o(Bd,`createDFACache`);var Vd=class{static{o(this,`PredicateSet`)}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}},Hd=new Vd,Ud=class extends du{static{o(this,`LLStarLookaheadStrategy`)}constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=md(e.rules),this.dfas=Gd(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:t,rule:n,hasPredicates:r,dynamicTokensEnabled:i}=e,a=this.dfas,o=this.logging,s=$u(n,`Alternation`,t),c=this.atn.decisionMap[s].decision,l=A(dl({maxLookahead:1,occurrence:t,prodType:`Alternation`,rule:n}),e=>A(e,e=>e[0]));if(Wd(l,!1)&&!i){let e=T(l,(e,t,n)=>(p(t,t=>{t&&(e[t.tokenTypeIdx]=n,p(t.categoryMatches,t=>{e[t]=n}))}),e),{});return r?function(t){let n=e[this.LA(1).tokenTypeIdx];if(t!==void 0&&n!==void 0){let e=t[n]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return n}:function(){return e[this.LA(1).tokenTypeIdx]}}else return r?function(e){let t=new Vd,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=Kd.call(this,a,c,t,o);return typeof r==`number`?r:void 0}:function(){let e=Kd.call(this,a,c,Hd,o);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:t,rule:n,prodType:r,dynamicTokensEnabled:i}=e,a=this.dfas,o=this.logging,s=$u(n,r,t),c=this.atn.decisionMap[s].decision,l=A(dl({maxLookahead:1,occurrence:t,prodType:r,rule:n}),e=>A(e,e=>e[0]));if(Wd(l)&&l[0][0]&&!i){let e=l[0],t=j(e);if(t.length===1&&d(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=T(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,p(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}return function(){let e=Kd.call(this,a,c,Hd,o);return typeof e==`object`?!1:e===0}}};function Wd(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}o(Wd,`isLL1Sequence`);function Gd(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=Bd(e.decisionStates[r],r);return n}o(Gd,`initATNSimulator`);function Kd(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=of(i,rf(sf(i.atnStartState))),i.start=a),qd.apply(this,[i,a,n,r])}o(Kd,`adaptivePredict`);function qd(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=$d(i,s);if(t===void 0&&(t=Jd.apply(this,[e,i,s,a,n,r])),t===Ld)return Qd(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}o(qd,`performLookahead`);function Jd(e,t,n,r,i,a){let o=ef(t.configs,n,i);if(o.size===0)return af(e,t,n,Ld),Ld;let s=rf(o),c=nf(o,i);if(c!==void 0)s.isAcceptState=!0,s.prediction=c,s.configs.uniqueAlt=c;else if(ff(o)){let t=_(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,Yd.apply(this,[e,r,o.alts,a])}return s=af(e,t,n,s),s}o(Jd,`computeLookaheadTarget`);function Yd(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(Xd({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}o(Yd,`reportLookaheadAmbiguity`);function Xd(e){let t=A(e.prefixPath,e=>Nc(e)).join(`, `),n=e.production.idx===0?``:e.production.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(`, `)}> in <${Zd(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,
|
||
<${t}> may appears as a prefix path in all these alternatives.
|
||
`;return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
||
For Further details.`,r}o(Xd,`buildAmbiguityError`);function Zd(e){if(e instanceof Ko)return`SUBRULE`;if(e instanceof Yo)return`OPTION`;if(e instanceof $o)return`OR`;if(e instanceof Xo)return`AT_LEAST_ONE`;if(e instanceof Zo)return`AT_LEAST_ONE_SEP`;if(e instanceof Qo)return`MANY_SEP`;if(e instanceof K)return`MANY`;if(e instanceof q)return`CONSUME`;throw Error(`non exhaustive match`)}o(Zd,`getProductionDslName`);function Qd(e,t,n){return{actualToken:n,possibleTokenTypes:te(M(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof dd).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}o(Qd,`buildAdaptivePredictError`);function $d(e,t){return e.edges[t.tokenTypeIdx]}o($d,`getExistingTargetState`);function ef(e,t,n){let r=new Rd,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===id){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=tf(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new Rd;for(let e of r.elements)cf(e,a)}if(i.length>0&&!uf(a))for(let e of i)a.add(e);return a}o(ef,`computeReachSet`);function tf(e,t){if(e instanceof dd&&Jc(t,e.tokenType))return e.target}o(tf,`getReachableTarget`);function nf(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}o(nf,`getUniqueAlt`);function rf(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}o(rf,`newDFAState`);function af(e,t,n,r){return r=of(e,r),t.edges[n.tokenTypeIdx]=r,r}o(af,`addDFAEdge`);function of(e,t){if(t===Ld)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}o(of,`addDFAState`);function sf(e){let t=new Rd,n=e.transitions.length;for(let r=0;r<n;r++)cf({state:e.transitions[r].target,alt:r,stack:[]},t);return t}o(sf,`computeStartState`);function cf(e,t){let n=e.state;if(n.type===id){if(e.stack.length>0){let n=[...e.stack];cf({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=lf(e,r);a!==void 0&&cf(a,t)}}o(cf,`closure`);function lf(e,t){if(t instanceof fd)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof pd){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}o(lf,`getEpsilonTarget`);function uf(e){for(let t of e.elements)if(t.state.type===id)return!0;return!1}o(uf,`hasConfigInRuleStopState`);function df(e){for(let t of e.elements)if(t.state.type!==id)return!1;return!0}o(df,`allConfigsInRuleStopStates`);function ff(e){if(df(e))return!0;let t=pf(e.elements);return mf(t)&&!hf(t)}o(ff,`hasConflictTerminatingPrediction`);function pf(e){let t=new Map;for(let n of e){let e=zd(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}o(pf,`getConflictingAltSets`);function mf(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}o(mf,`hasConflictingAltSet`);function hf(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}o(hf,`hasStateAssociatedWithOneAlt`),It();var gf=class{static{o(this,`CstNodeBuilder`)}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new xf(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let t=new yf;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){let n=new vf(e.startOffset,e.image.length,oa(e),e.tokenType,!t);return n.grammarSource=t,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let t=e.container;if(t){let n=t.content.indexOf(e);n>=0&&t.content.splice(n,1)}}addHiddenNodes(e){let t=[];for(let n of e){let e=new vf(n.startOffset,n.image.length,oa(n),n.tokenType,!0);e.root=this.rootNode,t.push(e)}let n=this.current,r=!1;if(n.content.length>0){n.content.push(...t);return}for(;n.container;){let e=n.container.content.indexOf(n);if(e>0){n.container.content.splice(e,0,...t),r=!0;break}n=n.container}r||this.rootNode.content.unshift(...t)}construct(e){let t=this.current;typeof e.$type==`string`&&!e.$infix&&(this.current.astNode=e),e.$cstNode=t;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},_f=class{static{o(this,`AbstractCstNode`)}get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type==`string`?this._astNode:this.container?.astNode;if(!e)throw Error(`This node has no associated AST element`);return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},vf=class extends _f{static{o(this,`LeafCstNodeImpl`)}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,n,r,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=r,this._length=t,this._range=n}},yf=class extends _f{static{o(this,`CompositeCstNodeImpl`)}constructor(){super(...arguments),this.content=new bf(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){let{range:n}=e,{range:r}=t;this._rangeCache={start:n.start,end:r.end.line<n.start.line?n.start:r.end}}return this._rangeCache}else return{start:L.create(0,0),end:L.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},bf=class e extends Array{static{o(this,`CstNodeContainer`)}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,e.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(let t of e)t.container=this.parent}},xf=class extends yf{static{o(this,`RootCstNodeImpl`)}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text=``,this._text=e??``}},Sf=Symbol(`Datatype`);function Cf(e){return e.$type===Sf}o(Cf,`isDataTypeNode`);var wf=``,Tf=o(e=>e.endsWith(wf)?e:e+wf,`withRuleSuffix`),Ef=class{static{o(this,`AbstractLangiumParser`)}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let t=this.lexer.definition,n=e.LanguageMetaData.mode===`production`;e.shared.profilers.LangiumProfiler?.isActive(`parsing`)?this.wrapper=new Nf(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask(`parsing`,e.LanguageMetaData.languageId)):this.wrapper=new Mf(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},Df=class extends Ef{static{o(this,`LangiumParser`)}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new gf,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){let n=this.computeRuleType(e),r;Jr(e)&&(r=e.name,this.registerPrecedenceMap(e));let i=this.wrapper.DEFINE_RULE(Tf(e.name),this.startImplementation(n,r,t).bind(this));return this.allRules.set(e.name,i),gi(e)&&e.entry&&(this.mainRule=i),i}registerPrecedenceMap(e){let t=e.name,n=new Map;for(let t=0;t<e.operators.precedences.length;t++){let r=e.operators.precedences[t];for(let e of r.operators)n.set(e.value,{precedence:t,rightAssoc:r.associativity===`right`})}this.operatorPrecedence.set(t,n)}computeRuleType(e){return Jr(e)?wo(e):e.fragment?void 0:yo(e)?Sf:wo(e)}parse(e,t={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let r=t.rule?this.allRules.get(t.rule):this.mainRule;if(!r)throw Error(t.rule?`No rule found with name '${t.rule}'`:`No main rule available.`);let i=this.doParse(r);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Gn(i,{deep:!0}),{value:i,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let t=this.wrapper.rule(e);if(this.stack.length>0&&(t=this.construct()),t===void 0)throw Error(`No result from parser`);if(this.stack.length>0)throw Error(`Parser stack is not empty after parsing`);return t}startImplementation(e,t,n){return r=>{let i=!this.isRecording()&&e!==void 0;if(i){let n={$type:e};this.stack.push(n),e===Sf?n.value=``:t!==void 0&&(n.$infixName=t)}return n(r),i?this.construct():void 0}}extractHiddenTokens(e){let t=this.lexerResult.hidden;if(!t.length)return[];let n=e.startOffset;for(let e=0;e<t.length;e++)if(t[e].startOffset>n)return t.splice(0,e);return t.splice(0,t.length)}consume(e,t,n){let r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){let e=this.extractHiddenTokens(r);this.nodeBuilder.addHiddenNodes(e);let t=this.nodeBuilder.buildLeafNode(r,n),{assignment:i,crossRef:a}=this.getAssignment(n),o=this.current;if(i){let e=ni(n)?r.image:this.converter.convert(r.image,t);this.assign(i.operator,i.feature,e,t,a)}else if(Cf(o)){let e=r.image;ni(n)||(e=this.converter.convert(e,t).toString()),o.value+=e}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset==`number`&&!isNaN(e.endOffset)}subrule(e,t,n,r,i){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(r));let o;try{o=this.wrapper.wrapSubrule(e,t,i)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,r,a))}}performSubruleAssignment(e,t,n){let{assignment:r,crossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){let t=this.current;if(Cf(t))t.value+=e.toString();else if(typeof e==`object`&&e){let n=this.assignWithoutOverride(e,t);this.stack.pop(),this.stack.push(n)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(t.feature&&t.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(n.$cstNode);let r={$type:e};this.stack.push(r),this.assign(t.operator,t.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),`$infixName`in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Cf(e)?this.converter.convert(e.value,e.$cstNode):(nr(this.astReflection,e),e)}constructInfix(e,t){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let r=e.operators;if(!Array.isArray(r)||n.length<2)return n[0];let i=0,a=-1;for(let e=0;e<r.length;e++){let n=r[e],o=t.get(n)??{precedence:1/0,rightAssoc:!1};o.precedence>a?(a=o.precedence,i=e):o.precedence===a&&(o.rightAssoc||(i=e))}let o=r.slice(0,i),s=r.slice(i+1),c=n.slice(0,i+1),l=n.slice(i+1),u={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:s},f=this.constructInfix(u,t),p=this.constructInfix(d,t);return{$type:e.$type,$cstNode:e.$cstNode,left:f,operator:r[i],right:p}}getAssignment(e){if(!this.assignmentMap.has(e)){let t=Kn(e,wr);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Pr(t.terminal)?t.terminal.isMulti?`multi`:`single`:void 0})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){let a=this.current,o;switch(o=i===`single`&&typeof n==`string`?this.linker.buildReference(a,t,r,n):i===`multi`&&typeof n==`string`?this.linker.buildMultiReference(a,t,r,n):n,e){case`=`:a[t]=o;break;case`?=`:a[t]=!0;break;case`+=`:Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];t===void 0?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},Of=class{static{o(this,`AbstractParserErrorMessageProvider`)}buildMismatchTokenMessage(e){return Yc.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Yc.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Yc.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Yc.buildEarlyExitMessage(e)}},kf=class extends Of{static{o(this,`LangiumParserErrorMessageProvider`)}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(`:KW`)?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},Af=class extends Ef{static{o(this,`LangiumCompletionParser`)}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){return this.resetState(),this.tokens=this.lexer.tokenize(e,{mode:`partial`}).tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){let n=this.wrapper.DEFINE_RULE(Tf(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{let n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,t,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},jf={recoveryEnabled:!0,nodeLocationTracking:`full`,skipValidations:!0,errorMessageProvider:new kf},Mf=class extends Qu{static{o(this,`ChevrotainWrapper`)}constructor(e,t){let n=t&&`maxLookahead`in t;super(e,{...jf,lookaheadStrategy:n?new du({maxLookahead:t.maxLookahead}):new Ud({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,n){return this.RULE(e,t,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},Nf=class extends Mf{static{o(this,`ProfilerWrapper`)}constructor(e,t,n){super(e,t),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,n){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,n)}finally{this.task.stopSubTask(this.ruleName(t))}}};function Pf(e,t,n){return Ff({parser:t,tokens:n,ruleNames:new Map},e),t}o(Pf,`createParser`);function Ff(e,t){let n=eo(t,!1),r=U(t.rules).filter(gi).filter(e=>n.has(e));for(let t of r){let n={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(t,Lf(n,t.definition))}let i=U(t.rules).filter(Jr).filter(e=>n.has(e));for(let t of i)e.parser.rule(t,If(e,t))}o(Ff,`buildRules`);function If(e,t){let n=t.call.rule.ref;if(!n)throw Error(`Could not resolve reference to infix operator rule: `+t.call.rule.$refText);if(Ii(n))throw Error(`Cannot use terminal rule in infix expression`);let r=t.operators.precedences.flatMap(e=>e.operators),i={$type:`Group`,elements:[]},a={$container:i,$type:`Assignment`,feature:`parts`,operator:`+=`,terminal:t.call},s={$container:i,$type:`Group`,elements:[],cardinality:`*`};i.elements.push(a,s);let c={$container:s,$type:`Assignment`,feature:`operators`,operator:`+=`,terminal:{$type:`Alternatives`,elements:r}},l={...a,$container:s};s.elements.push(c,l);let u=r.map(t=>e.tokens[t.value]).map((t,n)=>({ALT:o(()=>e.parser.consume(n,t,c),`ALT`)})),d;return t=>{d??=Yf(e,n),e.parser.subrule(0,d,!1,a,t),e.parser.many(0,{DEF:o(()=>{e.parser.alternatives(0,u),e.parser.subrule(1,d,!1,l,t)},`DEF`)})}}o(If,`buildInfixRule`);function Lf(e,t,n=!1){let r;if(ni(t))r=qf(e,t);else if(gr(t))r=Rf(e,t);else if(wr(t))r=Lf(e,t.terminal);else if(Pr(t))r=Kf(e,t);else if(wi(t))r=zf(e,t);else if(vr(t))r=Hf(e,t);else if(Ji(t))r=Uf(e,t);else if(Wr(t))r=Wf(e,t);else if(Rr(t)){let n=e.consume++;r=o(()=>e.parser.consume(n,Kc,t),`method`)}else throw new Ta(t.$cstNode,`Unexpected element type: ${t.$type}`);return Jf(e,n?void 0:Gf(t),r,t.cardinality)}o(Lf,`buildElement`);function Rf(e,t){let n=wo(t);return()=>e.parser.action(n,t)}o(Rf,`buildAction`);function zf(e,t){let n=t.rule.ref;if(ur(n)){let r=e.subrule++,i=gi(n)&&n.fragment,a=t.arguments.length>0?Bf(n,t.arguments):()=>({}),o;return s=>{o??=Yf(e,n),e.parser.subrule(r,o,i,t,a(s))}}else if(Ii(n)){let r=e.consume++,i=Zf(e,n.name);return()=>e.parser.consume(r,i,t)}else if(n)Ea(n);else throw new Ta(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}o(zf,`buildRuleCall`);function Bf(e,t){if(t.some(e=>e.calledByName)){let e=t.map(e=>({parameterName:e.parameter?.ref?.name,predicate:Vf(e.value)}));return t=>{let n={};for(let{parameterName:r,predicate:i}of e)r&&(n[r]=i(t));return n}}else{let n=t.map(e=>Vf(e.value));return t=>{let r={};for(let i=0;i<n.length;i++)if(i<e.parameters.length){let a=e.parameters[i].name,o=n[i];r[a]=o(t)}return r}}}o(Bf,`buildRuleCallPredicate`);function Vf(e){if(Ir(e)){let t=Vf(e.left),n=Vf(e.right);return e=>t(e)||n(e)}else if(Mr(e)){let t=Vf(e.left),n=Vf(e.right);return e=>t(e)&&n(e)}else if(ci(e)){let t=Vf(e.value);return e=>!t(e)}else if(mi(e)){let t=e.parameter.ref.name;return e=>e!==void 0&&e[t]===!0}else if(Er(e)){let t=!!e.true;return()=>t}Ea(e)}o(Vf,`buildPredicate`);function Hf(e,t){if(t.elements.length===1)return Lf(e,t.elements[0]);{let n=[];for(let r of t.elements){let t={ALT:Lf(e,r,!0)},i=Gf(r);i&&(t.GATE=Vf(i)),n.push(t)}let r=e.or++;return t=>e.parser.alternatives(r,n.map(e=>{let n={ALT:o(()=>e.ALT(t),`ALT`)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n}))}}o(Hf,`buildAlternatives`);function Uf(e,t){if(t.elements.length===1)return Lf(e,t.elements[0]);let n=[];for(let r of t.elements){let t={ALT:Lf(e,r,!0)},i=Gf(r);i&&(t.GATE=Vf(i)),n.push(t)}let r=e.or++,i=o((e,t)=>`uGroup_${e}_${t.getRuleStack().join(`-`)}`,`idFunc`),a=o(t=>e.parser.alternatives(r,n.map((n,a)=>{let s={ALT:o(()=>!0,`ALT`)},c=e.parser;s.ALT=()=>{if(n.ALT(t),!c.isRecording()){let e=i(r,c);c.unorderedGroups.get(e)||c.unorderedGroups.set(e,[]);let t=c.unorderedGroups.get(e);typeof t?.[a]>`u`&&(t[a]=!0)}};let l=n.GATE;return l?s.GATE=()=>l(t):s.GATE=()=>!c.unorderedGroups.get(i(r,c))?.[a],s})),`alternatives`),s=Jf(e,Gf(t),a,`*`);return t=>{s(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}o(Uf,`buildUnorderedGroup`);function Wf(e,t){let n=t.elements.map(t=>Lf(e,t));return e=>n.forEach(t=>t(e))}o(Wf,`buildGroup`);function Gf(e){if(Wr(e))return e.guardCondition}o(Gf,`getGuardCondition`);function Kf(e,t,n=t.terminal){if(n)if(wi(n)&&gi(n.rule.ref)){let r=n.rule.ref,i=e.subrule++,a;return n=>{a??=Yf(e,r),e.parser.subrule(i,a,!1,t,n)}}else if(wi(n)&&Ii(n.rule.ref)){let r=e.consume++,i=Zf(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}else if(ni(n)){let r=e.consume++,i=Zf(e,n.value);return()=>e.parser.consume(r,i,t)}else throw Error(`Could not build cross reference parser`);else{if(!t.type.ref)throw Error(`Could not resolve reference to type: `+t.type.$refText);let n=po(t.type.ref)?.terminal;if(!n)throw Error(`Could not find name assignment for type: `+wo(t.type.ref));return Kf(e,t,n)}}o(Kf,`buildCrossReference`);function qf(e,t){let n=e.consume++,r=e.tokens[t.value];if(!r)throw Error(`Could not find token for keyword: `+t.value);return()=>e.parser.consume(n,r,t)}o(qf,`buildKeyword`);function Jf(e,t,n,r){let i=t&&Vf(t);if(!r)if(i){let t=e.or++;return r=>e.parser.alternatives(t,[{ALT:o(()=>n(r),`ALT`),GATE:o(()=>i(r),`GATE`)},{ALT:Xu(),GATE:o(()=>!i(r),`GATE`)}])}else return n;if(r===`*`){let t=e.many++;return r=>e.parser.many(t,{DEF:o(()=>n(r),`DEF`),GATE:i?()=>i(r):void 0})}else if(r===`+`){let t=e.many++;if(i){let r=e.or++;return a=>e.parser.alternatives(r,[{ALT:o(()=>e.parser.atLeastOne(t,{DEF:o(()=>n(a),`DEF`)}),`ALT`),GATE:o(()=>i(a),`GATE`)},{ALT:Xu(),GATE:o(()=>!i(a),`GATE`)}])}else return r=>e.parser.atLeastOne(t,{DEF:o(()=>n(r),`DEF`)})}else if(r===`?`){let t=e.optional++;return r=>e.parser.optional(t,{DEF:o(()=>n(r),`DEF`),GATE:i?()=>i(r):void 0})}else Ea(r)}o(Jf,`wrap`);function Yf(e,t){let n=Xf(e,t),r=e.parser.getRule(n);if(!r)throw Error(`Rule "${n}" not found."`);return r}o(Yf,`getRule`);function Xf(e,t){if(ur(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!gi(r);)(Wr(r)||vr(r)||Ji(r))&&(i=r.elements.indexOf(n).toString()+`:`+i),n=r,r=r.$container;return i=r.name+`:`+i,e.ruleNames.set(t,i),i}}o(Xf,`getRuleName`);function Zf(e,t){let n=e.tokens[t];if(!n)throw Error(`Token "${t}" not found."`);return n}o(Zf,`getToken`);function Qf(e){let t=e.Grammar,n=e.parser.Lexer,r=new Af(e);return Pf(t,r,n.definition),r.finalize(),r}o(Qf,`createCompletionParser`);function $f(e){let t=ep(e);return t.finalize(),t}o($f,`createLangiumParser`);function ep(e){let t=e.Grammar,n=e.parser.Lexer;return Pf(t,new Df(e),n.definition)}o(ep,`prepareLangiumParser`);var tp=class{static{o(this,`DefaultTokenBuilder`)}constructor(){this.diagnostics=[]}buildTokens(e,t){let n=U(eo(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return i.push(...r),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Ii).filter(e=>!e.fragment).map(e=>this.buildTerminalToken(e)).toArray()}buildTerminalToken(e){let t=Oo(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n};return typeof n==`function`&&(r.LINE_BREAKS=!0),e.hidden&&(r.GROUP=Ja(t)?Mc.SKIPPED:`hidden`),r}requiresCustomPattern(e){return!!(e.flags.includes(`u`)||e.flags.includes(`s`))}regexPatternFunction(e){let t=new RegExp(e,e.flags+`y`);return(e,n)=>(t.lastIndex=n,t.exec(e))}buildKeywordTokens(e,t,n){return e.filter(ur).flatMap(e=>Qn(e).filter(ni)).distinct(e=>e.value).toArray().sort((e,t)=>t.value.length-e.value.length).map(e=>this.buildKeywordToken(e,t,!!n?.caseInsensitive))}buildKeywordToken(e,t,n){let r=this.buildKeywordPattern(e,n),i={name:e.value,PATTERN:r,LONGER_ALT:this.findLongerAlt(e,t)};return typeof r==`function`&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,t){return t?new RegExp(Ya(e.value),`i`):e.value}findLongerAlt(e,t){return t.reduce((t,n)=>{let r=n?.PATTERN;return r?.source&&Xa(`^`+r.source+`$`,e.value)&&t.push(n),t},[])}},np=class{static{o(this,`DefaultValueConverter`)}convert(e,t){let n=t.grammarSource;if(Pr(n)&&(n=ro(n)),wi(n)){let r=n.rule.ref;if(!r)throw Error(`This cst node was not parsed by a rule.`);return this.runConverter(r,e,t)}return e}runConverter(e,t,n){switch(e.name.toUpperCase()){case`INT`:return rp.convertInt(t);case`STRING`:return rp.convertString(t);case`ID`:return rp.convertID(t)}switch(Do(e)?.toLowerCase()){case`number`:return rp.convertNumber(t);case`boolean`:return rp.convertBoolean(t);case`bigint`:return rp.convertBigint(t);case`date`:return rp.convertDate(t);default:return t}}},rp;(function(e){function t(e){let t=``;for(let r=1;r<e.length-1;r++){let i=e.charAt(r);if(i===`\\`){let i=e.charAt(++r);t+=n(i)}else t+=i}return t}o(t,`convertString`),e.convertString=t;function n(e){switch(e){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
||
`;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;case`0`:return`\0`;default:return e}}o(n,`convertEscapeCharacter`);function r(e){return e.charAt(0)===`^`?e.substring(1):e}o(r,`convertID`),e.convertID=r;function i(e){return parseInt(e)}o(i,`convertInt`),e.convertInt=i;function a(e){return BigInt(e)}o(a,`convertBigint`),e.convertBigint=a;function s(e){return new Date(e)}o(s,`convertDate`),e.convertDate=s;function c(e){return Number(e)}o(c,`convertNumber`),e.convertNumber=c;function l(e){return e.toLowerCase()===`true`}o(l,`convertBoolean`),e.convertBoolean=l})(rp||={});var Z={};e(Z,r(Bt(),1));function ip(){return new Promise(e=>{typeof setImmediate>`u`?setTimeout(e,0):setImmediate(e)})}o(ip,`delayNextTick`);var ap=0,op=10;function sp(){return ap=performance.now(),new Z.CancellationTokenSource}o(sp,`startCancelableOperation`);function cp(e){op=e}o(cp,`setInterruptionPeriod`);var lp=Symbol(`OperationCancelled`);function up(e){return e===lp}o(up,`isOperationCancelled`);async function dp(e){if(e===Z.CancellationToken.None)return;let t=performance.now();if(t-ap>=op&&(ap=t,await ip(),ap=performance.now()),e.isCancellationRequested)throw lp}o(dp,`interruptAndCheck`);var fp=class{static{o(this,`Deferred`)}constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)})}},pp=class e{static{o(this,`FullTextDocument`)}constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(t,n){for(let n of t)if(e.isIncremental(n)){let e=vp(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);let i=Math.max(e.start.line,0),a=Math.max(e.end.line,0),o=this._lineOffsets,s=gp(n.text,!1,t);if(a-i===s.length)for(let e=0,t=s.length;e<t;e++)o[e+i+1]=s[e];else s.length<1e4?o.splice(i+1,a-i,...s):this._lineOffsets=o=o.slice(0,i+1).concat(s,o.slice(a+1));let c=n.text.length-(r-t);if(c!==0)for(let e=i+1+s.length,t=o.length;e<t;e++)o[e]=o[e]+c}else if(e.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw Error(`Unknown change event received`);this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gp(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return{line:0,character:e};for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return e=this.ensureBeforeEOL(e,t[i]),{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line];if(e.character<=0)return n;let r=e.line+1<t.length?t[e.line+1]:this._content.length,i=Math.min(n+e.character,r);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,t){for(;e>t&&_p(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}static isFull(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}},mp;(function(e){function t(e,t,n,r){return new pp(e,t,n,r)}o(t,`create`),e.create=t;function n(e,t,n){if(e instanceof pp)return e.update(t,n),e;throw Error(`TextDocument.update: document must be created by TextDocument.create`)}o(n,`update`),e.update=n;function r(e,t){let n=e.getText(),r=hp(t.map(yp),(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),i=0,a=[];for(let t of r){let r=e.offsetAt(t.range.start);if(r<i)throw Error(`Overlapping edit`);r>i&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join(``)}o(r,`applyEdits`),e.applyEdits=r})(mp||={});function hp(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);hp(r,t),hp(i,t);let a=0,o=0,s=0;for(;a<r.length&&o<i.length;)t(r[a],i[o])<=0?e[s++]=r[a++]:e[s++]=i[o++];for(;a<r.length;)e[s++]=r[a++];for(;o<i.length;)e[s++]=i[o++];return e}o(hp,`mergeSort`);function gp(e,t,n=0){let r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);_p(i)&&(i===13&&t+1<e.length&&e.charCodeAt(t+1)===10&&t++,r.push(n+t+1))}return r}o(gp,`computeLineOffsets`);function _p(e){return e===13||e===10}o(_p,`isEOL`);function vp(e){let t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}o(vp,`getWellformedRange`);function yp(e){let t=vp(e.range);return t===e.range?e:{newText:e.newText,range:t}}o(yp,`getWellformedEdit`);var bp;(()=>{var e={975:e=>{function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}o(t,`e`);function n(e,t){for(var n,r=``,i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===47)break;n=47}if(n===47){if(!(a===s-1||o===1))if(a!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var c=r.lastIndexOf(`/`);if(c!==r.length-1){c===-1?(r=``,i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf(`/`),a=s,o=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,a=s,o=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else n===46&&o!==-1?++o:o=-1}return r}o(n,`r`);var r={resolve:o(function(){for(var e,r=``,i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(e===void 0&&(e=process.cwd()),o=e),t(o),o.length!==0&&(r=o+`/`+r,i=o.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},`resolve`),normalize:o(function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},`normalize`),isAbsolute:o(function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},`isAbsolute`),join:o(function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},`join`),relative:o(function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,o=a-i,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var c=n.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(n.charCodeAt(s+d)===47)return n.slice(s+d+1);if(d===0)return n.slice(s+d)}else o>l&&(e.charCodeAt(i+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=i+u+1;d<=a;++d)d!==a&&e.charCodeAt(d)!==47||(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+n.slice(s+u):(s+=u,n.charCodeAt(s)===47&&++s,n.slice(s))},`relative`),_makeLong:o(function(e){return e},`_makeLong`),dirname:o(function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if((n=e.charCodeAt(o))===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},`dirname`),basename:o(function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,a=-1,o=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var s=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(l===47){if(!o){i=r+1;break}}else c===-1&&(o=!1,c=r+1),s>=0&&(l===n.charCodeAt(s)?--s==-1&&(a=r):(s=-1,a=c))}return i===a?a=c:a===-1&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!o){i=r+1;break}}else a===-1&&(o=!1,a=r+1);return a===-1?``:e.slice(i,a)},`basename`),extname:o(function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c!==47)i===-1&&(a=!1,i=s+1),c===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1);else if(!a){r=s+1;break}}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},`extname`),format:o(function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return(function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r})(0,e)},`format`),parse:o(function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),a=i===47;a?(n.root=`/`,r=1):r=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if((i=e.charCodeAt(u))!==47)c===-1&&(l=!1,c=u+1),i===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1);else if(!l){s=u+1;break}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(n.base=n.name=s===0&&a?e.slice(1,c):e.slice(s,c)):(s===0&&a?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(s,o),n.base=e.slice(s,c)),n.ext=e.slice(o,c)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir=`/`),n},`parse`),sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}o(n,`r`),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:o(()=>d,`URI`),Utils:o(()=>S,`Utils`)}),typeof process==`object`?i=process.platform===`win32`:typeof navigator==`object`&&(i=navigator.userAgent.indexOf(`Windows`)>=0);let a=/^\w[\w\d+.-]*$/,s=/^\//,c=/^\/\//;function l(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!a.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!s.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(c.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}o(l,`a`);let u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{static{o(this,`l`)}static isUri(e){return e instanceof d||!!e&&typeof e.authority==`string`&&typeof e.fragment==`string`&&typeof e.path==`string`&&typeof e.query==`string`&&typeof e.scheme==`string`&&typeof e.fsPath==`string`&&typeof e.with==`function`&&typeof e.toString==`function`}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=(function(e,t){return e||t?e:`file`})(e,a),this.authority=t||``,this.path=(function(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==`/`&&(t=`/`+t):t=`/`}return t})(this.scheme,n||``),this.query=r||``,this.fragment=i||``,l(this,a))}get fsPath(){return _(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new p(t,n,r,i,a)}static parse(e,t=!1){let n=u.exec(e);return n?new p(n[2]||``,b(n[4]||``),b(n[5]||``),b(n[7]||``),b(n[9]||``),t):new p(``,``,``,``,``)}static file(e){let t=``;if(i&&(e=e.replace(/\\/g,`/`)),e[0]===`/`&&e[1]===`/`){let n=e.indexOf(`/`,2);n===-1?(t=e.substring(2),e=`/`):(t=e.substring(2,n),e=e.substring(n)||`/`)}return new p(`file`,t,e,``,``)}static from(e){let t=new p(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t}toString(e=!1){return ee(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof d)return e;{let t=new p(e);return t._formatted=e.external,t._fsPath=e._sep===f?e.fsPath:null,t}}return e}}let f=i?1:void 0;class p extends d{static{o(this,`d`)}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||=_(this,!1),this._fsPath}toString(e=!1){return e?ee(this,!0):(this._formatted||=ee(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let m={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function h(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=m[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}o(h,`m`);function g(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=m[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}o(g,`y`);function _(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===47&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&e.path.charCodeAt(2)===58?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,i&&(n=n.replace(/\//g,`\\`)),n}o(_,`v`);function ee(e,t){let n=t?g:h,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:h(c,!1,!1)),r}o(ee,`b`);function v(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}o(v,`C`);let y=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function b(e){return e.match(y)?e.replace(y,(e=>v(e))):e}o(b,`w`);var te=n(975);let x=te.posix||te;var S;(function(e){e.joinPath=function(e,...t){return e.with({path:x.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==`/`&&(n=`/`+n,r=!0);let i=x.resolve(n,...t);return r&&i[0]===`/`&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(e.path.length===0||e.path===`/`)return e;let t=x.dirname(e.path);return t.length===1&&t.charCodeAt(0)===46&&(t=``),e.with({path:t})},e.basename=function(e){return x.basename(e.path)},e.extname=function(e){return x.extname(e.path)}})(S||={}),bp=r})();var{URI:xp,Utils:Sp}=bp,Cp;(function(e){e.basename=Sp.basename,e.dirname=Sp.dirname,e.extname=Sp.extname,e.joinPath=Sp.joinPath,e.resolvePath=Sp.resolvePath;let t=typeof process==`object`&&process?.platform===`win32`;function n(e,t){return e?.toString()===t?.toString()}o(n,`equals`),e.equals=n;function r(e,n){let r=typeof e==`string`?xp.parse(e).path:e.path,i=typeof n==`string`?xp.parse(n).path:n.path,a=r.split(`/`).filter(e=>e.length>0),o=i.split(`/`).filter(e=>e.length>0);if(t){let e=/^[A-Z]:$/;if(a[0]&&e.test(a[0])&&(a[0]=a[0].toLowerCase()),o[0]&&e.test(o[0])&&(o[0]=o[0].toLowerCase()),a[0]!==o[0])return i.substring(1)}let s=0;for(;s<a.length&&a[s]===o[s];s++);return`../`.repeat(a.length-s)+o.slice(s).join(`/`)}o(r,`relative`),e.relative=r;function i(e){return xp.parse(e.toString()).toString()}o(i,`normalize`),e.normalize=i;function a(e,t){let n=typeof e==`string`?e:e.path,r=typeof t==`string`?t:t.path;return r.charAt(r.length-1)===`/`&&(r=r.slice(0,-1)),n.charAt(n.length-1)===`/`&&(n=n.slice(0,-1)),r===n?!0:r.length<n.length||r.charAt(n.length)!==`/`?!1:r.startsWith(n)}o(a,`contains`),e.contains=a})(Cp||={});var wp=class{static{o(this,`UriTrie`)}constructor(){this.root={name:``,children:new Map}}normalizeUri(e){return Cp.normalize(e)}clear(){this.root.children.clear()}insert(e,t){let n=this.getNode(this.normalizeUri(e),!0);n.element=t}delete(e){let t=this.getNode(this.normalizeUri(e),!1);t?.parent&&t.parent.children.delete(t.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){let t=this.normalizeUri(e),n=this.getNode(t,!1);if(n)return{name:n.name,uri:Cp.joinPath(xp.parse(t),n.name).toString(),element:n.element}}findChildren(e){let t=this.normalizeUri(e),n=this.getNode(t,!1);return n?Array.from(n.children.values()).map(e=>({name:e.name,uri:Cp.joinPath(xp.parse(t),e.name).toString(),element:e.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let t=this.getNode(Cp.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){let n=e.split(`/`);e.charAt(e.length-1)===`/`&&n.pop();let r=this.root;for(let e of n){let n=r.children.get(e);if(!n)if(t)n={name:e,children:new Map,parent:r},r.children.set(e,n);else return;r=n}return r}collectValues(e){let t=[];e.element&&t.push(e.element);for(let n of e.children.values())t.push(...this.collectValues(n));return t}},Q;(function(e){e[e.Changed=0]=`Changed`,e[e.Parsed=1]=`Parsed`,e[e.IndexedContent=2]=`IndexedContent`,e[e.ComputedScopes=3]=`ComputedScopes`,e[e.Linked=4]=`Linked`,e[e.IndexedReferences=5]=`IndexedReferences`,e[e.Validated=6]=`Validated`})(Q||={});var Tp=class{static{o(this,`DefaultLangiumDocumentFactory`)}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=Z.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,t)}fromTextDocument(e,t,n){return t??=xp.parse(e.uri),Z.CancellationToken.is(n)?this.createAsync(t,e,n):this.create(t,e,n)}fromString(e,t,n){return Z.CancellationToken.is(n)?this.createAsync(t,e,n):this.create(t,e,n)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,n){if(typeof t==`string`){let r=this.parse(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}else if(`$model`in t){let n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let r=this.parse(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}async createAsync(e,t,n){if(typeof t==`string`){let r=await this.parseAsync(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}else{let r=await this.parseAsync(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}createLangiumDocument(e,t,n,r){let i;if(n)i={parseResult:e,uri:t,state:Q.Parsed,references:[],textDocument:n};else{let n=this.createTextDocumentGetter(t,r);i={parseResult:e,uri:t,state:Q.Parsed,references:[],get textDocument(){return n()}}}return e.value.$document=i,i}async update(e,t){let n=e.parseResult.value.$cstNode?.root.fullText,r=this.textDocuments?.get(e.uri.toString()),i=r?r.getText():await this.fileSystemProvider.readFile(e.uri);if(r)Object.defineProperty(e,`textDocument`,{value:r});else{let t=this.createTextDocumentGetter(e.uri,i);Object.defineProperty(e,`textDocument`,{get:t})}return n!==i&&(e.parseResult=await this.parseAsync(e.uri,i,t),e.parseResult.value.$document=e),e.state=Q.Parsed,e}parse(e,t,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,n)}parseAsync(e,t,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,n)}createTextDocumentGetter(e,t){let n=this.serviceRegistry,r;return()=>r??=mp.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,t??``)}},Ep=class{static{o(this,`DefaultLangiumDocuments`)}constructor(e){this.documentTrie=new wp,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return U(this.documentTrie.all())}addDocument(e){let t=e.uri.toString();if(this.documentTrie.has(t))throw Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){let t=e.toString();return this.documentTrie.find(t)}getDocuments(e){let t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then(e=>(this.addDocument(e),e));{let n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let t=e.toString(),n=this.documentTrie.find(t);return n&&this.documentBuilder().resetToState(n,Q.Changed),n}deleteDocument(e){let t=e.toString(),n=this.documentTrie.find(t);return n&&(n.state=Q.Changed,this.documentTrie.delete(t)),n}deleteDocuments(e){let t=e.toString(),n=this.documentTrie.findAll(t);for(let e of n)e.state=Q.Changed;return this.documentTrie.delete(t),n}},Dp=Symbol(`RefResolving`),Op=class{static{o(this,`DefaultLinker`)}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=Z.CancellationToken.None){if(this.profiler?.isActive(`linking`)){let n=this.profiler.createTask(`linking`,this.languageId);n.start();try{for(let r of $n(e.parseResult.value))await dp(t),tr(r).forEach(t=>{let i=`${r.$type}:${t.property}`;n.startSubTask(i);try{this.doLink(t,e)}finally{n.stopSubTask(i)}})}finally{n.stop()}}else for(let n of $n(e.parseResult.value))await dp(t),tr(n).forEach(t=>this.doLink(t,e))}doLink(e,t){let n=e.reference;if(`_ref`in n&&n._ref===void 0){n._ref=Dp;try{let t=this.getCandidate(e);Mn(t)?n._ref=t:(n._nodeDescription=t,n._ref=this.loadAstNode(t)??this.createLinkingError(e,t))}catch(t){console.error(`An error occurred while resolving reference to '${n.$refText}':`,t);let r=t.message??String(t);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${r}`}}t.references.push(n)}else if(`_items`in n&&n._items===void 0){n._items=Dp;try{let t=this.getCandidates(e),r=[];if(Mn(t))n._linkingError=t;else for(let e of t){let t=this.loadAstNode(e);t&&r.push({ref:t,$nodeDescription:e})}n._items=r}catch(t){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${t}`},n._items=[]}t.references.push(n)}}unlink(e){for(let t of e.references)`_ref`in t?(t._ref=void 0,delete t._nodeDescription):`_items`in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let t=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(e=>`${e.documentUri}#${e.path}`).toArray();return t.length>0?t:this.createLinkingError(e)}buildReference(e,t,n,r){let i=this,a={$refNode:n,$refText:r,_ref:void 0,get ref(){if(H(this._ref))return this._ref;if(jn(this._nodeDescription))this._ref=i.loadAstNode(this._nodeDescription)??i.createLinkingError({reference:a,container:e,property:t},this._nodeDescription);else if(this._ref===void 0){this._ref=Dp;let n=Yn(e).$document,r=i.getLinkedNode({reference:a,container:e,property:t});if(r.error&&n&&n.state<Q.ComputedScopes)return this._ref=void 0;this._ref=r.node??r.error,this._nodeDescription=r.descr,n?.references.push(this)}else this._ref===Dp&&i.throwCyclicReferenceError(e,t,r);return H(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Mn(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,t,n,r){let i=this,a={$refNode:n,$refText:r,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=Dp;let n=Yn(e).$document,r=i.getCandidates({reference:a,container:e,property:t}),o=[];if(Mn(r))this._linkingError=r;else for(let e of r){let t=i.loadAstNode(e);t&&o.push({ref:t,$nodeDescription:e})}this._items=o,n?.references.push(this)}else this._items===Dp&&i.throwCyclicReferenceError(e,t,r);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=i.createLinkingError({reference:a,container:e,property:t})}};return a}throwCyclicReferenceError(e,t,n){throw Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${n}')`)}getLinkedNode(e){try{let t=this.getCandidate(e);if(Mn(t))return{error:t};let n=this.loadAstNode(t);return n?{node:n,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);let n=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;let t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){let n=Yn(e.container).$document;return n&&n.state<Q.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`),{info:e,message:`Could not resolve reference to ${this.reflection.getReferenceType(e)} named '${e.reference.$refText}'.`,targetDescription:t}}};function kp(e){return typeof e.name==`string`}o(kp,`isNamed`);var Ap=class{static{o(this,`DefaultNameProvider`)}getName(e){if(kp(e))return e.name}getNameNode(e){return oo(e.$cstNode,`name`)}},jp=class{static{o(this,`DefaultReferences`)}constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=$n(e.Grammar).some(e=>Pr(e)&&e.isMulti)}findDeclarations(e){if(e){let t=fo(e),n=e.astNode;if(t&&n){let r=n[t.feature];if(kn(r)||An(r))return Xn(r);if(Array.isArray(r)){for(let t of r)if((kn(t)||An(t))&&t.$refNode&&t.$refNode.offset<=e.offset&&t.$refNode.end>=e.end)return Xn(t)}}if(n){let t=this.nameProvider.getNameNode(n);if(t&&(t===e||aa(e,t)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(t.head());if(n){for(let t of tr(n))if(An(t.reference)&&t.reference.items.some(t=>t.ref===e))return t.reference.items.map(e=>e.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let t=this.findDeclarations(e),n=[];for(let e of t){let t=this.nameProvider.getNameNode(e)??e.$cstNode;t&&n.push(t)}return n}findReferences(e,t){let n=[];t.includeDeclaration&&n.push(...this.getSelfReferences(e));let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter(e=>Cp.equals(e.sourceUri,t.documentUri))),n.push(...r),U(n)}getSelfReferences(e){let t=this.getSelfNodes(e),n=[];for(let e of t){let t=this.nameProvider.getNameNode(e);if(t){let r=Jn(e),i=this.nodeLocator.getAstNodePath(e);n.push({sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:sa(t),local:!0})}}return n}},Mp=class{static{o(this,`MultiMap`)}constructor(e){if(this.map=new Map,e)for(let[t,n]of e)this.add(t,n)}get size(){return Un.sum(U(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let r=n.indexOf(t);if(r>=0)return n.length===1?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let t=this.map.get(e);return t?U(t):Bn}has(e,t){if(t===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,n)=>t.forEach(t=>e(t,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return U(this.map.entries()).flatMap(([e,t])=>t.map(t=>[e,t]))}keys(){return U(this.map.keys())}values(){return U(this.map.values()).flat()}entriesGroupedByKey(){return U(this.map.entries())}},Np=class{static{o(this,`BiMap`)}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let t=this.map.get(e);return t===void 0?!1:(this.map.delete(e),this.inverse.delete(t),!0)}},Pp=class{static{o(this,`DefaultScopeComputation`)}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=Z.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,n=Zn,r=Z.CancellationToken.None){let i=[];this.addExportedSymbol(e,i,t);for(let a of n(e))await dp(r),this.addExportedSymbol(a,i,t);return i}addExportedSymbol(e,t,n){let r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async collectLocalSymbols(e,t=Z.CancellationToken.None){let n=e.parseResult.value,r=new Mp;for(let i of Qn(n))await dp(t),this.addLocalSymbol(i,e,r);return r}addLocalSymbol(e,t,n){let r=e.$container;if(r){let i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}},Fp=class{static{o(this,`StreamScope`)}constructor(e,t,n){this.elements=e,this.outerScope=t,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(e=>e.name.toLowerCase()===t):this.elements.find(t=>t.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(e=>e.name.toLowerCase()===t):this.elements.filter(t=>t.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},Ip=class{static{o(this,`MapScope`)}constructor(e,t,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let t of e){let e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.set(e,t)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t),r=n?[n]:[];return(this.concatOuterScope||r.length>0)&&this.outerScope?U(r).concat(this.outerScope.getElements(e)):U(r)}getAllElements(){let e=U(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},Lp=class{static{o(this,`MultiMapScope`)}constructor(e,t,n){this.elements=new Mp,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let t of e){let e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.add(e,t)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return(this.concatOuterScope||n.length===0)&&this.outerScope?U(n).concat(this.outerScope.getElements(e)):U(n)}getAllElements(){let e=U(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},Rp={getElement(){},getElements(){return Bn},getAllElements(){return Bn}},zp=class{static{o(this,`DisposableCache`)}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw Error(`This cache has already been disposed`)}},Bp=class extends zp{static{o(this,`SimpleCache`)}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){let n=t();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Vp=class extends zp{static{o(this,`ContextCache`)}constructor(e){super(),this.cache=new Map,this.converter=e??(e=>e)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();let r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){let e=n();return r.set(t,e),e}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){let t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){let t=this.converter(e),n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}},Hp=class extends Vp{static{o(this,`DocumentCache`)}constructor(e,t){super(e=>e.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,e=>{this.clear(e.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{for(let e of t)this.clear(e)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{let n=e.concat(t);for(let e of n)this.clear(e)}))}},Up=class extends Bp{static{o(this,`WorkspaceCache`)}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{t.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},Wp=class{static{o(this,`DefaultScopeProvider`)}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Up(e.shared)}getScope(e){let t=[],n=this.reflection.getReferenceType(e),r=Jn(e.container).localSymbols;if(r){let i=e.container;do r.has(i)&&t.push(r.getStream(i).filter(e=>this.reflection.isSubtype(e.type,n))),i=i.$container;while(i)}let i=this.getGlobalScope(n,e);for(let e=t.length-1;e>=0;e--)i=this.createScope(t[e],i);return i}createScope(e,t,n){return new Fp(U(e),t,n)}createScopeForNodes(e,t,n){return new Fp(U(e).map(e=>{let t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)}).nonNullable(),t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new Lp(this.indexManager.allElements(e)))}};function Gp(e){return typeof e.$comment==`string`}o(Gp,`isAstNodeWithComment`);function Kp(e){return typeof e==`object`&&!!e&&(`$ref`in e||`$error`in e)}o(Kp,`isIntermediateReference`);var qp=class{static{o(this,`DefaultJsonSerializer`)}constructor(e){this.ignoreProperties=new Set([`$container`,`$containerProperty`,`$containerIndex`,`$document`,`$cstNode`]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){let n=t??{},r=t?.replacer,i=o((e,t)=>this.replacer(e,t,n),`defaultReplacer`),a=r?(e,t)=>r(e,t,i):i;try{return this.currentDocument=Jn(e),JSON.stringify(e,a,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){let n=t??{},r=JSON.parse(e);return this.linkNode(r,r,n),r}replacer(e,t,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e))if(kn(t)){let e=t.ref,r=n?t.$refText:void 0;if(e){let t=Jn(e),n=``;this.currentDocument&&this.currentDocument!==t&&(n=o?o(t.uri,e):t.uri.toString());let i=this.astNodeLocator.getAstNodePath(e);return{$ref:`${n}#${i}`,$refText:r}}else return{$error:t.error?.message??`Could not resolve reference`,$refText:r}}else if(An(t)){let e=n?t.$refText:void 0,r=[];for(let e of t.items){let t=e.ref,n=Jn(e.ref),i=``;this.currentDocument&&this.currentDocument!==n&&(i=o?o(n.uri,t):n.uri.toString());let a=this.astNodeLocator.getAstNodePath(t);r.push(`${i}#${a}`)}return{$refs:r,$refText:e}}else if(H(t)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&n?.$textRegion&&(n.$textRegion.documentURI=this.currentDocument?.uri.toString())),r&&!e&&(n??={...t},n.$sourceText=t.$cstNode?.text),a){n??={...t};let e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,``))}return n??t}else return t}addAstNodeRegionWithAssignmentsTo(e){let t=o(e=>({offset:e.offset,end:e.end,length:e.length,range:e.range}),`createDocumentSegment`);if(e.$cstNode){let n=e.$textRegion=t(e.$cstNode),r=n.assignments={};return Object.keys(e).filter(e=>!e.startsWith(`$`)).forEach(n=>{let i=ao(e.$cstNode,n).map(t);i.length!==0&&(r[n]=i)}),e}}linkNode(e,t,n,r,i,a){for(let[r,i]of Object.entries(e))if(Array.isArray(i))for(let a=0;a<i.length;a++){let o=i[a];Kp(o)?i[a]=this.reviveReference(e,r,t,o,n):H(o)&&this.linkNode(o,t,n,e,r,a)}else Kp(i)?e[r]=this.reviveReference(e,r,t,i,n):H(i)&&this.linkNode(i,t,n,e,r);let o=e;o.$container=r,o.$containerProperty=i,o.$containerIndex=a}reviveReference(e,t,n,r,i){let a=r.$refText,o=r.$error,s;if(r.$ref){let e=this.getRefNode(n,r.$ref,i.uriConverter);if(H(e))return a||=this.nameProvider.getName(e),{$refText:a??``,ref:e};o=e}else if(r.$refs){let e=[];for(let t of r.$refs){let r=this.getRefNode(n,t,i.uriConverter);H(r)&&e.push({ref:r})}if(e.length===0)s={$refText:a??``,items:e},o??=`Could not resolve multi-reference`;else return{$refText:a??``,items:e}}if(o)return s??={$refText:a??``,ref:void 0},s.error={info:{container:e,property:t,reference:s},message:o},s}getRefNode(e,t,n){try{let r=t.indexOf(`#`);if(r===0)return this.astNodeLocator.getAstNode(e,t.substring(1))||`Could not resolve path: `+t;if(r<0){let e=n?n(t):xp.parse(t),r=this.langiumDocuments.getDocument(e);return r?r.parseResult.value:`Could not find document for URI: `+t}let i=n?n(t.substring(0,r)):xp.parse(t.substring(0,r)),a=this.langiumDocuments.getDocument(i);return a?r===t.length-1?a.parseResult.value:this.astNodeLocator.getAstNode(a.parseResult.value,t.substring(r+1))||`Could not resolve URI: `+t:`Could not find document for URI: `+t}catch(e){return String(e)}}},Jp=class{static{o(this,`DefaultServiceRegistry`)}get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){let t=e.LanguageMetaData;for(let n of t.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileExtensionMap.set(n,e);if(t.fileNames)for(let n of t.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(t.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw Error("The service registry is empty. Use `register` to register the services of a language.");let t=this.textDocuments?.get(e)?.languageId;if(t!==void 0){let e=this.languageIdMap.get(t);if(e)return e}let n=Cp.extname(e),r=Cp.basename(e),i=this.fileNameMap.get(r)??this.fileExtensionMap.get(n);if(!i)throw Error(t?`The service registry contains no services for the extension '${n}' for language '${t}'.`:`The service registry contains no services for the extension '${n}'.`);return i}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Yp(e){return{code:e}}o(Yp,`diagnosticData`);var Xp;(function(e){e.defaults=[`fast`,`slow`,`built-in`],e.all=e.defaults})(Xp||={});var Zp=class{static{o(this,`ValidationRegistry`)}constructor(e){this.entries=new Mp,this.knownCategories=new Set(Xp.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,t=this,n=`fast`){if(n===`built-in`)throw Error(`The 'built-in' category is reserved for lexer, parser, and linker errors.`);this.knownCategories.add(n);for(let[r,i]of Object.entries(e)){let e=i;if(Array.isArray(e))for(let i of e){let e={check:this.wrapValidationException(i,t),category:n};this.addEntry(r,e)}else if(typeof e==`function`){let i={check:this.wrapValidationException(e,t),category:n};this.addEntry(r,i)}else Ea(e)}}wrapValidationException(e,t){return async(n,r,i)=>{await this.handleException(()=>e.call(t,n,r,i),`An error occurred during validation`,r,n)}}async handleException(e,t,n,r){try{await e()}catch(e){if(up(e))throw e;console.error(`${t}:`,e),e instanceof Error&&e.stack&&console.error(e.stack),n(`error`,`${t}: ${e instanceof Error?e.message:String(e)}`,{node:r})}}addEntry(e,t){if(e===`AstNode`){this.entries.add(`AstNode`,t);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,t)}getChecks(e,t){let n=U(this.entries.get(e)).concat(this.entries.get(`AstNode`));return t&&(n=n.filter(e=>t.includes(e.category))),n.map(e=>e.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,`An error occurred during set-up of the validation`,t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,`An error occurred during tear-down of the validation`,t))}wrapPreparationException(e,t,n){return async(r,i,a,o)=>{await this.handleException(()=>e.call(n,r,i,a,o),t,i,r)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},Qp=Object.freeze({validateNode:!0,validateChildren:!0}),$p=class{static{o(this,`DefaultDocumentValidator`)}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},n=Z.CancellationToken.None){let r=e.parseResult,i=[];if(await dp(n),(!t.categories||t.categories.includes(`built-in`))&&(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some(e=>e.data?.code===rm.LexingError)||(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some(e=>e.data?.code===rm.ParsingError))||(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some(e=>e.data?.code===rm.LinkingError))))return i;try{i.push(...await this.validateAst(r.value,t,n))}catch(e){if(up(e))throw e;console.error(`An error occurred during validation:`,e)}return await dp(n),i}processLexingErrors(e,t,n){let r=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let e of r){let n=e.severity??`error`,r={severity:tm(n),range:{start:{line:e.line-1,character:e.column-1},end:{line:e.line-1,character:e.column+e.length-1}},message:e.message,data:nm(n),source:this.getSource()};t.push(r)}}processParsingErrors(e,t,n){for(let n of e.parserErrors){let e;if(isNaN(n.token.startOffset)){if(`previousToken`in n){let t=n.previousToken;if(isNaN(t.startOffset)){let t={line:0,character:0};e={start:t,end:t}}else{let n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=oa(n.token);if(e){let r={severity:tm(`error`),range:e,message:n.message,data:Yp(rm.ParsingError),source:this.getSource()};t.push(r)}}}processLinkingErrors(e,t,n){for(let n of e.references){let e=n.error;if(e){let r={node:e.info.container,range:n.$refNode?.range,property:e.info.property,index:e.info.index,data:{code:rm.LinkingError,containerType:e.info.container.$type,property:e.info.property,refText:e.info.reference.$refText}};t.push(this.toDiagnostic(`error`,e.message,r))}}}async validateAst(e,t,n=Z.CancellationToken.None){let r=[],i=o((e,t,n)=>{r.push(this.toDiagnostic(e,t,n))},`acceptor`);return await this.validateAstBefore(e,t,i,n),await this.validateAstNodes(e,t,i,n),await this.validateAstAfter(e,t,i,n),r}async validateAstBefore(e,t,n,r=Z.CancellationToken.None){let i=this.validationRegistry.checksBefore;for(let a of i)await dp(r),await a(e,n,t.categories??[],r)}async validateAstNodes(e,t,n,r=Z.CancellationToken.None){if(this.profiler?.isActive(`validating`)){let i=this.profiler.createTask(`validating`,this.languageId);i.start();try{let a=$n(e).iterator();for(let e of a){i.startSubTask(e.$type);let o=this.validateSingleNodeOptions(e,t);if(o.validateNode)try{let i=this.validationRegistry.getChecks(e.$type,t.categories);for(let t of i)await t(e,n,r)}finally{i.stopSubTask(e.$type)}o.validateChildren||a.prune()}}finally{i.stop()}}else{let i=$n(e).iterator();for(let e of i){await dp(r);let a=this.validateSingleNodeOptions(e,t);if(a.validateNode){let i=this.validationRegistry.getChecks(e.$type,t.categories);for(let t of i)await t(e,n,r)}a.validateChildren||i.prune()}}}validateSingleNodeOptions(e,t){return Qp}async validateAstAfter(e,t,n,r=Z.CancellationToken.None){let i=this.validationRegistry.checksAfter;for(let a of i)await dp(r),await a(e,n,t.categories??[],r)}toDiagnostic(e,t,n){return{message:t,range:em(n),severity:tm(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function em(e){if(e.range)return e.range;let t;return typeof e.property==`string`?t=oo(e.node.$cstNode,e.property,e.index):typeof e.keyword==`string`&&(t=lo(e.node.$cstNode,e.keyword,e.index)),t??=e.node.$cstNode,t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}o(em,`getDiagnosticRange`);function tm(e){switch(e){case`error`:return 1;case`warning`:return 2;case`info`:return 3;case`hint`:return 4;default:throw Error(`Invalid diagnostic severity: `+e)}}o(tm,`toDiagnosticSeverity`);function nm(e){switch(e){case`error`:return Yp(rm.LexingError);case`warning`:return Yp(rm.LexingWarning);case`info`:return Yp(rm.LexingInfo);case`hint`:return Yp(rm.LexingHint);default:throw Error(`Invalid diagnostic severity: `+e)}}o(nm,`toDiagnosticData`);var rm;(function(e){e.LexingError=`lexing-error`,e.LexingWarning=`lexing-warning`,e.LexingInfo=`lexing-info`,e.LexingHint=`lexing-hint`,e.ParsingError=`parsing-error`,e.LinkingError=`linking-error`})(rm||={});var im=class{static{o(this,`DefaultAstNodeDescriptionProvider`)}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n){let r=n??Jn(e);t??=this.nameProvider.getName(e);let i=this.astNodeLocator.getAstNodePath(e);if(!t)throw Error(`Node at path ${i} has no name.`);let a,s=o(()=>a??=sa(this.nameProvider.getNameNode(e)??e.$cstNode),`nameSegmentGetter`);return{node:e,name:t,get nameSegment(){return s()},selectionSegment:sa(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}},am=class{static{o(this,`DefaultReferenceDescriptionProvider`)}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=Z.CancellationToken.None){let n=[],r=e.parseResult.value;for(let e of $n(r))await dp(t),tr(e).forEach(e=>{e.reference.error||n.push(...this.createInfoDescriptions(e))});return n}createInfoDescriptions(e){let t=e.reference;if(t.error||!t.$refNode)return[];let n=[];kn(t)&&t.$nodeDescription?n=[t.$nodeDescription]:An(t)&&(n=t.items.map(e=>e.$nodeDescription).filter(e=>e!==void 0));let r=Jn(e.container).uri,i=this.nodeLocator.getAstNodePath(e.container),a=[],o=sa(t.$refNode);for(let e of n)a.push({sourceUri:r,sourcePath:i,targetUri:e.documentUri,targetPath:e.path,segment:o,local:Cp.equals(e.documentUri,r)});return a}},om=class{static{o(this,`DefaultAstNodeLocator`)}constructor(){this.segmentSeparator=`/`,this.indexSeparator=`@`}getAstNodePath(e){if(e.$container){let t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return``}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw Error(`Missing '$containerProperty' in AST node.`);return t===void 0?e:e+this.indexSeparator+t}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((e,t)=>{if(!e||t.length===0)return e;let n=t.indexOf(this.indexSeparator);if(n>0){let r=t.substring(0,n),i=parseInt(t.substring(n+1));return e[r]?.[i]}return e[t]},e)}},sm={};e(sm,r(zt(),1));var cm=class{static{o(this,`DefaultConfigurationProvider`)}constructor(e){this._ready=new fp,this.onConfigurationSectionUpdateEmitter=new sm.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let t=this.serviceRegistry.all;e.register({section:t.map(e=>this.toSectionName(e.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let t=this.serviceRegistry.all.map(e=>({section:this.toSectionName(e.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(t);t.forEach((e,t)=>{this.updateSectionConfiguration(e.section,n[t])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!=`object`||e.settings===null||Object.entries(e.settings).forEach(([e,t])=>{this.updateSectionConfiguration(e,t),this.onConfigurationSectionUpdateEmitter.fire({section:e,configuration:t})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},lm=r(En(),1),um;(function(e){function t(e){return{dispose:o(async()=>await e(),`dispose`)}}o(t,`create`),e.create=t})(um||={});var dm=class{static{o(this,`DefaultDocumentBuilder`)}constructor(e){this.updateBuildOptions={validation:{categories:[`built-in`,`fast`]}},this.updateListeners=[],this.buildPhaseListeners=new Mp,this.documentPhaseListeners=new Mp,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Q.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=Z.CancellationToken.None){for(let n of e){let e=n.uri.toString();if(n.state===Q.Validated){if(typeof t.validation==`boolean`&&t.validation)this.resetToState(n,Q.IndexedReferences);else if(typeof t.validation==`object`){let r=this.findMissingValidationCategories(n,t);r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:{categories:r}},result:this.buildState.get(e)?.result}),n.state=Q.IndexedReferences)}}else this.buildState.delete(e)}this.currentState=Q.Changed,await this.emitUpdate(e.map(e=>e.uri),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=Z.CancellationToken.None){this.currentState=Q.Changed;let r=[];for(let e of t){let t=this.langiumDocuments.deleteDocuments(e);for(let e of t)r.push(e.uri),this.cleanUpDeleted(e)}let i=(await Promise.all(e.map(e=>this.findChangedUris(e)))).flat();for(let e of i){let t=this.langiumDocuments.getDocument(e);t===void 0&&(t=this.langiumDocumentFactory.fromModel({$type:`INVALID`},e),t.state=Q.Changed,this.langiumDocuments.addDocument(t)),this.resetToState(t,Q.Changed)}let a=U(i).concat(r).map(e=>e.toString()).toSet();this.langiumDocuments.all.filter(e=>!a.has(e.uri.toString())&&this.shouldRelink(e,a)).forEach(e=>this.resetToState(e,Q.ComputedScopes)),await this.emitUpdate(i,r),await dp(n);let o=this.sortDocuments(this.langiumDocuments.all.filter(e=>e.state<Q.Validated||!this.buildState.get(e.uri.toString())?.completed||this.resultsAreIncomplete(e,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,t){return this.findMissingValidationCategories(e,t).length>=1}findMissingValidationCategories(e,t){let n=this.buildState.get(e.uri.toString()),r=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),i=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?r:new Set;return U(t===void 0||t.validation===!0?r:typeof t.validation==`object`?t.validation.categories??r:[]).filter(e=>!i.has(e)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let t=await this.fileSystemProvider.stat(e);if(t.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(t))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(n=>n(e,t)))}sortDocuments(e){let t=0,n=e.length-1;for(;t<n;){for(;t<e.length&&this.hasTextDocument(e[t]);)t++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;t<n&&([e[t],e[n]]=[e[n],e[t]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,t){return e.references.some(e=>e.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),um.create(()=>{let t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case Q.Changed:case Q.Parsed:this.indexManager.removeContent(e.uri);case Q.IndexedContent:e.localSymbols=void 0;case Q.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Q.Linked:this.indexManager.removeReferences(e.uri);case Q.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Q.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Q.Changed}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,Q.Parsed,n,e=>this.langiumDocumentFactory.update(e,n)),await this.runCancelable(e,Q.IndexedContent,n,e=>this.indexManager.updateContent(e,n)),await this.runCancelable(e,Q.ComputedScopes,n,async e=>{e.localSymbols=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectLocalSymbols(e,n)});let r=e.filter(e=>this.shouldLink(e));await this.runCancelable(r,Q.Linked,n,e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n)),await this.runCancelable(r,Q.IndexedReferences,n,e=>this.indexManager.updateReferences(e,n));let i=e.filter(e=>this.shouldValidate(e)?!0:(this.markAsCompleted(e),!1));await this.runCancelable(i,Q.Validated,n,async e=>{await this.validate(e,n),this.markAsCompleted(e)})}markAsCompleted(e){let t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(let n of e){let e=n.uri.toString(),r=this.buildState.get(e);(!r||r.completed)&&this.buildState.set(e,{completed:!1,options:t,result:r?.result})}}async runCancelable(e,t,n,r){for(let i of e)i.state<t&&(await dp(n),await r(i),i.state=t,await this.notifyDocumentPhase(i,t,n));let i=e.filter(e=>e.state===t);await this.notifyBuildPhase(i,t,n),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),um.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),um.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let r;return t&&`path`in t?r=t:n=t,n??=Z.CancellationToken.None,r?this.awaitDocumentState(e,r,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,t,n){let r=this.langiumDocuments.getDocument(t);if(r){if(r.state>=e)return Promise.resolve(t);if(n.isCancellationRequested)return Promise.reject(lp);if(this.currentState>=e&&e>r.state)return Promise.reject(new lm.ResponseError(lm.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${Q[r.state]}, requiring ${Q[e]}, but workspace state is already ${Q[this.currentState]}. Returning undefined.`))}else return Promise.reject(new lm.ResponseError(lm.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((r,i)=>{let a=this.onDocumentPhase(e,e=>{Cp.equals(e.uri,t)&&(a.dispose(),o.dispose(),r(e.uri))}),o=n.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(lp)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(lp):new Promise((n,r)=>{let i=this.onBuildPhase(e,()=>{i.dispose(),a.dispose(),n()}),a=t.onCancellationRequested(()=>{i.dispose(),a.dispose(),r(lp)})})}async notifyDocumentPhase(e,t,n){let r=this.documentPhaseListeners.get(t).slice();for(let t of r)try{await dp(n),await t(e,n)}catch(e){if(!up(e))throw e}}async notifyBuildPhase(e,t,n){if(e.length===0)return;let r=this.buildPhaseListeners.get(t).slice();for(let t of r)await dp(n),await t(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,r=this.getBuildOptions(e),i=typeof r.validation==`object`?{...r.validation}:{};i.categories=this.findMissingValidationCategories(e,r);let a=await n.validateDocument(e,i,t);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;let o=this.buildState.get(e.uri.toString());o&&(o.result??={},o.result.validationChecks?o.result.validationChecks=U(o.result.validationChecks).concat(i.categories).distinct().toArray():o.result.validationChecks=[...i.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},fm=class{static{o(this,`DefaultIndexManager`)}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Vp,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){let n=Jn(e).uri,r=[];return this.referenceIndex.forEach(e=>{e.forEach(e=>{Cp.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)})}),U(r)}allElements(e,t){let n=U(this.symbolIndex.keys());return t&&(n=n.filter(e=>!t||t.has(e))),n.map(t=>this.getFileDescriptions(t,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(e=>this.astReflection.isSubtype(e.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){let t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=Z.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),r=e.uri.toString();this.symbolIndex.set(r,n),this.symbolByTypeIndex.clear(r)}async updateReferences(e,t=Z.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(e=>!e.local&&t.has(e.targetUri.toString())):!1}},pm=class{static{o(this,`DefaultWorkspaceManager`)}constructor(e){this.initialBuildOptions={},this._ready=new fp,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(e=>this.initializeWorkspace(this.folders??[],e))}async initializeWorkspace(e,t=Z.CancellationToken.None){let n=await this.performStartup(e);await dp(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){let t=[],n=o(e=>{t.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)},`collector`);await this.loadAdditionalDocuments(e,n);let r=[];await Promise.all(e.map(e=>this.getRootFolder(e)).map(async e=>this.traverseFolder(e,r)));let i=U(r).distinct(e=>e.toString()).filter(e=>!this.langiumDocuments.hasDocument(e));return await this.loadWorkspaceDocuments(i,n),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async e=>{t(await this.langiumDocuments.getOrCreateDocument(e))}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return xp.parse(e.uri)}async traverseFolder(e,t){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async e=>{this.shouldIncludeEntry(e)&&(e.isDirectory?await this.traverseFolder(e.uri,t):e.isFile&&t.push(e.uri))}))}catch(t){console.error(`Failure to read directory content of `+e.toString(!0),t)}}async searchFolder(e){let t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){let t=Cp.basename(e.uri);return t.startsWith(`.`)?!1:e.isDirectory?t!==`node_modules`&&t!==`out`:e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},mm=class{static{o(this,`DefaultLexerErrorMessageProvider`)}buildUnexpectedCharactersMessage(e,t,n,r,i){return Ac.buildUnexpectedCharactersMessage(e,t,n,r,i)}buildUnableToPopLexerModeMessage(e){return Ac.buildUnableToPopLexerModeMessage(e)}},hm={mode:`full`},gm=class{static{o(this,`DefaultLexer`)}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t),this.chevrotainLexer=new Mc(ym(t)?Object.values(t):t,{positionTracking:`full`,skipValidations:e.LanguageMetaData.mode===`production`,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=hm){let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(ym(e))return e;let t=vm(e)?Object.values(e.modes).flat():e,n={};return t.forEach(e=>n[e.name]=e),n}};function _m(e){return Array.isArray(e)&&(e.length===0||`name`in e[0])}o(_m,`isTokenTypeArray`);function vm(e){return e&&`modes`in e&&`defaultMode`in e}o(vm,`isIMultiModeLexerDefinition`);function ym(e){return!_m(e)&&!vm(e)}o(ym,`isTokenTypeDictionary`),It();function bm(e,t,n){let r,i;typeof e==`string`?(i=t,r=n):(i=e.range.start,r=t),i||=L.create(0,0);let a=Sm(e),o=Rm(r);return jm({index:0,tokens:Tm({lines:a,position:i,options:o}),position:i})}o(bm,`parseJSDoc`);function xm(e,t){let n=Rm(t),r=Sm(e);if(r.length===0)return!1;let i=r[0],a=r[r.length-1],o=n.start,s=n.end;return!!o?.exec(i)&&!!s?.exec(a)}o(xm,`isJSDoc`);function Sm(e){let t=``;return t=typeof e==`string`?e:e.text,t.split(Ha)}o(Sm,`getLines`);var Cm=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,wm=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Tm(e){let t=[],n=e.position.line,r=e.position.character;for(let i=0;i<e.lines.length;i++){let a=i===0,o=i===e.lines.length-1,s=e.lines[i],c=0;if(a&&e.options.start){let t=e.options.start?.exec(s);t&&(c=t.index+t[0].length)}else{let t=e.options.line?.exec(s);t&&(c=t.index+t[0].length)}if(o){let t=e.options.end?.exec(s);t&&(s=s.substring(0,t.index))}if(s=s.substring(0,Am(s)),km(s,c)>=s.length){if(t.length>0){let e=L.create(n,r);t.push({type:`break`,content:``,range:R.create(e,e)})}}else{Cm.lastIndex=c;let e=Cm.exec(s);if(e){let i=e[0],a=e[1],o=L.create(n,r+c),l=L.create(n,r+c+i.length);t.push({type:`tag`,content:a,range:R.create(o,l)}),c+=i.length,c=km(s,c)}if(c<s.length){let e=s.substring(c),i=Array.from(e.matchAll(wm));t.push(...Em(i,e,n,r+c))}}n++,r=0}return t.length>0&&t[t.length-1].type===`break`?t.slice(0,-1):t}o(Tm,`tokenize`);function Em(e,t,n,r){let i=[];if(e.length===0){let e=L.create(n,r),a=L.create(n,r+t.length);i.push({type:`text`,content:t,range:R.create(e,a)})}else{let a=0;for(let o of e){let e=o.index,s=t.substring(a,e);s.length>0&&i.push({type:`text`,content:t.substring(a,e),range:R.create(L.create(n,a+r),L.create(n,e+r))});let c=s.length+1,l=o[1];if(i.push({type:`inline-tag`,content:l,range:R.create(L.create(n,a+c+r),L.create(n,a+c+l.length+r))}),c+=l.length,o.length===4){c+=o[2].length;let e=o[3];i.push({type:`text`,content:e,range:R.create(L.create(n,a+c+r),L.create(n,a+c+e.length+r))})}else i.push({type:`text`,content:``,range:R.create(L.create(n,a+c+r),L.create(n,a+c+r))});a=e+o[0].length}let o=t.substring(a);o.length>0&&i.push({type:`text`,content:o,range:R.create(L.create(n,a+r),L.create(n,a+r+o.length))})}return i}o(Em,`buildInlineTokens`);var Dm=/\S/,Om=/\s*$/;function km(e,t){let n=e.substring(t).match(Dm);return n?t+n.index:e.length}o(km,`skipWhitespace`);function Am(e){let t=e.match(Om);if(t&&typeof t.index==`number`)return t.index}o(Am,`lastCharacter`);function jm(e){let t=L.create(e.position.line,e.position.character);if(e.tokens.length===0)return new Bm([],R.create(t,t));let n=[];for(;e.index<e.tokens.length;){let t=Mm(e,n[n.length-1]);t&&n.push(t)}let r=n[0]?.range.start??t,i=n[n.length-1]?.range.end??t;return new Bm(n,R.create(r,i))}o(jm,`parseJSDocComment`);function Mm(e,t){let n=e.tokens[e.index];if(n.type===`tag`)return Im(e,!1);if(n.type===`text`||n.type===`inline-tag`)return Pm(e);Nm(n,t),e.index++}o(Mm,`parseJSDocElement`);function Nm(e,t){if(t){let n=new Gm(``,e.range);`inlines`in t?t.inlines.push(n):t.content.inlines.push(n)}}o(Nm,`appendEmptyLine`);function Pm(e){let t=e.tokens[e.index],n=t,r=t,i=[];for(;t&&t.type!==`break`&&t.type!==`tag`;)i.push(Fm(e)),r=t,t=e.tokens[e.index];return new Wm(i,R.create(n.range.start,r.range.end))}o(Pm,`parseJSDocText`);function Fm(e){return e.tokens[e.index].type===`inline-tag`?Im(e,!0):Lm(e)}o(Fm,`parseJSDocInline`);function Im(e,t){let n=e.tokens[e.index++],r=n.content.substring(1);if(e.tokens[e.index]?.type===`text`)if(t){let i=Lm(e);return new Vm(r,new Wm([i],i.range),t,R.create(n.range.start,i.range.end))}else{let i=Pm(e);return new Vm(r,i,t,R.create(n.range.start,i.range.end))}else{let e=n.range;return new Vm(r,new Wm([],e),t,e)}}o(Im,`parseJSDocTag`);function Lm(e){let t=e.tokens[e.index++];return new Gm(t.content,t.range)}o(Lm,`parseJSDocLine`);function Rm(e){if(!e)return Rm({start:`/**`,end:`*/`,line:`*`});let{start:t,end:n,line:r}=e;return{start:zm(t,!0),end:zm(n,!1),line:zm(r,!0)}}o(Rm,`normalizeOptions`);function zm(e,t){if(typeof e==`string`||typeof e==`object`){let n=typeof e==`string`?Ya(e):e.source;return RegExp(t?`^\\s*${n}`:`\\s*${n}\\s*$`)}else return e}o(zm,`normalizeOption`);var Bm=class{static{o(this,`JSDocCommentImpl`)}constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>`name`in e)}toString(){let e=``;for(let t of this.elements)if(e.length===0)e=t.toString();else{let n=t.toString();e+=Km(e)+n}return e.trim()}toMarkdown(e){let t=``;for(let n of this.elements)if(t.length===0)t=n.toMarkdown(e);else{let r=n.toMarkdown(e);t+=Km(t)+r}return t.trim()}},Vm=class{static{o(this,`JSDocTagImpl`)}constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`,t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}
|
||
${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let t=this.content.toMarkdown(e);if(this.inline){let n=Hm(this.name,t,e??{});if(typeof n==`string`)return n}let n=``;e?.tag===`italic`||e?.tag===void 0?n=`*`:e?.tag===`bold`?n=`**`:e?.tag===`bold-italic`&&(n=`***`);let r=`${n}@${this.name}${n}`;return this.content.inlines.length===1?r=`${r} \u2014 ${t}`:this.content.inlines.length>1&&(r=`${r}
|
||
${t}`),this.inline?`{${r}}`:r}};function Hm(e,t,n){if(e===`linkplain`||e===`linkcode`||e===`link`){let r=t.indexOf(` `),i=t;if(r>0){let e=km(t,r);i=t.substring(e),t=t.substring(0,r)}return(e===`linkcode`||e===`link`&&n.link===`code`)&&(i=`\`${i}\``),n.renderLink?.(t,i)??Um(t,i)}}o(Hm,`renderInlineTag`);function Um(e,t){try{return xp.parse(e,!0),`[${t}](${e})`}catch{return e}}o(Um,`renderLinkDefault`);var Wm=class{static{o(this,`JSDocTextImpl`)}constructor(e,t){this.inlines=e,this.range=t}toString(){let e=``;for(let t=0;t<this.inlines.length;t++){let n=this.inlines[t],r=this.inlines[t+1];e+=n.toString(),r&&r.range.start.line>n.range.start.line&&(e+=`
|
||
`)}return e}toMarkdown(e){let t=``;for(let n=0;n<this.inlines.length;n++){let r=this.inlines[n],i=this.inlines[n+1];t+=r.toMarkdown(e),i&&i.range.start.line>r.range.start.line&&(t+=`
|
||
`)}return t}},Gm=class{static{o(this,`JSDocLineImpl`)}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function Km(e){return e.endsWith(`
|
||
`)?`
|
||
`:`
|
||
|
||
`}o(Km,`fillNewlines`);var qm=class{static{o(this,`JSDocDocumentationProvider`)}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let t=this.commentProvider.getComment(e);if(t&&xm(t))return bm(t).toMarkdown({renderLink:o((t,n)=>this.documentationLinkRenderer(e,t,n),`renderLink`),renderTag:o(t=>this.documentationTagRenderer(e,t),`renderTag`)})}documentationLinkRenderer(e,t,n){let r=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(r&&r.nameSegment){let e=r.nameSegment.range.start.line+1,t=r.nameSegment.range.start.character+1;return`[${n}](${r.documentUri.with({fragment:`L${e},${t}`}).toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){let n=Jn(e).localSymbols;if(!n)return;let r=e;do{let e=n.getStream(r).find(e=>e.name===t);if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(e=>e.name===t)}},Jm=class{static{o(this,`DefaultCommentProvider`)}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Gp(e)?e.$comment:pa(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},Ym=class{static{o(this,`DefaultAsyncParser`)}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},Xm=class{static{o(this,`AbstractThreadedAsyncParser`)}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){let n=await this.acquireParserWorker(t),r=new fp,i,a=t.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(e=>{let t=this.hydrator.hydrate(e);r.resolve(t)}).catch(e=>{r.reject(e)}).finally(()=>{a.dispose(),clearTimeout(i)}),r.promise}terminateWorker(e){e.terminate();let t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(let e of this.workerPool)if(e.ready)return e.lock(),e;let t=new fp;return e.onCancellationRequested(()=>{let e=this.queue.indexOf(t);e>=0&&this.queue.splice(e,1),t.reject(lp)}),this.queue.push(t),t.promise}},Zm=class{static{o(this,`ParserWorker`)}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,n,r){this.onReadyEmitter=new sm.Emitter,this.deferred=new fp,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=r,t(e=>{let t=e;this.deferred.resolve(t),this.unlock()}),n(e=>{this.deferred.reject(e),this.unlock()})}terminate(){this.deferred.reject(lp),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw Error(`Parser worker is busy`);return this._parsing=!0,this.deferred=new fp,this.sendMessage(e),this.deferred.promise}},Qm=class{static{o(this,`DefaultWorkspaceLock`)}constructor(){this.previousTokenSource=new Z.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let t=sp();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n=Z.CancellationToken.None){let r=new fp,i={action:t,deferred:r,cancellationToken:n};return e.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:e,deferred:t,cancellationToken:n})=>{try{let r=await Promise.resolve().then(()=>e(n));t.resolve(r)}catch(e){up(e)?t.resolve(void 0):t.reject(e)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$m=class{static{o(this,`DefaultHydrator`)}constructor(e){this.grammarElementIdMap=new Np,this.tokenTypeIdMap=new Np,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(e=>({...e,message:e.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let t=new Map,n=new Map;for(let n of $n(e))t.set(n,{});if(e.$cstNode)for(let t of ra(e.$cstNode))n.set(t,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(let[r,i]of Object.entries(e))if(!r.startsWith(`$`))if(Array.isArray(i)){let e=[];n[r]=e;for(let n of i)H(n)?e.push(this.dehydrateAstNode(n,t)):kn(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else H(i)?n[r]=this.dehydrateAstNode(i,t):kn(i)?n[r]=this.dehydrateReference(i,t):i!==void 0&&(n[r]=i);return n}dehydrateReference(e,t){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){let n=t.cstNodes.get(e);return In(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),Pn(e)?n.content=e.content.map(e=>this.dehydrateCstNode(e,t)):Fn(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let t=e.value,n=this.createHydrationContext(t);return`$cstNode`in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){let t=new Map,n=new Map;for(let n of $n(e))t.set(n,{});let r;if(e.$cstNode)for(let t of ra(e.$cstNode)){let e;`fullText`in t?(e=new xf(t.fullText),r=e):`content`in t?e=new yf:`tokenType`in t&&(e=this.hydrateCstLeafNode(t)),e&&(n.set(t,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(let[r,i]of Object.entries(e))if(!r.startsWith(`$`))if(Array.isArray(i)){let e=[];n[r]=e;for(let a of i)H(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):kn(a)?e.push(this.hydrateReference(a,n,r,t)):e.push(a)}else H(i)?n[r]=this.setParent(this.hydrateAstNode(i,t),n):kn(i)?n[r]=this.hydrateReference(i,n,r,t):i!==void 0&&(n[r]=i);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){let r=t.cstNodes.get(e);if(typeof e.grammarSource==`number`&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),Pn(r))for(let i of e.content){let e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){let t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,a=e.startColumn,o=e.endLine,s=e.endColumn,c=e.hidden;return new vf(n,r,{start:{line:i,character:a},end:{line:o,character:s}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let t of $n(this.grammar))cr(t)&&this.grammarElementIdMap.set(t,e++)}};function eh(e){return{documentation:{CommentProvider:o(e=>new Jm(e),`CommentProvider`),DocumentationProvider:o(e=>new qm(e),`DocumentationProvider`)},parser:{AsyncParser:o(e=>new Ym(e),`AsyncParser`),GrammarConfig:o(e=>Ro(e),`GrammarConfig`),LangiumParser:o(e=>$f(e),`LangiumParser`),CompletionParser:o(e=>Qf(e),`CompletionParser`),ValueConverter:o(()=>new np,`ValueConverter`),TokenBuilder:o(()=>new tp,`TokenBuilder`),Lexer:o(e=>new gm(e),`Lexer`),ParserErrorMessageProvider:o(()=>new kf,`ParserErrorMessageProvider`),LexerErrorMessageProvider:o(()=>new mm,`LexerErrorMessageProvider`)},workspace:{AstNodeLocator:o(()=>new om,`AstNodeLocator`),AstNodeDescriptionProvider:o(e=>new im(e),`AstNodeDescriptionProvider`),ReferenceDescriptionProvider:o(e=>new am(e),`ReferenceDescriptionProvider`)},references:{Linker:o(e=>new Op(e),`Linker`),NameProvider:o(()=>new Ap,`NameProvider`),ScopeProvider:o(e=>new Wp(e),`ScopeProvider`),ScopeComputation:o(e=>new Pp(e),`ScopeComputation`),References:o(e=>new jp(e),`References`)},serializer:{Hydrator:o(e=>new $m(e),`Hydrator`),JsonSerializer:o(e=>new qp(e),`JsonSerializer`)},validation:{DocumentValidator:o(e=>new $p(e),`DocumentValidator`),ValidationRegistry:o(e=>new Zp(e),`ValidationRegistry`)},shared:o(()=>e.shared,`shared`)}}o(eh,`createDefaultCoreModule`);function th(e){return{ServiceRegistry:o(e=>new Jp(e),`ServiceRegistry`),workspace:{LangiumDocuments:o(e=>new Ep(e),`LangiumDocuments`),LangiumDocumentFactory:o(e=>new Tp(e),`LangiumDocumentFactory`),DocumentBuilder:o(e=>new dm(e),`DocumentBuilder`),IndexManager:o(e=>new fm(e),`IndexManager`),WorkspaceManager:o(e=>new pm(e),`WorkspaceManager`),FileSystemProvider:o(t=>e.fileSystemProvider(t),`FileSystemProvider`),WorkspaceLock:o(()=>new Qm,`WorkspaceLock`),ConfigurationProvider:o(e=>new cm(e),`ConfigurationProvider`)},profilers:{}}}o(th,`createDefaultSharedCoreModule`);var nh;(function(e){e.merge=(e,t)=>lh(lh({},e),t)})(nh||={});function rh(e,t,n,r,i,a,o,s,c){return oh([e,t,n,r,i,a,o,s,c].reduce(lh,{}))}o(rh,`inject`);var ih=Symbol(`isProxy`);function ah(e){if(e&&e[ih])for(let t of Object.values(e))ah(t);return e}o(ah,`eagerLoad`);function oh(e,t){let n=new Proxy({},{deleteProperty:o(()=>!1,`deleteProperty`),set:o(()=>{throw Error(`Cannot set property on injected service container`)},`set`),get:o((r,i)=>i===ih?!0:ch(r,i,e,t||n),`get`),getOwnPropertyDescriptor:o((r,i)=>(ch(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),`getOwnPropertyDescriptor`),has:o((t,n)=>n in e,`has`),ownKeys:o(()=>[...Object.getOwnPropertyNames(e)],`ownKeys`)});return n}o(oh,`_inject`);var sh=Symbol();function ch(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw Error(`Construction failure. Please make sure that your dependencies are constructable. Cause: `+e[t]);if(e[t]===sh)throw Error(`Cycle detected. Please make "`+String(t)+`" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies`);return e[t]}else if(t in n){let i=n[t];e[t]=sh;try{e[t]=typeof i==`function`?i(r):oh(i,r)}catch(n){throw e[t]=n instanceof Error?n:void 0,n}return e[t]}else return}o(ch,`_resolve`);function lh(e,t){if(t){for(let[n,r]of Object.entries(t))if(r!=null)if(typeof r==`object`){let t=e[n];typeof t==`object`&&t?e[n]=lh(t,r):e[n]=lh({},r)}else e[n]=r}return e}o(lh,`_merge`);var uh={indentTokenName:`INDENT`,dedentTokenName:`DEDENT`,whitespaceTokenName:`WS`,ignoreIndentationDelimiters:[]},dh;(function(e){e.REGULAR=`indentation-sensitive`,e.IGNORE_INDENTATION=`ignore-indentation`})(dh||={});var fh=class extends tp{static{o(this,`IndentationAwareTokenBuilder`)}constructor(e=uh){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...uh,...e},this.indentTokenType=Wc({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Wc({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){let n=super.buildTokens(e,t);if(!_m(n))throw Error(`Invalid tokens built by default builder`);let{indentTokenName:r,dedentTokenName:i,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options,s,c,l,u=[];for(let e of n){for(let[t,n]of o)e.name===t?e.PUSH_MODE=dh.IGNORE_INDENTATION:e.name===n&&(e.POP_MODE=!0);e.name===i?s=e:e.name===r?c=e:e.name===a?l=e:u.push(e)}if(!s||!c||!l)throw Error(`Some indentation/whitespace tokens not found!`);return o.length>0?{modes:{[dh.REGULAR]:[s,c,...u,l],[dh.IGNORE_INDENTATION]:[...u,l]},defaultMode:dh.REGULAR}:[s,c,l,...u]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r
|
||
`.includes(e[t-1])}matchWhitespace(e,t,n,r){this.whitespaceRegExp.lastIndex=t;let i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,t,n,r){let i=this.getLineNumber(t,r);return qc(e,n,r,r+n.length,i,i,1,n.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,n,r);return i<=a?null:(this.indentationStack.push(i),o)}dedentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,n,r);if(i>=a)return null;let s=this.indentationStack.lastIndexOf(i);if(s===-1)return this.diagnostics.push({severity:`error`,message:`Invalid dedent level ${i} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;let c=this.indentationStack.length-s-1,l=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let r=0;r<c;r++){let r=this.createIndentationTokenInstance(this.dedentTokenType,e,``,t-(l-1));n.push(r),this.indentationStack.pop()}return null}buildTerminalToken(e){let t=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:r,whitespaceTokenName:i}=this.options;return t.name===n?this.indentTokenType:t.name===r?this.dedentTokenType:t.name===i?Wc({name:i,pattern:this.whitespaceRegExp,group:Mc.SKIPPED}):t}flushRemainingDedents(e){let t=[];for(;this.indentationStack.length>1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,``,e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},ph=class extends gm{static{o(this,`IndentationAwareLexer`)}constructor(e){if(super(e),e.parser.TokenBuilder instanceof fh)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw Error(`IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder`)}tokenize(e,t=hm){let n=super.tokenize(e),r=n.report;t?.mode===`full`&&n.tokens.push(...r.remainingDedents),r.remainingDedents=[];let{indentTokenType:i,dedentTokenType:a}=this.indentationTokenBuilder,o=i.tokenTypeIdx,s=a.tokenTypeIdx,c=[],l=n.tokens.length-1;for(let e=0;e<l;e++){let t=n.tokens[e],r=n.tokens[e+1];if(t.tokenTypeIdx===o&&r.tokenTypeIdx===s){e++;continue}c.push(t)}return l>=0&&c.push(n.tokens[l]),n.tokens=c,n}},mh={};t(mh,{AstUtils:()=>Wn,BiMap:()=>Np,Cancellation:()=>Z,ContextCache:()=>Vp,CstUtils:()=>On,DONE_RESULT:()=>Vn,Deferred:()=>fp,Disposable:()=>um,DisposableCache:()=>zp,DocumentCache:()=>Hp,EMPTY_STREAM:()=>Bn,ErrorWithLocation:()=>Ta,GrammarUtils:()=>wa,MultiMap:()=>Mp,OperationCancelled:()=>lp,Reduction:()=>Un,RegExpUtils:()=>Oa,SimpleCache:()=>Bp,StreamImpl:()=>Ln,TreeStreamImpl:()=>Hn,URI:()=>xp,UriTrie:()=>wp,UriUtils:()=>Cp,WorkspaceCache:()=>Up,assertCondition:()=>Da,assertUnreachable:()=>Ea,delayNextTick:()=>ip,interruptAndCheck:()=>dp,isOperationCancelled:()=>up,loadGrammarFromJson:()=>bh,setInterruptionPeriod:()=>cp,startCancelableOperation:()=>sp,stream:()=>U}),e(mh,sm);var hh=class{static{o(this,`EmptyFileSystemProvider`)}stat(e){throw Error(`No file system is available.`)}statSync(e){throw Error(`No file system is available.`)}async exists(){return!1}existsSync(){return!1}readBinary(){throw Error(`No file system is available.`)}readBinarySync(){throw Error(`No file system is available.`)}readFile(){throw Error(`No file system is available.`)}readFileSync(){throw Error(`No file system is available.`)}async readDirectory(){return[]}readDirectorySync(){return[]}},gh={fileSystemProvider:o(()=>new hh,`fileSystemProvider`)},_h={Grammar:o(()=>{},`Grammar`),LanguageMetaData:o(()=>({caseInsensitive:!1,fileExtensions:[`.langium`],languageId:`langium`}),`LanguageMetaData`)},vh={AstReflection:o(()=>new ta,`AstReflection`)};function yh(){let e=rh(th(gh),vh),t=rh(eh({shared:e}),_h);return e.ServiceRegistry.register(t),t}o(yh,`createMinimalGrammarServices`);function bh(e){let t=yh(),n=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(n,xp.parse(`memory:/${n.name??`grammar`}.langium`)),n}o(bh,`loadGrammarFromJson`),e(Dn,mh);var xh=class{static{o(this,`DefaultLangiumProfiler`)}constructor(e){this.activeCategories=new Set,this.allCategories=new Set([`validating`,`parsing`,`linking`]),this.activeCategories=e??new Set(this.allCategories),this.records=new Mp}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(e=>this.activeCategories.add(e)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(e=>this.activeCategories.delete(e)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new Sh(t=>this.records.add(e,this.dumpRecord(e,t)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);let n=[];for(let e of t.entries.keys()){let r=t.entries.get(e),i=r.reduce((e,t)=>e+t);n.push({name:`${t.identifier}.${e}`,count:r.length,duration:i})}let r=t.duration-n.map(e=>e.duration).reduce((e,t)=>e+t,0);n.push({name:t.identifier,count:1,duration:r}),n.sort((e,t)=>t.duration-e.duration);function i(e){return Math.round(100*e)/100}return o(i,`Round`),console.table(n.map(e=>({Element:e.name,Count:e.count,"Self %":i(100*e.duration/t.duration),"Time (ms)":i(e.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(e=>e===t[0])).flatMap(e=>e[1])}},Sh=class{static{o(this,`ProfilingTask`)}constructor(e,t){this.stack=[],this.entries=new Mp,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(e=>e.id).join(`, `)}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let t=this.stack.pop();if(!t)throw Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw Error(`Sub-Task "${t.id}" is not already stopped.`);let n=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let r=n-t.content;this.entries.add(e,r)}},Ch=Object.defineProperty,$=o((e,t)=>Ch(e,`name`,{value:t,configurable:!0}),`__name`),wh;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(wh||={});var Th;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Th||={});var Eh;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Eh||={});var Dh;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Dh||={});var Oh;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Oh||={});var kh;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(kh||={});var Ah;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Ah||={});var jh;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(jh||={});var Mh;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \t]+[A-Za-z(][A-Za-z0-9_()&]*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Mh||={}),{...wh.Terminals,...Th.Terminals,...Eh.Terminals,...Dh.Terminals,...Oh.Terminals,...kh.Terminals,...jh.Terminals,...Ah.Terminals,...Mh.Terminals};var Nh={$type:`Accelerator`,name:`name`,x:`x`,y:`y`},Ph={$type:`Anchor`,evolution:`evolution`,name:`name`,visibility:`visibility`},Fh={$type:`Annotation`,number:`number`,text:`text`,x:`x`,y:`y`},Ih={$type:`Annotations`,x:`x`,y:`y`},Lh={$type:`Architecture`,accDescr:`accDescr`,accTitle:`accTitle`,edges:`edges`,groups:`groups`,junctions:`junctions`,services:`services`,title:`title`};function Rh(e){return Bg.isInstance(e,Lh.$type)}o(Rh,`isArchitecture`),$(Rh,`isArchitecture`);var zh={$type:`Axis`,label:`label`,name:`name`},Bh={$type:`Branch`,name:`name`,order:`order`};function Vh(e){return Bg.isInstance(e,Bh.$type)}o(Vh,`isBranch`),$(Vh,`isBranch`);var Hh={$type:`Checkout`,branch:`branch`},Uh={$type:`CherryPicking`,id:`id`,parent:`parent`,tags:`tags`},Wh={$type:`ClassDefStatement`,className:`className`,styleText:`styleText`},Gh={$type:`Commit`,id:`id`,message:`message`,tags:`tags`,type:`type`};function Kh(e){return Bg.isInstance(e,Gh.$type)}o(Kh,`isCommit`),$(Kh,`isCommit`);var qh={$type:`Component`,decorator:`decorator`,evolution:`evolution`,inertia:`inertia`,label:`label`,name:`name`,visibility:`visibility`},Jh={$type:`Curve`,entries:`entries`,label:`label`,name:`name`},Yh={$type:`Deaccelerator`,name:`name`,x:`x`,y:`y`},Xh={$type:`Decorator`,strategy:`strategy`},Zh={$type:`Direction`,accDescr:`accDescr`,accTitle:`accTitle`,dir:`dir`,statements:`statements`,title:`title`},Qh={$type:`Edge`,lhsDir:`lhsDir`,lhsGroup:`lhsGroup`,lhsId:`lhsId`,lhsInto:`lhsInto`,rhsDir:`rhsDir`,rhsGroup:`rhsGroup`,rhsId:`rhsId`,rhsInto:`rhsInto`,title:`title`},$h={$type:`Entry`,axis:`axis`,value:`value`},eg={$type:`Evolution`,stages:`stages`},tg={$type:`EvolutionStage`,boundary:`boundary`,name:`name`,secondName:`secondName`},ng={$type:`Evolve`,component:`component`,target:`target`},rg={$type:`GitGraph`,accDescr:`accDescr`,accTitle:`accTitle`,statements:`statements`,title:`title`};function ig(e){return Bg.isInstance(e,rg.$type)}o(ig,`isGitGraph`),$(ig,`isGitGraph`);var ag={$type:`Group`,icon:`icon`,id:`id`,in:`in`,title:`title`},og={$type:`Info`,accDescr:`accDescr`,accTitle:`accTitle`,title:`title`};function sg(e){return Bg.isInstance(e,og.$type)}o(sg,`isInfo`),$(sg,`isInfo`);var cg={$type:`Item`,classSelector:`classSelector`,name:`name`},lg={$type:`Junction`,id:`id`,in:`in`},ug={$type:`Label`,negX:`negX`,negY:`negY`,offsetX:`offsetX`,offsetY:`offsetY`},dg={$type:`Leaf`,classSelector:`classSelector`,name:`name`,value:`value`},fg={$type:`Link`,arrow:`arrow`,from:`from`,fromPort:`fromPort`,linkLabel:`linkLabel`,to:`to`,toPort:`toPort`},pg={$type:`Merge`,branch:`branch`,id:`id`,tags:`tags`,type:`type`};function mg(e){return Bg.isInstance(e,pg.$type)}o(mg,`isMerge`),$(mg,`isMerge`);var hg={$type:`Note`,evolution:`evolution`,text:`text`,visibility:`visibility`},gg={$type:`Option`,name:`name`,value:`value`},_g={$type:`Packet`,accDescr:`accDescr`,accTitle:`accTitle`,blocks:`blocks`,title:`title`};function vg(e){return Bg.isInstance(e,_g.$type)}o(vg,`isPacket`),$(vg,`isPacket`);var yg={$type:`PacketBlock`,bits:`bits`,end:`end`,label:`label`,start:`start`};function bg(e){return Bg.isInstance(e,yg.$type)}o(bg,`isPacketBlock`),$(bg,`isPacketBlock`);var xg={$type:`Pie`,accDescr:`accDescr`,accTitle:`accTitle`,sections:`sections`,showData:`showData`,title:`title`};function Sg(e){return Bg.isInstance(e,xg.$type)}o(Sg,`isPie`),$(Sg,`isPie`);var Cg={$type:`PieSection`,label:`label`,value:`value`};function wg(e){return Bg.isInstance(e,Cg.$type)}o(wg,`isPieSection`),$(wg,`isPieSection`);var Tg={$type:`Pipeline`,components:`components`,parent:`parent`},Eg={$type:`PipelineComponent`,evolution:`evolution`,label:`label`,name:`name`},Dg={$type:`Radar`,accDescr:`accDescr`,accTitle:`accTitle`,axes:`axes`,curves:`curves`,options:`options`,title:`title`},Og={$type:`Section`,classSelector:`classSelector`,name:`name`},kg={$type:`Service`,icon:`icon`,iconText:`iconText`,id:`id`,in:`in`,title:`title`},Ag={$type:`Size`,height:`height`,width:`width`},jg={$type:`Statement`},Mg={$type:`Treemap`,accDescr:`accDescr`,accTitle:`accTitle`,title:`title`,TreemapRows:`TreemapRows`};function Ng(e){return Bg.isInstance(e,Mg.$type)}o(Ng,`isTreemap`),$(Ng,`isTreemap`);var Pg={$type:`TreemapRow`,indent:`indent`,item:`item`},Fg={$type:`TreeNode`,indent:`indent`,name:`name`},Ig={$type:`TreeView`,accDescr:`accDescr`,accTitle:`accTitle`,nodes:`nodes`,title:`title`},Lg={$type:`Wardley`,accDescr:`accDescr`,accelerators:`accelerators`,accTitle:`accTitle`,anchors:`anchors`,annotation:`annotation`,annotations:`annotations`,components:`components`,deaccelerators:`deaccelerators`,evolution:`evolution`,evolves:`evolves`,links:`links`,notes:`notes`,pipelines:`pipelines`,size:`size`,title:`title`};function Rg(e){return Bg.isInstance(e,Lg.$type)}o(Rg,`isWardley`),$(Rg,`isWardley`);var zg=class extends Nn{static{o(this,`MermaidAstReflection`)}constructor(){super(...arguments),this.types={Accelerator:{name:Nh.$type,properties:{name:{name:Nh.name},x:{name:Nh.x},y:{name:Nh.y}},superTypes:[]},Anchor:{name:Ph.$type,properties:{evolution:{name:Ph.evolution},name:{name:Ph.name},visibility:{name:Ph.visibility}},superTypes:[]},Annotation:{name:Fh.$type,properties:{number:{name:Fh.number},text:{name:Fh.text},x:{name:Fh.x},y:{name:Fh.y}},superTypes:[]},Annotations:{name:Ih.$type,properties:{x:{name:Ih.x},y:{name:Ih.y}},superTypes:[]},Architecture:{name:Lh.$type,properties:{accDescr:{name:Lh.accDescr},accTitle:{name:Lh.accTitle},edges:{name:Lh.edges,defaultValue:[]},groups:{name:Lh.groups,defaultValue:[]},junctions:{name:Lh.junctions,defaultValue:[]},services:{name:Lh.services,defaultValue:[]},title:{name:Lh.title}},superTypes:[]},Axis:{name:zh.$type,properties:{label:{name:zh.label},name:{name:zh.name}},superTypes:[]},Branch:{name:Bh.$type,properties:{name:{name:Bh.name},order:{name:Bh.order}},superTypes:[jg.$type]},Checkout:{name:Hh.$type,properties:{branch:{name:Hh.branch}},superTypes:[jg.$type]},CherryPicking:{name:Uh.$type,properties:{id:{name:Uh.id},parent:{name:Uh.parent},tags:{name:Uh.tags,defaultValue:[]}},superTypes:[jg.$type]},ClassDefStatement:{name:Wh.$type,properties:{className:{name:Wh.className},styleText:{name:Wh.styleText}},superTypes:[]},Commit:{name:Gh.$type,properties:{id:{name:Gh.id},message:{name:Gh.message},tags:{name:Gh.tags,defaultValue:[]},type:{name:Gh.type}},superTypes:[jg.$type]},Component:{name:qh.$type,properties:{decorator:{name:qh.decorator},evolution:{name:qh.evolution},inertia:{name:qh.inertia,defaultValue:!1},label:{name:qh.label},name:{name:qh.name},visibility:{name:qh.visibility}},superTypes:[]},Curve:{name:Jh.$type,properties:{entries:{name:Jh.entries,defaultValue:[]},label:{name:Jh.label},name:{name:Jh.name}},superTypes:[]},Deaccelerator:{name:Yh.$type,properties:{name:{name:Yh.name},x:{name:Yh.x},y:{name:Yh.y}},superTypes:[]},Decorator:{name:Xh.$type,properties:{strategy:{name:Xh.strategy}},superTypes:[]},Direction:{name:Zh.$type,properties:{accDescr:{name:Zh.accDescr},accTitle:{name:Zh.accTitle},dir:{name:Zh.dir},statements:{name:Zh.statements,defaultValue:[]},title:{name:Zh.title}},superTypes:[rg.$type]},Edge:{name:Qh.$type,properties:{lhsDir:{name:Qh.lhsDir},lhsGroup:{name:Qh.lhsGroup,defaultValue:!1},lhsId:{name:Qh.lhsId},lhsInto:{name:Qh.lhsInto,defaultValue:!1},rhsDir:{name:Qh.rhsDir},rhsGroup:{name:Qh.rhsGroup,defaultValue:!1},rhsId:{name:Qh.rhsId},rhsInto:{name:Qh.rhsInto,defaultValue:!1},title:{name:Qh.title}},superTypes:[]},Entry:{name:$h.$type,properties:{axis:{name:$h.axis,referenceType:zh.$type},value:{name:$h.value}},superTypes:[]},Evolution:{name:eg.$type,properties:{stages:{name:eg.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:tg.$type,properties:{boundary:{name:tg.boundary},name:{name:tg.name},secondName:{name:tg.secondName}},superTypes:[]},Evolve:{name:ng.$type,properties:{component:{name:ng.component},target:{name:ng.target}},superTypes:[]},GitGraph:{name:rg.$type,properties:{accDescr:{name:rg.accDescr},accTitle:{name:rg.accTitle},statements:{name:rg.statements,defaultValue:[]},title:{name:rg.title}},superTypes:[]},Group:{name:ag.$type,properties:{icon:{name:ag.icon},id:{name:ag.id},in:{name:ag.in},title:{name:ag.title}},superTypes:[]},Info:{name:og.$type,properties:{accDescr:{name:og.accDescr},accTitle:{name:og.accTitle},title:{name:og.title}},superTypes:[]},Item:{name:cg.$type,properties:{classSelector:{name:cg.classSelector},name:{name:cg.name}},superTypes:[]},Junction:{name:lg.$type,properties:{id:{name:lg.id},in:{name:lg.in}},superTypes:[]},Label:{name:ug.$type,properties:{negX:{name:ug.negX,defaultValue:!1},negY:{name:ug.negY,defaultValue:!1},offsetX:{name:ug.offsetX},offsetY:{name:ug.offsetY}},superTypes:[]},Leaf:{name:dg.$type,properties:{classSelector:{name:dg.classSelector},name:{name:dg.name},value:{name:dg.value}},superTypes:[cg.$type]},Link:{name:fg.$type,properties:{arrow:{name:fg.arrow},from:{name:fg.from},fromPort:{name:fg.fromPort},linkLabel:{name:fg.linkLabel},to:{name:fg.to},toPort:{name:fg.toPort}},superTypes:[]},Merge:{name:pg.$type,properties:{branch:{name:pg.branch},id:{name:pg.id},tags:{name:pg.tags,defaultValue:[]},type:{name:pg.type}},superTypes:[jg.$type]},Note:{name:hg.$type,properties:{evolution:{name:hg.evolution},text:{name:hg.text},visibility:{name:hg.visibility}},superTypes:[]},Option:{name:gg.$type,properties:{name:{name:gg.name},value:{name:gg.value,defaultValue:!1}},superTypes:[]},Packet:{name:_g.$type,properties:{accDescr:{name:_g.accDescr},accTitle:{name:_g.accTitle},blocks:{name:_g.blocks,defaultValue:[]},title:{name:_g.title}},superTypes:[]},PacketBlock:{name:yg.$type,properties:{bits:{name:yg.bits},end:{name:yg.end},label:{name:yg.label},start:{name:yg.start}},superTypes:[]},Pie:{name:xg.$type,properties:{accDescr:{name:xg.accDescr},accTitle:{name:xg.accTitle},sections:{name:xg.sections,defaultValue:[]},showData:{name:xg.showData,defaultValue:!1},title:{name:xg.title}},superTypes:[]},PieSection:{name:Cg.$type,properties:{label:{name:Cg.label},value:{name:Cg.value}},superTypes:[]},Pipeline:{name:Tg.$type,properties:{components:{name:Tg.components,defaultValue:[]},parent:{name:Tg.parent}},superTypes:[]},PipelineComponent:{name:Eg.$type,properties:{evolution:{name:Eg.evolution},label:{name:Eg.label},name:{name:Eg.name}},superTypes:[]},Radar:{name:Dg.$type,properties:{accDescr:{name:Dg.accDescr},accTitle:{name:Dg.accTitle},axes:{name:Dg.axes,defaultValue:[]},curves:{name:Dg.curves,defaultValue:[]},options:{name:Dg.options,defaultValue:[]},title:{name:Dg.title}},superTypes:[]},Section:{name:Og.$type,properties:{classSelector:{name:Og.classSelector},name:{name:Og.name}},superTypes:[cg.$type]},Service:{name:kg.$type,properties:{icon:{name:kg.icon},iconText:{name:kg.iconText},id:{name:kg.id},in:{name:kg.in},title:{name:kg.title}},superTypes:[]},Size:{name:Ag.$type,properties:{height:{name:Ag.height},width:{name:Ag.width}},superTypes:[]},Statement:{name:jg.$type,properties:{},superTypes:[]},TreeNode:{name:Fg.$type,properties:{indent:{name:Fg.indent},name:{name:Fg.name}},superTypes:[]},TreeView:{name:Ig.$type,properties:{accDescr:{name:Ig.accDescr},accTitle:{name:Ig.accTitle},nodes:{name:Ig.nodes,defaultValue:[]},title:{name:Ig.title}},superTypes:[]},Treemap:{name:Mg.$type,properties:{accDescr:{name:Mg.accDescr},accTitle:{name:Mg.accTitle},title:{name:Mg.title},TreemapRows:{name:Mg.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Pg.$type,properties:{indent:{name:Pg.indent},item:{name:Pg.item}},superTypes:[]},Wardley:{name:Lg.$type,properties:{accDescr:{name:Lg.accDescr},accelerators:{name:Lg.accelerators,defaultValue:[]},accTitle:{name:Lg.accTitle},anchors:{name:Lg.anchors,defaultValue:[]},annotation:{name:Lg.annotation,defaultValue:[]},annotations:{name:Lg.annotations,defaultValue:[]},components:{name:Lg.components,defaultValue:[]},deaccelerators:{name:Lg.deaccelerators,defaultValue:[]},evolution:{name:Lg.evolution},evolves:{name:Lg.evolves,defaultValue:[]},links:{name:Lg.links,defaultValue:[]},notes:{name:Lg.notes,defaultValue:[]},pipelines:{name:Lg.pipelines,defaultValue:[]},size:{name:Lg.size},title:{name:Lg.title}},superTypes:[]}}}static{$(this,`MermaidAstReflection`)}},Bg=new zg,Vg,Hg=$(()=>Vg??=bh(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`),`ArchitectureGrammarGrammar`),Ug,Wg=$(()=>Ug??=bh(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`),`GitGraphGrammarGrammar`),Gg,Kg=$(()=>Gg??=bh(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`InfoGrammarGrammar`),qg,Jg=$(()=>qg??=bh(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`PacketGrammarGrammar`),Yg,Xg=$(()=>Yg??=bh(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`PieGrammarGrammar`),Zg,Qg=$(()=>Zg??=bh(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`),`RadarGrammarGrammar`),$g,e_=$(()=>$g??=bh(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`),`TreemapGrammarGrammar`),t_,n_=$(()=>t_??=bh(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n * Converted from treemap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`),`TreeViewGrammarGrammar`),r_,i_=$(()=>r_??=bh(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \\\\t]+[A-Za-z(][A-Za-z0-9_()&]*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`WardleyGrammarGrammar`),a_={languageId:`architecture`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},o_={languageId:`gitGraph`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},s_={languageId:`info`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},c_={languageId:`packet`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},l_={languageId:`pie`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},u_={languageId:`radar`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},d_={languageId:`treemap`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},f_={languageId:`treeView`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},p_={languageId:`wardley`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},m_={AstReflection:$(()=>new zg,`AstReflection`)},h_={Grammar:$(()=>Hg(),`Grammar`),LanguageMetaData:$(()=>a_,`LanguageMetaData`),parser:{}},g_={Grammar:$(()=>Wg(),`Grammar`),LanguageMetaData:$(()=>o_,`LanguageMetaData`),parser:{}},__={Grammar:$(()=>Kg(),`Grammar`),LanguageMetaData:$(()=>s_,`LanguageMetaData`),parser:{}},v_={Grammar:$(()=>Jg(),`Grammar`),LanguageMetaData:$(()=>c_,`LanguageMetaData`),parser:{}},y_={Grammar:$(()=>Xg(),`Grammar`),LanguageMetaData:$(()=>l_,`LanguageMetaData`),parser:{}},b_={Grammar:$(()=>Qg(),`Grammar`),LanguageMetaData:$(()=>u_,`LanguageMetaData`),parser:{}},x_={Grammar:$(()=>e_(),`Grammar`),LanguageMetaData:$(()=>d_,`LanguageMetaData`),parser:{}},S_={Grammar:$(()=>n_(),`Grammar`),LanguageMetaData:$(()=>f_,`LanguageMetaData`),parser:{}},C_={Grammar:$(()=>i_(),`Grammar`),LanguageMetaData:$(()=>p_,`LanguageMetaData`),parser:{}},w_={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},T_=class extends np{static{o(this,`AbstractMermaidValueConverter`)}static{$(this,`AbstractMermaidValueConverter`)}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return r===void 0&&(r=this.runCustomConverter(e,t,n)),r===void 0?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){let r=w_[e.name];if(r===void 0)return;let i=r.exec(t);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm,` `);if(i[2]!==void 0)return i[2].replace(/^\s*/gm,``).replace(/\s+$/gm,``).replace(/[\t ]{2,}/gm,` `).replace(/[\n\r]{2,}/gm,`
|
||
`)}}},E_=class extends T_{static{o(this,`CommonValueConverter`)}static{$(this,`CommonValueConverter`)}runCustomConverter(e,t,n){}},D_=class extends tp{static{o(this,`AbstractMermaidTokenBuilder`)}static{$(this,`AbstractMermaidTokenBuilder`)}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){let r=super.buildKeywordTokens(e,t,n);return r.forEach(e=>{this.keywords.has(e.name)&&e.PATTERN!==void 0&&(e.PATTERN=RegExp(e.PATTERN.toString()+`(?:(?=%%)|(?!\\S))`))}),r}};(class extends D_{static{o(this,`CommonTokenBuilder`)}static{$(this,`CommonTokenBuilder`)}});export{E_ as _,eh as a,rh as c,y_ as d,v_ as f,D_ as g,g_ as h,x_ as i,h_ as l,__ as m,th as n,$ as o,T_ as p,S_ as r,gh as s,C_ as t,m_ as u,b_ as v}; |