@nowline/mcp 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities.d.ts +9 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +17 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/generated/resources.d.ts +2 -0
- package/dist/generated/resources.d.ts.map +1 -1
- package/dist/generated/resources.js +6 -1
- package/dist/generated/resources.js.map +1 -1
- package/dist/generated/ui-bundle.d.ts +3 -0
- package/dist/generated/ui-bundle.d.ts.map +1 -0
- package/dist/generated/ui-bundle.js +10 -0
- package/dist/generated/ui-bundle.js.map +1 -0
- package/dist/index.js +63 -12
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +3 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +143 -0
- package/dist/prompts.js.map +1 -0
- package/dist/schemas.d.ts +96 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +65 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +304 -41
- package/dist/server.js.map +1 -1
- package/dist/ui/entry.d.ts +2 -0
- package/dist/ui/entry.d.ts.map +1 -0
- package/dist/ui/entry.js +149 -0
- package/dist/ui/entry.js.map +1 -0
- package/package.json +11 -6
- package/src/capabilities.ts +25 -0
- package/src/generated/resources.ts +7 -1
- package/src/generated/ui-bundle.ts +10 -0
- package/src/index.ts +75 -13
- package/src/prompts.ts +172 -0
- package/src/schemas.ts +79 -0
- package/src/server.ts +406 -39
- package/src/ui/entry.ts +169 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED — do not edit. Re-run `pnpm --filter @nowline/mcp build` to regenerate.
|
|
2
|
+
//
|
|
3
|
+
// Source: packages/mcp/src/ui/entry.ts, bundled as a browser IIFE by
|
|
4
|
+
// packages/mcp/scripts/bundle-ui.mjs.
|
|
5
|
+
//
|
|
6
|
+
// Inlined into the text/html resource that `render` returns under the
|
|
7
|
+
// MCP Apps UI capability (specs/mcp.md § Optional MCP Apps UI variant).
|
|
8
|
+
/** Self-contained browser IIFE for the MCP Apps in-chat live preview. */
|
|
9
|
+
export const UI_BUNDLE = "\"use strict\";(()=>{var KC=Object.create;var Tc=Object.defineProperty;var ZC=Object.getOwnPropertyDescriptor;var JC=Object.getOwnPropertyNames;var QC=Object.getPrototypeOf,eP=Object.prototype.hasOwnProperty;var tP=(t,e,r)=>e in t?Tc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Pb=(t,e)=>()=>(t&&(e=t(t=0)),e);var ge=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rn=(t,e)=>{for(var r in e)Tc(t,r,{get:e[r],enumerable:!0})},ef=(t,e,r,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of JC(e))!eP.call(t,i)&&i!==r&&Tc(t,i,{get:()=>e[i],enumerable:!(n=ZC(e,i))||n.enumerable});return t},$e=(t,e,r)=>(ef(t,e,\"default\"),r&&ef(r,e,\"default\")),im=(t,e,r)=>(r=t!=null?KC(QC(t)):{},ef(e||!t||!t.__esModule?Tc(r,\"default\",{value:t,enumerable:!0}):r,t)),om=t=>ef(Tc({},\"__esModule\",{value:!0}),t);var xe=(t,e,r)=>tP(t,typeof e!=\"symbol\"?e+\"\":e,r);var Gd={};Rn(Gd,{AnnotatedTextEdit:()=>Xn,ChangeAnnotation:()=>Io,ChangeAnnotationIdentifier:()=>Ft,CodeAction:()=>by,CodeActionContext:()=>wy,CodeActionKind:()=>Ty,CodeActionTriggerKind:()=>Tl,CodeDescription:()=>Kg,CodeLens:()=>_y,Color:()=>Md,ColorInformation:()=>jg,ColorPresentation:()=>zg,Command:()=>So,CompletionItem:()=>ay,CompletionItemKind:()=>ty,CompletionItemLabelDetails:()=>sy,CompletionItemTag:()=>ny,CompletionList:()=>cy,CreateFile:()=>Qs,DeleteFile:()=>ta,Diagnostic:()=>ml,DiagnosticRelatedInformation:()=>$d,DiagnosticSeverity:()=>Vg,DiagnosticTag:()=>Yg,DocumentHighlight:()=>py,DocumentHighlightKind:()=>dy,DocumentLink:()=>vy,DocumentSymbol:()=>xy,DocumentUri:()=>Hg,EOL:()=>xF,FoldingRange:()=>qg,FoldingRangeKind:()=>Wg,FormattingOptions:()=>Ey,Hover:()=>ly,InlayHint:()=>Oy,InlayHintKind:()=>Hd,InlayHintLabelPart:()=>Xd,InlineCompletionContext:()=>Uy,InlineCompletionItem:()=>Dy,InlineCompletionList:()=>My,InlineCompletionTriggerKind:()=>$y,InlineValueContext:()=>Py,InlineValueEvaluatableExpression:()=>Cy,InlineValueText:()=>Sy,InlineValueVariableLookup:()=>Ny,InsertReplaceEdit:()=>iy,InsertTextFormat:()=>ry,InsertTextMode:()=>oy,Location:()=>hl,LocationLink:()=>Gg,MarkedString:()=>xl,MarkupContent:()=>ra,MarkupKind:()=>Bd,OptionalVersionedTextDocumentIdentifier:()=>yl,ParameterInformation:()=>uy,Position:()=>Be,Range:()=>Oe,RenameFile:()=>ea,SelectedCompletionInfo:()=>Fy,SelectionRange:()=>Ry,SemanticTokenModifiers:()=>ky,SemanticTokenTypes:()=>Ay,SemanticTokens:()=>Iy,SignatureInformation:()=>fy,StringValue:()=>Ly,SymbolInformation:()=>gy,SymbolKind:()=>hy,SymbolTag:()=>my,TextDocument:()=>Hy,TextDocumentEdit:()=>gl,TextDocumentIdentifier:()=>Jg,TextDocumentItem:()=>ey,TextEdit:()=>un,URI:()=>Dd,VersionedTextDocumentIdentifier:()=>Qg,WorkspaceChange:()=>Zg,WorkspaceEdit:()=>Fd,WorkspaceFolder:()=>By,WorkspaceSymbol:()=>yy,integer:()=>Xg,uinteger:()=>pl});var Hg,Dd,Xg,pl,Be,Oe,hl,Gg,Md,jg,zg,Wg,qg,$d,Vg,Yg,Kg,ml,So,un,Io,Ft,Xn,gl,Qs,ea,ta,Fd,Js,Ud,Zg,Jg,Qg,yl,ey,Bd,ra,ty,ry,ny,iy,oy,sy,ay,cy,xl,ly,uy,fy,dy,py,hy,my,gy,yy,xy,Ty,Tl,wy,by,_y,Ey,vy,Ry,Ay,ky,Iy,Sy,Ny,Cy,Py,Hd,Xd,Oy,Ly,Dy,My,$y,Fy,Uy,By,xF,Hy,Xy,v,na=Pb(()=>{\"use strict\";(function(t){function e(r){return typeof r==\"string\"}t.is=e})(Hg||(Hg={}));(function(t){function e(r){return typeof r==\"string\"}t.is=e})(Dd||(Dd={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r==\"number\"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Xg||(Xg={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r==\"number\"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(pl||(pl={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=pl.MAX_VALUE),i===Number.MAX_VALUE&&(i=pl.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=r})(Be||(Be={}));(function(t){function e(n,i,o,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(o)&&v.uinteger(s))return{start:Be.create(n,i),end:Be.create(o,s)};if(Be.is(n)&&Be.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${o}, ${s}]`)}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Be.is(i.start)&&Be.is(i.end)}t.is=r})(Oe||(Oe={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Oe.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(hl||(hl={}));(function(t){function e(n,i,o,s){return{targetUri:n,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Oe.is(i.targetRange)&&v.string(i.targetUri)&&Oe.is(i.targetSelectionRange)&&(Oe.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(Gg||(Gg={}));(function(t){function e(n,i,o,s){return{red:n,green:i,blue:o,alpha:s}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=r})(Md||(Md={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Oe.is(i.range)&&Md.is(i.color)}t.is=r})(jg||(jg={}));(function(t){function e(n,i,o){return{label:n,textEdit:i,additionalTextEdits:o}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||un.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,un.is))}t.is=r})(zg||(zg={}));(function(t){t.Comment=\"comment\",t.Imports=\"imports\",t.Region=\"region\"})(Wg||(Wg={}));(function(t){function e(n,i,o,s,a,c){let l={startLine:n,endLine:i};return v.defined(o)&&(l.startCharacter=o),v.defined(s)&&(l.endCharacter=s),v.defined(a)&&(l.kind=a),v.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=r})(qg||(qg={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&hl.is(i.location)&&v.string(i.message)}t.is=r})($d||($d={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Vg||(Vg={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(Yg||(Yg={}));(function(t){function e(r){let n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(Kg||(Kg={}));(function(t){function e(n,i,o,s,a,c){let l={range:n,message:i};return v.defined(o)&&(l.severity=o),v.defined(s)&&(l.code=s),v.defined(a)&&(l.source=a),v.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let o=n;return v.defined(o)&&Oe.is(o.range)&&v.string(o.message)&&(v.number(o.severity)||v.undefined(o.severity))&&(v.integer(o.code)||v.string(o.code)||v.undefined(o.code))&&(v.undefined(o.codeDescription)||v.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(o.source)||v.undefined(o.source))&&(v.undefined(o.relatedInformation)||v.typedArray(o.relatedInformation,$d.is))}t.is=r})(ml||(ml={}));(function(t){function e(n,i,...o){let s={title:n,command:i};return v.defined(o)&&o.length>0&&(s.arguments=o),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=r})(So||(So={}));(function(t){function e(o,s){return{range:o,newText:s}}t.replace=e;function r(o,s){return{range:{start:o,end:o},newText:s}}t.insert=r;function n(o){return{range:o,newText:\"\"}}t.del=n;function i(o){let s=o;return v.objectLiteral(s)&&v.string(s.newText)&&Oe.is(s.range)}t.is=i})(un||(un={}));(function(t){function e(n,i,o){let s={label:n};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=r})(Io||(Io={}));(function(t){function e(r){let n=r;return v.string(n)}t.is=e})(Ft||(Ft={}));(function(t){function e(o,s,a){return{range:o,newText:s,annotationId:a}}t.replace=e;function r(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}t.insert=r;function n(o,s){return{range:o,newText:\"\",annotationId:s}}t.del=n;function i(o){let s=o;return un.is(s)&&(Io.is(s.annotationId)||Ft.is(s.annotationId))}t.is=i})(Xn||(Xn={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&yl.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(gl||(gl={}));(function(t){function e(n,i,o){let s={kind:\"create\",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind===\"create\"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ft.is(i.annotationId))}t.is=r})(Qs||(Qs={}));(function(t){function e(n,i,o,s){let a={kind:\"rename\",oldUri:n,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind===\"rename\"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ft.is(i.annotationId))}t.is=r})(ea||(ea={}));(function(t){function e(n,i,o){let s={kind:\"delete\",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind===\"delete\"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Ft.is(i.annotationId))}t.is=r})(ta||(ta={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>v.string(i.kind)?Qs.is(i)||ea.is(i)||ta.is(i):gl.is(i)))}t.is=e})(Fd||(Fd={}));Js=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=un.insert(e,r):Ft.is(n)?(o=n,i=Xn.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=Xn.insert(e,r,o)),this.edits.push(i),o!==void 0)return o}replace(e,r,n){let i,o;if(n===void 0?i=un.replace(e,r):Ft.is(n)?(o=n,i=Xn.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=Xn.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=un.del(e):Ft.is(r)?(i=r,n=Xn.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=Xn.del(e,i)),this.edits.push(n),i!==void 0)return i}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 new Error(\"Text edit change is not configured to manage change annotations.\")}},Ud=class{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,r){let n;if(Ft.is(e)?n=e:(n=this.nextId(),r=e),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Zg=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ud(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(gl.is(r)){let n=new Js(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new Js(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}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(yl.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error(\"Workspace edit is not configured for document changes.\");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],o={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(o),n=new Js(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error(\"Workspace edit is not configured for normal text edit changes.\");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new Js(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ud,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,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error(\"Workspace edit is not configured for document changes.\");let i;Io.is(r)||Ft.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Qs.create(e,n):(s=Ft.is(i)?i:this._changeAnnotations.manage(i),o=Qs.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error(\"Workspace edit is not configured for document changes.\");let o;Io.is(n)||Ft.is(n)?o=n:i=n;let s,a;if(o===void 0?s=ea.create(e,r,i):(a=Ft.is(o)?o:this._changeAnnotations.manage(o),s=ea.create(e,r,i,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error(\"Workspace edit is not configured for document changes.\");let i;Io.is(r)||Ft.is(r)?i=r:n=r;let o,s;if(i===void 0?o=ta.create(e,n):(s=Ft.is(i)?i:this._changeAnnotations.manage(i),o=ta.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}};(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)}t.is=r})(Jg||(Jg={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=r})(Qg||(Qg={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=r})(yl||(yl={}));(function(t){function e(n,i,o,s){return{uri:n,languageId:i,version:o,text:s}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=r})(ey||(ey={}));(function(t){t.PlainText=\"plaintext\",t.Markdown=\"markdown\";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Bd||(Bd={}));(function(t){function e(r){let n=r;return v.objectLiteral(r)&&Bd.is(n.kind)&&v.string(n.value)}t.is=e})(ra||(ra={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(ty||(ty={}));(function(t){t.PlainText=1,t.Snippet=2})(ry||(ry={}));(function(t){t.Deprecated=1})(ny||(ny={}));(function(t){function e(n,i,o){return{newText:n,insert:i,replace:o}}t.create=e;function r(n){let i=n;return i&&v.string(i.newText)&&Oe.is(i.insert)&&Oe.is(i.replace)}t.is=r})(iy||(iy={}));(function(t){t.asIs=1,t.adjustIndentation=2})(oy||(oy={}));(function(t){function e(r){let n=r;return n&&(v.string(n.detail)||n.detail===void 0)&&(v.string(n.description)||n.description===void 0)}t.is=e})(sy||(sy={}));(function(t){function e(r){return{label:r}}t.create=e})(ay||(ay={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(cy||(cy={}));(function(t){function e(n){return n.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g,\"\\\\$&\")}t.fromPlainText=e;function r(n){let i=n;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=r})(xl||(xl={}));(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(ra.is(n.contents)||xl.is(n.contents)||v.typedArray(n.contents,xl.is))&&(r.range===void 0||Oe.is(r.range))}t.is=e})(ly||(ly={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(uy||(uy={}));(function(t){function e(r,n,...i){let o={label:r};return v.defined(n)&&(o.documentation=n),v.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(fy||(fy={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(dy||(dy={}));(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(py||(py={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(hy||(hy={}));(function(t){t.Deprecated=1})(my||(my={}));(function(t){function e(r,n,i,o,s){let a={name:r,kind:n,location:{uri:o,range:i}};return s&&(a.containerName=s),a}t.create=e})(gy||(gy={}));(function(t){function e(r,n,i,o){return o!==void 0?{name:r,kind:n,location:{uri:i,range:o}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(yy||(yy={}));(function(t){function e(n,i,o,s,a,c){let l={name:n,detail:i,kind:o,range:s,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&v.string(i.name)&&v.number(i.kind)&&Oe.is(i.range)&&Oe.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(xy||(xy={}));(function(t){t.Empty=\"\",t.QuickFix=\"quickfix\",t.Refactor=\"refactor\",t.RefactorExtract=\"refactor.extract\",t.RefactorInline=\"refactor.inline\",t.RefactorRewrite=\"refactor.rewrite\",t.Source=\"source\",t.SourceOrganizeImports=\"source.organizeImports\",t.SourceFixAll=\"source.fixAll\"})(Ty||(Ty={}));(function(t){t.Invoked=1,t.Automatic=2})(Tl||(Tl={}));(function(t){function e(n,i,o){let s={diagnostics:n};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.typedArray(i.diagnostics,ml.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Tl.Invoked||i.triggerKind===Tl.Automatic)}t.is=r})(wy||(wy={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i==\"string\"?(a=!1,s.kind=i):So.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,ml.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||So.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||Fd.is(i.edit))}t.is=r})(by||(by={}));(function(t){function e(n,i){let o={range:n};return v.defined(i)&&(o.data=i),o}t.create=e;function r(n){let i=n;return v.defined(i)&&Oe.is(i.range)&&(v.undefined(i.command)||So.is(i.command))}t.is=r})(_y||(_y={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=r})(Ey||(Ey={}));(function(t){function e(n,i,o){return{range:n,target:i,data:o}}t.create=e;function r(n){let i=n;return v.defined(i)&&Oe.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(vy||(vy={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Oe.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Ry||(Ry={}));(function(t){t.namespace=\"namespace\",t.type=\"type\",t.class=\"class\",t.enum=\"enum\",t.interface=\"interface\",t.struct=\"struct\",t.typeParameter=\"typeParameter\",t.parameter=\"parameter\",t.variable=\"variable\",t.property=\"property\",t.enumMember=\"enumMember\",t.event=\"event\",t.function=\"function\",t.method=\"method\",t.macro=\"macro\",t.keyword=\"keyword\",t.modifier=\"modifier\",t.comment=\"comment\",t.string=\"string\",t.number=\"number\",t.regexp=\"regexp\",t.operator=\"operator\",t.decorator=\"decorator\"})(Ay||(Ay={}));(function(t){t.declaration=\"declaration\",t.definition=\"definition\",t.readonly=\"readonly\",t.static=\"static\",t.deprecated=\"deprecated\",t.abstract=\"abstract\",t.async=\"async\",t.modification=\"modification\",t.documentation=\"documentation\",t.defaultLibrary=\"defaultLibrary\"})(ky||(ky={}));(function(t){function e(r){let n=r;return v.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId==\"string\")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]==\"number\")}t.is=e})(Iy||(Iy={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Oe.is(i.range)&&v.string(i.text)}t.is=r})(Sy||(Sy={}));(function(t){function e(n,i,o){return{range:n,variableName:i,caseSensitiveLookup:o}}t.create=e;function r(n){let i=n;return i!=null&&Oe.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(Ny||(Ny={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Oe.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Cy||(Cy={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Oe.is(n.stoppedLocation)}t.is=r})(Py||(Py={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Hd||(Hd={}));(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||ra.is(i.tooltip))&&(i.location===void 0||hl.is(i.location))&&(i.command===void 0||So.is(i.command))}t.is=r})(Xd||(Xd={}));(function(t){function e(n,i,o){let s={position:n,label:i};return o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Be.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,Xd.is))&&(i.kind===void 0||Hd.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,un.is)&&(i.tooltip===void 0||v.string(i.tooltip)||ra.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Oy||(Oy={}));(function(t){function e(r){return{kind:\"snippet\",value:r}}t.createSnippet=e})(Ly||(Ly={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(Dy||(Dy={}));(function(t){function e(r){return{items:r}}t.create=e})(My||(My={}));(function(t){t.Invoked=0,t.Automatic=1})($y||($y={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Fy||(Fy={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Uy||(Uy={}));(function(t){function e(r){let n=r;return v.objectLiteral(n)&&Dd.is(n.uri)&&v.string(n.name)}t.is=e})(By||(By={}));xF=[`\n`,`\\r\n`,\"\\r\"];(function(t){function e(o,s,a,c){return new Xy(o,s,a,c)}t.create=e;function r(o){let s=o;return!!(v.defined(s)&&v.string(s.uri)&&(v.undefined(s.languageId)||v.string(s.languageId))&&v.uinteger(s.lineCount)&&v.func(s.getText)&&v.func(s.positionAt)&&v.func(s.offsetAt))}t.is=r;function n(o,s){let a=o.getText(),c=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),l=a.length;for(let u=c.length-1;u>=0;u--){let f=c[u],d=o.offsetAt(f.range.start),p=o.offsetAt(f.range.end);if(p<=l)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error(\"Overlapping edit\");l=d}return a}t.applyEdits=n;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);i(c,s),i(l,s);let u=0,f=0,d=0;for(;u<c.length&&f<l.length;)s(c[u],l[f])<=0?o[d++]=c[u++]:o[d++]=l[f++];for(;u<c.length;)o[d++]=c[u++];for(;f<l.length;)o[d++]=l[f++];return o}})(Hy||(Hy={}));Xy=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let o=r.charAt(i);n=o===\"\\r\"||o===`\n`,o===\"\\r\"&&i+1<r.length&&r.charAt(i+1)===`\n`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Be.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return Be.create(o,e-r[o])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};(function(t){let e=Object.prototype.toString;function r(p){return typeof p<\"u\"}t.defined=r;function n(p){return typeof p>\"u\"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function o(p){return e.call(p)===\"[object String]\"}t.string=o;function s(p){return e.call(p)===\"[object Number]\"}t.number=s;function a(p,m,w){return e.call(p)===\"[object Number]\"&&m<=p&&p<=w}t.numberRange=a;function c(p){return e.call(p)===\"[object Number]\"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)===\"[object Number]\"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)===\"[object Function]\"}t.func=u;function f(p){return p!==null&&typeof p==\"object\"}t.objectLiteral=f;function d(p,m){return Array.isArray(p)&&p.every(m)}t.typedArray=d})(v||(v={}))});var Qy=ge(Jy=>{\"use strict\";Object.defineProperty(Jy,\"__esModule\",{value:!0});var Ky;function Zy(){if(Ky===void 0)throw new Error(\"No runtime abstraction layer installed\");return Ky}(function(t){function e(r){if(r===void 0)throw new Error(\"No runtime abstraction layer provided\");Ky=r}t.install=e})(Zy||(Zy={}));Jy.default=Zy});var L0=ge(Gt=>{\"use strict\";Object.defineProperty(Gt,\"__esModule\",{value:!0});Gt.stringArray=Gt.array=Gt.func=Gt.error=Gt.number=Gt.string=Gt.boolean=void 0;function NF(t){return t===!0||t===!1}Gt.boolean=NF;function P0(t){return typeof t==\"string\"||t instanceof String}Gt.string=P0;function CF(t){return typeof t==\"number\"||t instanceof Number}Gt.number=CF;function PF(t){return t instanceof Error}Gt.error=PF;function OF(t){return typeof t==\"function\"}Gt.func=OF;function O0(t){return Array.isArray(t)}Gt.array=O0;function LF(t){return O0(t)&&t.every(e=>P0(e))}Gt.stringArray=LF});var tx=ge(sa=>{\"use strict\";Object.defineProperty(sa,\"__esModule\",{value:!0});sa.Emitter=sa.Event=void 0;var DF=Qy(),D0;(function(t){let e={dispose(){}};t.None=function(){return e}})(D0||(sa.Event=D0={}));var ex=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error(\"When adding a listener with a context, you should remove it with the same context\")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,DF.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Vd=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new ex),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};sa.Emitter=Vd;Vd._noop=function(){}});var M0=ge(aa=>{\"use strict\";Object.defineProperty(aa,\"__esModule\",{value:!0});aa.CancellationTokenSource=aa.CancellationToken=void 0;var MF=Qy(),$F=L0(),rx=tx(),Yd;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:rx.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rx.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||$F.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Yd||(aa.CancellationToken=Yd={}));var FF=Object.freeze(function(t,e){let r=(0,MF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Kd=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?FF:(this._emitter||(this._emitter=new rx.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},nx=class{get token(){return this._token||(this._token=new Kd),this._token}cancel(){this._token?this._token.cancel():this._token=Yd.Cancelled}dispose(){this._token?this._token instanceof Kd&&this._token.dispose():this._token=Yd.None}};aa.CancellationTokenSource=nx});var ha=ge(zt=>{\"use strict\";Object.defineProperty(zt,\"__esModule\",{value:!0});zt.stringArray=zt.array=zt.func=zt.error=zt.number=zt.string=zt.boolean=void 0;function HF(t){return t===!0||t===!1}zt.boolean=HF;function V0(t){return typeof t==\"string\"||t instanceof String}zt.string=V0;function XF(t){return typeof t==\"number\"||t instanceof Number}zt.number=XF;function GF(t){return t instanceof Error}zt.error=GF;function jF(t){return typeof t==\"function\"}zt.func=jF;function Y0(t){return Array.isArray(t)}zt.array=Y0;function zF(t){return Y0(t)&&t.every(e=>V0(e))}zt.stringArray=zF});var Px=ge(se=>{\"use strict\";Object.defineProperty(se,\"__esModule\",{value:!0});se.Message=se.NotificationType9=se.NotificationType8=se.NotificationType7=se.NotificationType6=se.NotificationType5=se.NotificationType4=se.NotificationType3=se.NotificationType2=se.NotificationType1=se.NotificationType0=se.NotificationType=se.RequestType9=se.RequestType8=se.RequestType7=se.RequestType6=se.RequestType5=se.RequestType4=se.RequestType3=se.RequestType2=se.RequestType1=se.RequestType=se.RequestType0=se.AbstractMessageSignature=se.ParameterStructures=se.ResponseError=se.ErrorCodes=void 0;var Uo=ha(),cx;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(cx||(se.ErrorCodes=cx={}));var lx=class t extends Error{constructor(e,r,n){super(r),this.code=Uo.number(e)?e:cx.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};se.ResponseError=lx;var lr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};se.ParameterStructures=lr;lr.auto=new lr(\"auto\");lr.byPosition=new lr(\"byPosition\");lr.byName=new lr(\"byName\");var dt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return lr.auto}};se.AbstractMessageSignature=dt;var ux=class extends dt{constructor(e){super(e,0)}};se.RequestType0=ux;var fx=class extends dt{constructor(e,r=lr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.RequestType=fx;var dx=class extends dt{constructor(e,r=lr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.RequestType1=dx;var px=class extends dt{constructor(e){super(e,2)}};se.RequestType2=px;var hx=class extends dt{constructor(e){super(e,3)}};se.RequestType3=hx;var mx=class extends dt{constructor(e){super(e,4)}};se.RequestType4=mx;var gx=class extends dt{constructor(e){super(e,5)}};se.RequestType5=gx;var yx=class extends dt{constructor(e){super(e,6)}};se.RequestType6=yx;var xx=class extends dt{constructor(e){super(e,7)}};se.RequestType7=xx;var Tx=class extends dt{constructor(e){super(e,8)}};se.RequestType8=Tx;var wx=class extends dt{constructor(e){super(e,9)}};se.RequestType9=wx;var bx=class extends dt{constructor(e,r=lr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.NotificationType=bx;var _x=class extends dt{constructor(e){super(e,0)}};se.NotificationType0=_x;var Ex=class extends dt{constructor(e,r=lr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};se.NotificationType1=Ex;var vx=class extends dt{constructor(e){super(e,2)}};se.NotificationType2=vx;var Rx=class extends dt{constructor(e){super(e,3)}};se.NotificationType3=Rx;var Ax=class extends dt{constructor(e){super(e,4)}};se.NotificationType4=Ax;var kx=class extends dt{constructor(e){super(e,5)}};se.NotificationType5=kx;var Ix=class extends dt{constructor(e){super(e,6)}};se.NotificationType6=Ix;var Sx=class extends dt{constructor(e){super(e,7)}};se.NotificationType7=Sx;var Nx=class extends dt{constructor(e){super(e,8)}};se.NotificationType8=Nx;var Cx=class extends dt{constructor(e){super(e,9)}};se.NotificationType9=Cx;var K0;(function(t){function e(i){let o=i;return o&&Uo.string(o.method)&&(Uo.string(o.id)||Uo.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Uo.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Uo.string(o.id)||Uo.number(o.id)||o.id===null)}t.isResponse=n})(K0||(se.Message=K0={}))});var Lx=ge(Ni=>{\"use strict\";var Z0;Object.defineProperty(Ni,\"__esModule\",{value:!0});Ni.LRUCache=Ni.LinkedMap=Ni.Touch=void 0;var Wt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Wt||(Ni.Touch=Wt={}));var np=class{constructor(){this[Z0]=\"LinkedMap\",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Wt.None){let n=this._map.get(e);if(n)return r!==Wt.None&&this.touch(n,r),n.value}set(e,r,n=Wt.None){let i=this._map.get(e);if(i)i.value=r,n!==Wt.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Wt.None:this.addItemLast(i);break;case Wt.First:this.addItemFirst(i);break;case Wt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error(\"Invalid list\");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error(\"LinkedMap got modified during iteration.\");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Z0=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error(\"Invalid list\");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error(\"Invalid list\");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error(\"Invalid list\");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error(\"Invalid list\");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error(\"Invalid list\");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error(\"Invalid list\");if(!(r!==Wt.First&&r!==Wt.Last)){if(r===Wt.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Wt.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Ni.LinkedMap=np;var Ox=class extends np{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Wt.AsNew){return super.get(e,r)}peek(e){return super.get(e,Wt.None)}set(e,r){return super.set(e,r,Wt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ni.LRUCache=Ox});var Q0=ge(ip=>{\"use strict\";Object.defineProperty(ip,\"__esModule\",{value:!0});ip.Disposable=void 0;var J0;(function(t){function e(r){return{dispose:r}}t.create=e})(J0||(ip.Disposable=J0={}))});var Ci=ge($x=>{\"use strict\";Object.defineProperty($x,\"__esModule\",{value:!0});var Dx;function Mx(){if(Dx===void 0)throw new Error(\"No runtime abstraction layer installed\");return Dx}(function(t){function e(r){if(r===void 0)throw new Error(\"No runtime abstraction layer provided\");Dx=r}t.install=e})(Mx||(Mx={}));$x.default=Mx});var ga=ge(ma=>{\"use strict\";Object.defineProperty(ma,\"__esModule\",{value:!0});ma.Emitter=ma.Event=void 0;var WF=Ci(),eR;(function(t){let e={dispose(){}};t.None=function(){return e}})(eR||(ma.Event=eR={}));var Fx=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error(\"When adding a listener with a context, you should remove it with the same context\")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,WF.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},op=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Fx),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ma.Emitter=op;op._noop=function(){}});var cp=ge(ya=>{\"use strict\";Object.defineProperty(ya,\"__esModule\",{value:!0});ya.CancellationTokenSource=ya.CancellationToken=void 0;var qF=Ci(),VF=ha(),Ux=ga(),sp;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ux.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ux.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||VF.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(sp||(ya.CancellationToken=sp={}));var YF=Object.freeze(function(t,e){let r=(0,qF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),ap=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?YF:(this._emitter||(this._emitter=new Ux.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Bx=class{get token(){return this._token||(this._token=new ap),this._token}cancel(){this._token?this._token.cancel():this._token=sp.Cancelled}dispose(){this._token?this._token instanceof ap&&this._token.dispose():this._token=sp.None}};ya.CancellationTokenSource=Bx});var tR=ge(xa=>{\"use strict\";Object.defineProperty(xa,\"__esModule\",{value:!0});xa.SharedArrayReceiverStrategy=xa.SharedArraySenderStrategy=void 0;var KF=cp(),Gl;(function(t){t.Continue=0,t.Cancelled=1})(Gl||(Gl={}));var Hx=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Gl.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Gl.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};xa.SharedArraySenderStrategy=Hx;var Xx=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Gl.Cancelled}get onCancellationRequested(){throw new Error(\"Cancellation over SharedArrayBuffer doesn't support cancellation events\")}},Gx=class{constructor(e){this.token=new Xx(e)}cancel(){}dispose(){}},jx=class{constructor(){this.kind=\"request\"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new KF.CancellationTokenSource:new Gx(r)}};xa.SharedArrayReceiverStrategy=jx});var Wx=ge(lp=>{\"use strict\";Object.defineProperty(lp,\"__esModule\",{value:!0});lp.Semaphore=void 0;var ZF=Ci(),zx=class{constructor(e=1){if(e<=0)throw new Error(\"Capacity must be greater than 0\");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ZF.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error(\"To many thunks active\");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};lp.Semaphore=zx});var nR=ge(Pi=>{\"use strict\";Object.defineProperty(Pi,\"__esModule\",{value:!0});Pi.ReadableStreamMessageReader=Pi.AbstractMessageReader=Pi.MessageReader=void 0;var Vx=Ci(),Ta=ha(),qx=ga(),JF=Wx(),rR;(function(t){function e(r){let n=r;return n&&Ta.func(n.listen)&&Ta.func(n.dispose)&&Ta.func(n.onError)&&Ta.func(n.onClose)&&Ta.func(n.onPartialMessage)}t.is=e})(rR||(Pi.MessageReader=rR={}));var up=class{constructor(){this.errorEmitter=new qx.Emitter,this.closeEmitter=new qx.Emitter,this.partialMessageEmitter=new qx.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Ta.string(e.message)?e.message:\"unknown\"}`)}};Pi.AbstractMessageReader=up;var Yx;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r==\"string\")n=r??\"utf-8\";else{if(n=r.charset??\"utf-8\",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)s.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Vx.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Yx||(Yx={}));var Kx=class extends up{constructor(e,r){super(),this.readable=e,this.options=Yx.fromOptions(r),this.buffer=(0,Vx.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new JF.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get(\"content-length\");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(n))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Vx.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Pi.ReadableStreamMessageReader=Kx});var cR=ge(Oi=>{\"use strict\";Object.defineProperty(Oi,\"__esModule\",{value:!0});Oi.WriteableStreamMessageWriter=Oi.AbstractMessageWriter=Oi.MessageWriter=void 0;var iR=Ci(),jl=ha(),QF=Wx(),oR=ga(),eU=\"Content-Length: \",sR=`\\r\n`,aR;(function(t){function e(r){let n=r;return n&&jl.func(n.dispose)&&jl.func(n.onClose)&&jl.func(n.onError)&&jl.func(n.write)}t.is=e})(aR||(Oi.MessageWriter=aR={}));var fp=class{constructor(){this.errorEmitter=new oR.Emitter,this.closeEmitter=new oR.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${jl.string(e.message)?e.message:\"unknown\"}`)}};Oi.AbstractMessageWriter=fp;var Zx;(function(t){function e(r){return r===void 0||typeof r==\"string\"?{charset:r??\"utf-8\",contentTypeEncoder:(0,iR.default)().applicationJson.encoder}:{charset:r.charset??\"utf-8\",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,iR.default)().applicationJson.encoder}}t.fromOptions=e})(Zx||(Zx={}));var Jx=class extends fp{constructor(e,r){super(),this.writable=e,this.options=Zx.fromOptions(r),this.errorCount=0,this.writeSemaphore=new QF.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(eU,n.byteLength.toString(),sR),i.push(sR),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(\"\"),\"ascii\"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Oi.WriteableStreamMessageWriter=Jx});var lR=ge(dp=>{\"use strict\";Object.defineProperty(dp,\"__esModule\",{value:!0});dp.AbstractMessageBuffer=void 0;var tU=13,rU=10,nU=`\\r\n`,Qx=class{constructor(e=\"utf-8\"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e==\"string\"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case tU:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case rU:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}o+=l.byteLength,n++}if(r!==4)return;let s=this._read(o+i),a=new Map,c=this.toString(s,\"ascii\").split(nU);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],f=u.indexOf(\":\");if(f===-1)throw new Error(`Message header must separate key and value using ':'\n${u}`);let d=u.substr(0,f),p=u.substr(f+1).trim();a.set(e?d.toLowerCase():d,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error(\"Cannot read so many bytes!\");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};dp.AbstractMessageBuffer=Qx});var hR=ge(be=>{\"use strict\";Object.defineProperty(be,\"__esModule\",{value:!0});be.createMessageConnection=be.ConnectionOptions=be.MessageStrategy=be.CancellationStrategy=be.CancellationSenderStrategy=be.CancellationReceiverStrategy=be.RequestCancellationReceiverStrategy=be.IdCancellationReceiverStrategy=be.ConnectionStrategy=be.ConnectionError=be.ConnectionErrors=be.LogTraceNotification=be.SetTraceNotification=be.TraceFormat=be.TraceValues=be.Trace=be.NullLogger=be.ProgressType=be.ProgressToken=void 0;var uR=Ci(),bt=ha(),de=Px(),fR=Lx(),zl=ga(),eT=cp(),Vl;(function(t){t.type=new de.NotificationType(\"$/cancelRequest\")})(Vl||(Vl={}));var tT;(function(t){function e(r){return typeof r==\"string\"||typeof r==\"number\"}t.is=e})(tT||(be.ProgressToken=tT={}));var Wl;(function(t){t.type=new de.NotificationType(\"$/progress\")})(Wl||(Wl={}));var rT=class{constructor(){}};be.ProgressType=rT;var nT;(function(t){function e(r){return bt.func(r)}t.is=e})(nT||(nT={}));be.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ve;(function(t){t[t.Off=0]=\"Off\",t[t.Messages=1]=\"Messages\",t[t.Compact=2]=\"Compact\",t[t.Verbose=3]=\"Verbose\"})(Ve||(be.Trace=Ve={}));var dR;(function(t){t.Off=\"off\",t.Messages=\"messages\",t.Compact=\"compact\",t.Verbose=\"verbose\"})(dR||(be.TraceValues=dR={}));(function(t){function e(n){if(!bt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case\"off\":return t.Off;case\"messages\":return t.Messages;case\"compact\":return t.Compact;case\"verbose\":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return\"off\";case t.Messages:return\"messages\";case t.Compact:return\"compact\";case t.Verbose:return\"verbose\";default:return\"off\"}}t.toString=r})(Ve||(be.Trace=Ve={}));var wr;(function(t){t.Text=\"text\",t.JSON=\"json\"})(wr||(be.TraceFormat=wr={}));(function(t){function e(r){return bt.string(r)?(r=r.toLowerCase(),r===\"json\"?t.JSON:t.Text):t.Text}t.fromString=e})(wr||(be.TraceFormat=wr={}));var iT;(function(t){t.type=new de.NotificationType(\"$/setTrace\")})(iT||(be.SetTraceNotification=iT={}));var pp;(function(t){t.type=new de.NotificationType(\"$/logTrace\")})(pp||(be.LogTraceNotification=pp={}));var ql;(function(t){t[t.Closed=1]=\"Closed\",t[t.Disposed=2]=\"Disposed\",t[t.AlreadyListening=3]=\"AlreadyListening\"})(ql||(be.ConnectionErrors=ql={}));var wa=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};be.ConnectionError=wa;var oT;(function(t){function e(r){let n=r;return n&&bt.func(n.cancelUndispatched)}t.is=e})(oT||(be.ConnectionStrategy=oT={}));var hp;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind===\"id\")&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(hp||(be.IdCancellationReceiverStrategy=hp={}));var sT;(function(t){function e(r){let n=r;return n&&n.kind===\"request\"&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(sT||(be.RequestCancellationReceiverStrategy=sT={}));var mp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new eT.CancellationTokenSource}});function e(r){return hp.is(r)||sT.is(r)}t.is=e})(mp||(be.CancellationReceiverStrategy=mp={}));var gp;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Vl.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&bt.func(n.sendCancellation)&&bt.func(n.cleanup)}t.is=e})(gp||(be.CancellationSenderStrategy=gp={}));var yp;(function(t){t.Message=Object.freeze({receiver:mp.Message,sender:gp.Message});function e(r){let n=r;return n&&mp.is(n.receiver)&&gp.is(n.sender)}t.is=e})(yp||(be.CancellationStrategy=yp={}));var xp;(function(t){function e(r){let n=r;return n&&bt.func(n.handleMessage)}t.is=e})(xp||(be.MessageStrategy=xp={}));var pR;(function(t){function e(r){let n=r;return n&&(yp.is(n.cancellationStrategy)||oT.is(n.connectionStrategy)||xp.is(n.messageStrategy))}t.is=e})(pR||(be.ConnectionOptions=pR={}));var jr;(function(t){t[t.New=1]=\"New\",t[t.Listening=2]=\"Listening\",t[t.Closed=3]=\"Closed\",t[t.Disposed=4]=\"Disposed\"})(jr||(jr={}));function iU(t,e,r,n){let i=r!==void 0?r:be.NullLogger,o=0,s=0,a=0,c=\"2.0\",l,u=new Map,f,d=new Map,p=new Map,m,w=new fR.LinkedMap,T=new Map,_=new Set,E=new Map,b=Ve.Off,N=wr.Text,F,L=jr.New,j=new zl.Emitter,te=new zl.Emitter,oe=new zl.Emitter,Ce=new zl.Emitter,M=new zl.Emitter,R=n&&n.cancellationStrategy?n.cancellationStrategy:yp.Message;function D(g){if(g===null)throw new Error(\"Can't send requests with id null since the response can't be correlated.\");return\"req-\"+g.toString()}function X(g){return g===null?\"res-unknown-\"+(++a).toString():\"res-\"+g.toString()}function A(){return\"not-\"+(++s).toString()}function I(g,k){de.Message.isRequest(k)?g.set(D(k.id),k):de.Message.isResponse(k)?g.set(X(k.id),k):g.set(A(),k)}function S(g){}function G(){return L===jr.Listening}function V(){return L===jr.Closed}function B(){return L===jr.Disposed}function K(){(L===jr.New||L===jr.Listening)&&(L=jr.Closed,te.fire(void 0))}function Q(g){j.fire([g,void 0,void 0])}function _e(g){j.fire(g)}t.onClose(K),t.onError(Q),e.onClose(K),e.onError(_e);function J(){m||w.size===0||(m=(0,uR.default)().timer.setImmediate(()=>{m=void 0,nt()}))}function ye(g){de.Message.isRequest(g)?We(g):de.Message.isNotification(g)?ne(g):de.Message.isResponse(g)?z(g):ae(g)}function nt(){if(w.size===0)return;let g=w.shift();try{let k=n?.messageStrategy;xp.is(k)?k.handleMessage(g,ye):ye(g)}finally{J()}}let Le=g=>{try{if(de.Message.isNotification(g)&&g.method===Vl.type.method){let k=g.params.id,$=D(k),Y=w.get($);if(de.Message.isRequest(Y)){let Ie=n?.connectionStrategy,Pe=Ie&&Ie.cancelUndispatched?Ie.cancelUndispatched(Y,S):void 0;if(Pe&&(Pe.error!==void 0||Pe.result!==void 0)){w.delete($),E.delete(k),Pe.id=Y.id,ke(Pe,g.method,Date.now()),e.write(Pe).catch(()=>i.error(\"Sending response for canceled message failed.\"));return}}let Ee=E.get(k);if(Ee!==void 0){Ee.cancel(),H(g);return}else _.add(k)}I(w,g)}finally{J()}};function We(g){if(B())return;function k(Te,pe,we){let Ue={jsonrpc:c,id:g.id};Te instanceof de.ResponseError?Ue.error=Te.toJson():Ue.result=Te===void 0?null:Te,ke(Ue,pe,we),e.write(Ue).catch(()=>i.error(\"Sending response failed.\"))}function $(Te,pe,we){let Ue={jsonrpc:c,id:g.id,error:Te.toJson()};ke(Ue,pe,we),e.write(Ue).catch(()=>i.error(\"Sending response failed.\"))}function Y(Te,pe,we){Te===void 0&&(Te=null);let Ue={jsonrpc:c,id:g.id,result:Te};ke(Ue,pe,we),e.write(Ue).catch(()=>i.error(\"Sending response failed.\"))}Ze(g);let Ee=u.get(g.method),Ie,Pe;Ee&&(Ie=Ee.type,Pe=Ee.handler);let qe=Date.now();if(Pe||l){let Te=g.id??String(Date.now()),pe=hp.is(R.receiver)?R.receiver.createCancellationTokenSource(Te):R.receiver.createCancellationTokenSource(g);g.id!==null&&_.has(g.id)&&pe.cancel(),g.id!==null&&E.set(Te,pe);try{let we;if(Pe)if(g.params===void 0){if(Ie!==void 0&&Ie.numberOfParams!==0){$(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${g.method} defines ${Ie.numberOfParams} params but received none.`),g.method,qe);return}we=Pe(pe.token)}else if(Array.isArray(g.params)){if(Ie!==void 0&&Ie.parameterStructures===de.ParameterStructures.byName){$(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by name but received parameters by position`),g.method,qe);return}we=Pe(...g.params,pe.token)}else{if(Ie!==void 0&&Ie.parameterStructures===de.ParameterStructures.byPosition){$(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by position but received parameters by name`),g.method,qe);return}we=Pe(g.params,pe.token)}else l&&(we=l(g.method,g.params,pe.token));let Ue=we;we?Ue.then?Ue.then(it=>{E.delete(Te),k(it,g.method,qe)},it=>{E.delete(Te),it instanceof de.ResponseError?$(it,g.method,qe):it&&bt.string(it.message)?$(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${it.message}`),g.method,qe):$(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,qe)}):(E.delete(Te),k(we,g.method,qe)):(E.delete(Te),Y(we,g.method,qe))}catch(we){E.delete(Te),we instanceof de.ResponseError?k(we,g.method,qe):we&&bt.string(we.message)?$(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${we.message}`),g.method,qe):$(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,qe)}}else $(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${g.method}`),g.method,qe)}function z(g){if(!B())if(g.id===null)g.error?i.error(`Received response message without id: Error is: \n${JSON.stringify(g.error,void 0,4)}`):i.error(\"Received response message without id. No further error information provided.\");else{let k=g.id,$=T.get(k);if(Vt(g,$),$!==void 0){T.delete(k);try{if(g.error){let Y=g.error;$.reject(new de.ResponseError(Y.code,Y.message,Y.data))}else if(g.result!==void 0)$.resolve(g.result);else throw new Error(\"Should never happen.\")}catch(Y){Y.message?i.error(`Response handler '${$.method}' failed with message: ${Y.message}`):i.error(`Response handler '${$.method}' failed unexpectedly.`)}}}}function ne(g){if(B())return;let k,$;if(g.method===Vl.type.method){let Y=g.params.id;_.delete(Y),H(g);return}else{let Y=d.get(g.method);Y&&($=Y.handler,k=Y.type)}if($||f)try{if(H(g),$)if(g.params===void 0)k!==void 0&&k.numberOfParams!==0&&k.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${g.method} defines ${k.numberOfParams} params but received none.`),$();else if(Array.isArray(g.params)){let Y=g.params;g.method===Wl.type.method&&Y.length===2&&tT.is(Y[0])?$({token:Y[0],value:Y[1]}):(k!==void 0&&(k.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${g.method} defines parameters by name but received parameters by position`),k.numberOfParams!==g.params.length&&i.error(`Notification ${g.method} defines ${k.numberOfParams} params but received ${Y.length} arguments`)),$(...Y))}else k!==void 0&&k.parameterStructures===de.ParameterStructures.byPosition&&i.error(`Notification ${g.method} defines parameters by position but received parameters by name`),$(g.params);else f&&f(g.method,g.params)}catch(Y){Y.message?i.error(`Notification handler '${g.method}' failed with message: ${Y.message}`):i.error(`Notification handler '${g.method}' failed unexpectedly.`)}else oe.fire(g)}function ae(g){if(!g){i.error(\"Received empty message.\");return}i.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(g,null,4)}`);let k=g;if(bt.string(k.id)||bt.number(k.id)){let $=k.id,Y=T.get($);Y&&Y.reject(new Error(\"The received response has neither a result nor an error property.\"))}}function O(g){if(g!=null)switch(b){case Ve.Verbose:return JSON.stringify(g,null,4);case Ve.Compact:return JSON.stringify(g);default:return}}function Fe(g){if(!(b===Ve.Off||!F))if(N===wr.Text){let k;(b===Ve.Verbose||b===Ve.Compact)&&g.params&&(k=`Params: ${O(g.params)}\n\n`),F.log(`Sending request '${g.method} - (${g.id})'.`,k)}else Bt(\"send-request\",g)}function ve(g){if(!(b===Ve.Off||!F))if(N===wr.Text){let k;(b===Ve.Verbose||b===Ve.Compact)&&(g.params?k=`Params: ${O(g.params)}\n\n`:k=`No parameters provided.\n\n`),F.log(`Sending notification '${g.method}'.`,k)}else Bt(\"send-notification\",g)}function ke(g,k,$){if(!(b===Ve.Off||!F))if(N===wr.Text){let Y;(b===Ve.Verbose||b===Ve.Compact)&&(g.error&&g.error.data?Y=`Error data: ${O(g.error.data)}\n\n`:g.result?Y=`Result: ${O(g.result)}\n\n`:g.error===void 0&&(Y=`No result returned.\n\n`)),F.log(`Sending response '${k} - (${g.id})'. Processing request took ${Date.now()-$}ms`,Y)}else Bt(\"send-response\",g)}function Ze(g){if(!(b===Ve.Off||!F))if(N===wr.Text){let k;(b===Ve.Verbose||b===Ve.Compact)&&g.params&&(k=`Params: ${O(g.params)}\n\n`),F.log(`Received request '${g.method} - (${g.id})'.`,k)}else Bt(\"receive-request\",g)}function H(g){if(!(b===Ve.Off||!F||g.method===pp.type.method))if(N===wr.Text){let k;(b===Ve.Verbose||b===Ve.Compact)&&(g.params?k=`Params: ${O(g.params)}\n\n`:k=`No parameters provided.\n\n`),F.log(`Received notification '${g.method}'.`,k)}else Bt(\"receive-notification\",g)}function Vt(g,k){if(!(b===Ve.Off||!F))if(N===wr.Text){let $;if((b===Ve.Verbose||b===Ve.Compact)&&(g.error&&g.error.data?$=`Error data: ${O(g.error.data)}\n\n`:g.result?$=`Result: ${O(g.result)}\n\n`:g.error===void 0&&($=`No result returned.\n\n`)),k){let Y=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:\"\";F.log(`Received response '${k.method} - (${g.id})' in ${Date.now()-k.timerStart}ms.${Y}`,$)}else F.log(`Received response ${g.id} without active response promise.`,$)}else Bt(\"receive-response\",g)}function Bt(g,k){if(!F||b===Ve.Off)return;let $={isLSPMessage:!0,type:g,message:k,timestamp:Date.now()};F.log($)}function nr(){if(V())throw new wa(ql.Closed,\"Connection is closed.\");if(B())throw new wa(ql.Disposed,\"Connection is disposed.\")}function en(){if(G())throw new wa(ql.AlreadyListening,\"Connection is already listening\")}function Re(){if(!G())throw new Error(\"Call listen() first.\")}function x(g){return g===void 0?null:g}function C(g){if(g!==null)return g}function U(g){return g!=null&&!Array.isArray(g)&&typeof g==\"object\"}function Z(g,k){switch(g){case de.ParameterStructures.auto:return U(k)?C(k):[x(k)];case de.ParameterStructures.byName:if(!U(k))throw new Error(\"Received parameters by name but param is not an object literal.\");return C(k);case de.ParameterStructures.byPosition:return[x(k)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}function re(g,k){let $,Y=g.numberOfParams;switch(Y){case 0:$=void 0;break;case 1:$=Z(g.parameterStructures,k[0]);break;default:$=[];for(let Ee=0;Ee<k.length&&Ee<Y;Ee++)$.push(x(k[Ee]));if(k.length<Y)for(let Ee=k.length;Ee<Y;Ee++)$.push(null);break}return $}let q={sendNotification:(g,...k)=>{nr();let $,Y;if(bt.string(g)){$=g;let Ie=k[0],Pe=0,qe=de.ParameterStructures.auto;de.ParameterStructures.is(Ie)&&(Pe=1,qe=Ie);let Te=k.length,pe=Te-Pe;switch(pe){case 0:Y=void 0;break;case 1:Y=Z(qe,k[Pe]);break;default:if(qe===de.ParameterStructures.byName)throw new Error(`Received ${pe} parameters for 'by Name' notification parameter structure.`);Y=k.slice(Pe,Te).map(we=>x(we));break}}else{let Ie=k;$=g.method,Y=re(g,Ie)}let Ee={jsonrpc:c,method:$,params:Y};return ve(Ee),e.write(Ee).catch(Ie=>{throw i.error(\"Sending notification failed.\"),Ie})},onNotification:(g,k)=>{nr();let $;return bt.func(g)?f=g:k&&(bt.string(g)?($=g,d.set(g,{type:void 0,handler:k})):($=g.method,d.set(g.method,{type:g,handler:k}))),{dispose:()=>{$!==void 0?d.delete($):f=void 0}}},onProgress:(g,k,$)=>{if(p.has(k))throw new Error(`Progress handler for token ${k} already registered`);return p.set(k,$),{dispose:()=>{p.delete(k)}}},sendProgress:(g,k,$)=>q.sendNotification(Wl.type,{token:k,value:$}),onUnhandledProgress:Ce.event,sendRequest:(g,...k)=>{nr(),Re();let $,Y,Ee;if(bt.string(g)){$=g;let Te=k[0],pe=k[k.length-1],we=0,Ue=de.ParameterStructures.auto;de.ParameterStructures.is(Te)&&(we=1,Ue=Te);let it=k.length;eT.CancellationToken.is(pe)&&(it=it-1,Ee=pe);let ir=it-we;switch(ir){case 0:Y=void 0;break;case 1:Y=Z(Ue,k[we]);break;default:if(Ue===de.ParameterStructures.byName)throw new Error(`Received ${ir} parameters for 'by Name' request parameter structure.`);Y=k.slice(we,it).map(ss=>x(ss));break}}else{let Te=k;$=g.method,Y=re(g,Te);let pe=g.numberOfParams;Ee=eT.CancellationToken.is(Te[pe])?Te[pe]:void 0}let Ie=o++,Pe;Ee&&(Pe=Ee.onCancellationRequested(()=>{let Te=R.sender.sendCancellation(q,Ie);return Te===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ie}`),Promise.resolve()):Te.catch(()=>{i.log(`Sending cancellation messages for id ${Ie} failed`)})}));let qe={jsonrpc:c,id:Ie,method:$,params:Y};return Fe(qe),typeof R.sender.enableCancellation==\"function\"&&R.sender.enableCancellation(qe),new Promise(async(Te,pe)=>{let we=ir=>{Te(ir),R.sender.cleanup(Ie),Pe?.dispose()},Ue=ir=>{pe(ir),R.sender.cleanup(Ie),Pe?.dispose()},it={method:$,timerStart:Date.now(),resolve:we,reject:Ue};try{await e.write(qe),T.set(Ie,it)}catch(ir){throw i.error(\"Sending request failed.\"),it.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,ir.message?ir.message:\"Unknown reason\")),ir}})},onRequest:(g,k)=>{nr();let $=null;return nT.is(g)?($=void 0,l=g):bt.string(g)?($=null,k!==void 0&&($=g,u.set(g,{handler:k,type:void 0}))):k!==void 0&&($=g.method,u.set(g.method,{type:g,handler:k})),{dispose:()=>{$!==null&&($!==void 0?u.delete($):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(g,k,$)=>{let Y=!1,Ee=wr.Text;$!==void 0&&(bt.boolean($)?Y=$:(Y=$.sendNotification||!1,Ee=$.traceFormat||wr.Text)),b=g,N=Ee,b===Ve.Off?F=void 0:F=k,Y&&!V()&&!B()&&await q.sendNotification(iT.type,{value:Ve.toString(g)})},onError:j.event,onClose:te.event,onUnhandledNotification:oe.event,onDispose:M.event,end:()=>{e.end()},dispose:()=>{if(B())return;L=jr.Disposed,M.fire(void 0);let g=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,\"Pending response rejected since connection got disposed\");for(let k of T.values())k.reject(g);T=new Map,E=new Map,_=new Set,w=new fR.LinkedMap,bt.func(e.dispose)&&e.dispose(),bt.func(t.dispose)&&t.dispose()},listen:()=>{nr(),en(),L=jr.Listening,t.listen(Le)},inspect:()=>{(0,uR.default)().console.log(\"inspect\")}};return q.onNotification(pp.type,g=>{if(b===Ve.Off||!F)return;let k=b===Ve.Verbose||b===Ve.Compact;F.log(g.message,k?g.verbose:void 0)}),q.onNotification(Wl.type,g=>{let k=p.get(g.token);k?k(g.value):Ce.fire(g)}),q}be.createMessageConnection=iU});var Tp=ge(P=>{\"use strict\";Object.defineProperty(P,\"__esModule\",{value:!0});P.ProgressType=P.ProgressToken=P.createMessageConnection=P.NullLogger=P.ConnectionOptions=P.ConnectionStrategy=P.AbstractMessageBuffer=P.WriteableStreamMessageWriter=P.AbstractMessageWriter=P.MessageWriter=P.ReadableStreamMessageReader=P.AbstractMessageReader=P.MessageReader=P.SharedArrayReceiverStrategy=P.SharedArraySenderStrategy=P.CancellationToken=P.CancellationTokenSource=P.Emitter=P.Event=P.Disposable=P.LRUCache=P.Touch=P.LinkedMap=P.ParameterStructures=P.NotificationType9=P.NotificationType8=P.NotificationType7=P.NotificationType6=P.NotificationType5=P.NotificationType4=P.NotificationType3=P.NotificationType2=P.NotificationType1=P.NotificationType0=P.NotificationType=P.ErrorCodes=P.ResponseError=P.RequestType9=P.RequestType8=P.RequestType7=P.RequestType6=P.RequestType5=P.RequestType4=P.RequestType3=P.RequestType2=P.RequestType1=P.RequestType0=P.RequestType=P.Message=P.RAL=void 0;P.MessageStrategy=P.CancellationStrategy=P.CancellationSenderStrategy=P.CancellationReceiverStrategy=P.ConnectionError=P.ConnectionErrors=P.LogTraceNotification=P.SetTraceNotification=P.TraceFormat=P.TraceValues=P.Trace=void 0;var ct=Px();Object.defineProperty(P,\"Message\",{enumerable:!0,get:function(){return ct.Message}});Object.defineProperty(P,\"RequestType\",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(P,\"RequestType0\",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(P,\"RequestType1\",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(P,\"RequestType2\",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(P,\"RequestType3\",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(P,\"RequestType4\",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(P,\"RequestType5\",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(P,\"RequestType6\",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(P,\"RequestType7\",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(P,\"RequestType8\",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(P,\"RequestType9\",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(P,\"ResponseError\",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(P,\"ErrorCodes\",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(P,\"NotificationType\",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(P,\"NotificationType0\",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(P,\"NotificationType1\",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(P,\"NotificationType2\",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(P,\"NotificationType3\",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(P,\"NotificationType4\",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(P,\"NotificationType5\",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(P,\"NotificationType6\",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(P,\"NotificationType7\",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(P,\"NotificationType8\",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(P,\"NotificationType9\",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(P,\"ParameterStructures\",{enumerable:!0,get:function(){return ct.ParameterStructures}});var aT=Lx();Object.defineProperty(P,\"LinkedMap\",{enumerable:!0,get:function(){return aT.LinkedMap}});Object.defineProperty(P,\"LRUCache\",{enumerable:!0,get:function(){return aT.LRUCache}});Object.defineProperty(P,\"Touch\",{enumerable:!0,get:function(){return aT.Touch}});var oU=Q0();Object.defineProperty(P,\"Disposable\",{enumerable:!0,get:function(){return oU.Disposable}});var mR=ga();Object.defineProperty(P,\"Event\",{enumerable:!0,get:function(){return mR.Event}});Object.defineProperty(P,\"Emitter\",{enumerable:!0,get:function(){return mR.Emitter}});var gR=cp();Object.defineProperty(P,\"CancellationTokenSource\",{enumerable:!0,get:function(){return gR.CancellationTokenSource}});Object.defineProperty(P,\"CancellationToken\",{enumerable:!0,get:function(){return gR.CancellationToken}});var yR=tR();Object.defineProperty(P,\"SharedArraySenderStrategy\",{enumerable:!0,get:function(){return yR.SharedArraySenderStrategy}});Object.defineProperty(P,\"SharedArrayReceiverStrategy\",{enumerable:!0,get:function(){return yR.SharedArrayReceiverStrategy}});var cT=nR();Object.defineProperty(P,\"MessageReader\",{enumerable:!0,get:function(){return cT.MessageReader}});Object.defineProperty(P,\"AbstractMessageReader\",{enumerable:!0,get:function(){return cT.AbstractMessageReader}});Object.defineProperty(P,\"ReadableStreamMessageReader\",{enumerable:!0,get:function(){return cT.ReadableStreamMessageReader}});var lT=cR();Object.defineProperty(P,\"MessageWriter\",{enumerable:!0,get:function(){return lT.MessageWriter}});Object.defineProperty(P,\"AbstractMessageWriter\",{enumerable:!0,get:function(){return lT.AbstractMessageWriter}});Object.defineProperty(P,\"WriteableStreamMessageWriter\",{enumerable:!0,get:function(){return lT.WriteableStreamMessageWriter}});var sU=lR();Object.defineProperty(P,\"AbstractMessageBuffer\",{enumerable:!0,get:function(){return sU.AbstractMessageBuffer}});var Ut=hR();Object.defineProperty(P,\"ConnectionStrategy\",{enumerable:!0,get:function(){return Ut.ConnectionStrategy}});Object.defineProperty(P,\"ConnectionOptions\",{enumerable:!0,get:function(){return Ut.ConnectionOptions}});Object.defineProperty(P,\"NullLogger\",{enumerable:!0,get:function(){return Ut.NullLogger}});Object.defineProperty(P,\"createMessageConnection\",{enumerable:!0,get:function(){return Ut.createMessageConnection}});Object.defineProperty(P,\"ProgressToken\",{enumerable:!0,get:function(){return Ut.ProgressToken}});Object.defineProperty(P,\"ProgressType\",{enumerable:!0,get:function(){return Ut.ProgressType}});Object.defineProperty(P,\"Trace\",{enumerable:!0,get:function(){return Ut.Trace}});Object.defineProperty(P,\"TraceValues\",{enumerable:!0,get:function(){return Ut.TraceValues}});Object.defineProperty(P,\"TraceFormat\",{enumerable:!0,get:function(){return Ut.TraceFormat}});Object.defineProperty(P,\"SetTraceNotification\",{enumerable:!0,get:function(){return Ut.SetTraceNotification}});Object.defineProperty(P,\"LogTraceNotification\",{enumerable:!0,get:function(){return Ut.LogTraceNotification}});Object.defineProperty(P,\"ConnectionErrors\",{enumerable:!0,get:function(){return Ut.ConnectionErrors}});Object.defineProperty(P,\"ConnectionError\",{enumerable:!0,get:function(){return Ut.ConnectionError}});Object.defineProperty(P,\"CancellationReceiverStrategy\",{enumerable:!0,get:function(){return Ut.CancellationReceiverStrategy}});Object.defineProperty(P,\"CancellationSenderStrategy\",{enumerable:!0,get:function(){return Ut.CancellationSenderStrategy}});Object.defineProperty(P,\"CancellationStrategy\",{enumerable:!0,get:function(){return Ut.CancellationStrategy}});Object.defineProperty(P,\"MessageStrategy\",{enumerable:!0,get:function(){return Ut.MessageStrategy}});var aU=Ci();P.RAL=aU.default});var TR=ge(pT=>{\"use strict\";Object.defineProperty(pT,\"__esModule\",{value:!0});var hn=Tp(),wp=class t extends hn.AbstractMessageBuffer{constructor(e=\"utf-8\"){super(e),this.asciiDecoder=new TextDecoder(\"ascii\")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r===\"ascii\"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};wp.emptyBuffer=new Uint8Array(0);var uT=class{constructor(e){this.socket=e,this._onData=new hn.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,hn.RAL)().console.error(\"Converting blob to array buffer failed.\")})},this.socket.addEventListener(\"message\",this._messageListener)}onClose(e){return this.socket.addEventListener(\"close\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"close\",e))}onError(e){return this.socket.addEventListener(\"error\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"error\",e))}onEnd(e){return this.socket.addEventListener(\"end\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"end\",e))}onData(e){return this._onData.event(e)}},fT=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener(\"close\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"close\",e))}onError(e){return this.socket.addEventListener(\"error\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"error\",e))}onEnd(e){return this.socket.addEventListener(\"end\",e),hn.Disposable.create(()=>this.socket.removeEventListener(\"end\",e))}write(e,r){if(typeof e==\"string\"){if(r!==void 0&&r!==\"utf-8\")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},cU=new TextEncoder,xR=Object.freeze({messageBuffer:Object.freeze({create:t=>new wp(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:\"application/json\",encode:(t,e)=>{if(e.charset!==\"utf-8\")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(cU.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:\"application/json\",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error(\"In a Browser environments only Uint8Arrays are supported.\");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new uT(t),asWritableStream:t=>new fT(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function dT(){return xR}(function(t){function e(){hn.RAL.install(xR)}t.install=e})(dT||(dT={}));pT.default=dT});var Bo=ge(br=>{\"use strict\";var lU=br&&br.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||(\"get\"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uU=br&&br.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&lU(e,t,r)};Object.defineProperty(br,\"__esModule\",{value:!0});br.createMessageConnection=br.BrowserMessageWriter=br.BrowserMessageReader=void 0;var fU=TR();fU.default.install();var ba=Tp();uU(Tp(),br);var hT=class extends ba.AbstractMessageReader{constructor(e){super(),this._onData=new ba.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener(\"error\",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};br.BrowserMessageReader=hT;var mT=class extends ba.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener(\"error\",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};br.BrowserMessageWriter=mT;function dU(t,e,r,n){return r===void 0&&(r=ba.NullLogger),ba.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ba.createMessageConnection)(t,e,r,n)}br.createMessageConnection=dU});var gT=ge((fZ,wR)=>{\"use strict\";wR.exports=Bo()});var yt=ge(ur=>{\"use strict\";Object.defineProperty(ur,\"__esModule\",{value:!0});ur.ProtocolNotificationType=ur.ProtocolNotificationType0=ur.ProtocolRequestType=ur.ProtocolRequestType0=ur.RegistrationType=ur.MessageDirection=void 0;var _a=Bo(),bR;(function(t){t.clientToServer=\"clientToServer\",t.serverToClient=\"serverToClient\",t.both=\"both\"})(bR||(ur.MessageDirection=bR={}));var yT=class{constructor(e){this.method=e}};ur.RegistrationType=yT;var xT=class extends _a.RequestType0{constructor(e){super(e)}};ur.ProtocolRequestType0=xT;var TT=class extends _a.RequestType{constructor(e){super(e,_a.ParameterStructures.byName)}};ur.ProtocolRequestType=TT;var wT=class extends _a.NotificationType0{constructor(e){super(e)}};ur.ProtocolNotificationType0=wT;var bT=class extends _a.NotificationType{constructor(e){super(e,_a.ParameterStructures.byName)}};ur.ProtocolNotificationType=bT});var bp=ge(St=>{\"use strict\";Object.defineProperty(St,\"__esModule\",{value:!0});St.objectLiteral=St.typedArray=St.stringArray=St.array=St.func=St.error=St.number=St.string=St.boolean=void 0;function pU(t){return t===!0||t===!1}St.boolean=pU;function _R(t){return typeof t==\"string\"||t instanceof String}St.string=_R;function hU(t){return typeof t==\"number\"||t instanceof Number}St.number=hU;function mU(t){return t instanceof Error}St.error=mU;function gU(t){return typeof t==\"function\"}St.func=gU;function ER(t){return Array.isArray(t)}St.array=ER;function yU(t){return ER(t)&&t.every(e=>_R(e))}St.stringArray=yU;function xU(t,e){return Array.isArray(t)&&t.every(e)}St.typedArray=xU;function TU(t){return t!==null&&typeof t==\"object\"}St.objectLiteral=TU});var AR=ge(_p=>{\"use strict\";Object.defineProperty(_p,\"__esModule\",{value:!0});_p.ImplementationRequest=void 0;var vR=yt(),RR;(function(t){t.method=\"textDocument/implementation\",t.messageDirection=vR.MessageDirection.clientToServer,t.type=new vR.ProtocolRequestType(t.method)})(RR||(_p.ImplementationRequest=RR={}))});var SR=ge(Ep=>{\"use strict\";Object.defineProperty(Ep,\"__esModule\",{value:!0});Ep.TypeDefinitionRequest=void 0;var kR=yt(),IR;(function(t){t.method=\"textDocument/typeDefinition\",t.messageDirection=kR.MessageDirection.clientToServer,t.type=new kR.ProtocolRequestType(t.method)})(IR||(Ep.TypeDefinitionRequest=IR={}))});var PR=ge(Ea=>{\"use strict\";Object.defineProperty(Ea,\"__esModule\",{value:!0});Ea.DidChangeWorkspaceFoldersNotification=Ea.WorkspaceFoldersRequest=void 0;var vp=yt(),NR;(function(t){t.method=\"workspace/workspaceFolders\",t.messageDirection=vp.MessageDirection.serverToClient,t.type=new vp.ProtocolRequestType0(t.method)})(NR||(Ea.WorkspaceFoldersRequest=NR={}));var CR;(function(t){t.method=\"workspace/didChangeWorkspaceFolders\",t.messageDirection=vp.MessageDirection.clientToServer,t.type=new vp.ProtocolNotificationType(t.method)})(CR||(Ea.DidChangeWorkspaceFoldersNotification=CR={}))});var DR=ge(Rp=>{\"use strict\";Object.defineProperty(Rp,\"__esModule\",{value:!0});Rp.ConfigurationRequest=void 0;var OR=yt(),LR;(function(t){t.method=\"workspace/configuration\",t.messageDirection=OR.MessageDirection.serverToClient,t.type=new OR.ProtocolRequestType(t.method)})(LR||(Rp.ConfigurationRequest=LR={}))});var FR=ge(va=>{\"use strict\";Object.defineProperty(va,\"__esModule\",{value:!0});va.ColorPresentationRequest=va.DocumentColorRequest=void 0;var Ap=yt(),MR;(function(t){t.method=\"textDocument/documentColor\",t.messageDirection=Ap.MessageDirection.clientToServer,t.type=new Ap.ProtocolRequestType(t.method)})(MR||(va.DocumentColorRequest=MR={}));var $R;(function(t){t.method=\"textDocument/colorPresentation\",t.messageDirection=Ap.MessageDirection.clientToServer,t.type=new Ap.ProtocolRequestType(t.method)})($R||(va.ColorPresentationRequest=$R={}))});var HR=ge(Ra=>{\"use strict\";Object.defineProperty(Ra,\"__esModule\",{value:!0});Ra.FoldingRangeRefreshRequest=Ra.FoldingRangeRequest=void 0;var kp=yt(),UR;(function(t){t.method=\"textDocument/foldingRange\",t.messageDirection=kp.MessageDirection.clientToServer,t.type=new kp.ProtocolRequestType(t.method)})(UR||(Ra.FoldingRangeRequest=UR={}));var BR;(function(t){t.method=\"workspace/foldingRange/refresh\",t.messageDirection=kp.MessageDirection.serverToClient,t.type=new kp.ProtocolRequestType0(t.method)})(BR||(Ra.FoldingRangeRefreshRequest=BR={}))});var jR=ge(Ip=>{\"use strict\";Object.defineProperty(Ip,\"__esModule\",{value:!0});Ip.DeclarationRequest=void 0;var XR=yt(),GR;(function(t){t.method=\"textDocument/declaration\",t.messageDirection=XR.MessageDirection.clientToServer,t.type=new XR.ProtocolRequestType(t.method)})(GR||(Ip.DeclarationRequest=GR={}))});var qR=ge(Sp=>{\"use strict\";Object.defineProperty(Sp,\"__esModule\",{value:!0});Sp.SelectionRangeRequest=void 0;var zR=yt(),WR;(function(t){t.method=\"textDocument/selectionRange\",t.messageDirection=zR.MessageDirection.clientToServer,t.type=new zR.ProtocolRequestType(t.method)})(WR||(Sp.SelectionRangeRequest=WR={}))});var ZR=ge(Li=>{\"use strict\";Object.defineProperty(Li,\"__esModule\",{value:!0});Li.WorkDoneProgressCancelNotification=Li.WorkDoneProgressCreateRequest=Li.WorkDoneProgress=void 0;var wU=Bo(),Np=yt(),VR;(function(t){t.type=new wU.ProgressType;function e(r){return r===t.type}t.is=e})(VR||(Li.WorkDoneProgress=VR={}));var YR;(function(t){t.method=\"window/workDoneProgress/create\",t.messageDirection=Np.MessageDirection.serverToClient,t.type=new Np.ProtocolRequestType(t.method)})(YR||(Li.WorkDoneProgressCreateRequest=YR={}));var KR;(function(t){t.method=\"window/workDoneProgress/cancel\",t.messageDirection=Np.MessageDirection.clientToServer,t.type=new Np.ProtocolNotificationType(t.method)})(KR||(Li.WorkDoneProgressCancelNotification=KR={}))});var tA=ge(Di=>{\"use strict\";Object.defineProperty(Di,\"__esModule\",{value:!0});Di.CallHierarchyOutgoingCallsRequest=Di.CallHierarchyIncomingCallsRequest=Di.CallHierarchyPrepareRequest=void 0;var Aa=yt(),JR;(function(t){t.method=\"textDocument/prepareCallHierarchy\",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(JR||(Di.CallHierarchyPrepareRequest=JR={}));var QR;(function(t){t.method=\"callHierarchy/incomingCalls\",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(QR||(Di.CallHierarchyIncomingCallsRequest=QR={}));var eA;(function(t){t.method=\"callHierarchy/outgoingCalls\",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(eA||(Di.CallHierarchyOutgoingCallsRequest=eA={}))});var aA=ge(fr=>{\"use strict\";Object.defineProperty(fr,\"__esModule\",{value:!0});fr.SemanticTokensRefreshRequest=fr.SemanticTokensRangeRequest=fr.SemanticTokensDeltaRequest=fr.SemanticTokensRequest=fr.SemanticTokensRegistrationType=fr.TokenFormat=void 0;var Gn=yt(),rA;(function(t){t.Relative=\"relative\"})(rA||(fr.TokenFormat=rA={}));var Yl;(function(t){t.method=\"textDocument/semanticTokens\",t.type=new Gn.RegistrationType(t.method)})(Yl||(fr.SemanticTokensRegistrationType=Yl={}));var nA;(function(t){t.method=\"textDocument/semanticTokens/full\",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Yl.method})(nA||(fr.SemanticTokensRequest=nA={}));var iA;(function(t){t.method=\"textDocument/semanticTokens/full/delta\",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Yl.method})(iA||(fr.SemanticTokensDeltaRequest=iA={}));var oA;(function(t){t.method=\"textDocument/semanticTokens/range\",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Yl.method})(oA||(fr.SemanticTokensRangeRequest=oA={}));var sA;(function(t){t.method=\"workspace/semanticTokens/refresh\",t.messageDirection=Gn.MessageDirection.serverToClient,t.type=new Gn.ProtocolRequestType0(t.method)})(sA||(fr.SemanticTokensRefreshRequest=sA={}))});var uA=ge(Cp=>{\"use strict\";Object.defineProperty(Cp,\"__esModule\",{value:!0});Cp.ShowDocumentRequest=void 0;var cA=yt(),lA;(function(t){t.method=\"window/showDocument\",t.messageDirection=cA.MessageDirection.serverToClient,t.type=new cA.ProtocolRequestType(t.method)})(lA||(Cp.ShowDocumentRequest=lA={}))});var pA=ge(Pp=>{\"use strict\";Object.defineProperty(Pp,\"__esModule\",{value:!0});Pp.LinkedEditingRangeRequest=void 0;var fA=yt(),dA;(function(t){t.method=\"textDocument/linkedEditingRange\",t.messageDirection=fA.MessageDirection.clientToServer,t.type=new fA.ProtocolRequestType(t.method)})(dA||(Pp.LinkedEditingRangeRequest=dA={}))});var bA=ge(qt=>{\"use strict\";Object.defineProperty(qt,\"__esModule\",{value:!0});qt.WillDeleteFilesRequest=qt.DidDeleteFilesNotification=qt.DidRenameFilesNotification=qt.WillRenameFilesRequest=qt.DidCreateFilesNotification=qt.WillCreateFilesRequest=qt.FileOperationPatternKind=void 0;var Ir=yt(),hA;(function(t){t.file=\"file\",t.folder=\"folder\"})(hA||(qt.FileOperationPatternKind=hA={}));var mA;(function(t){t.method=\"workspace/willCreateFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolRequestType(t.method)})(mA||(qt.WillCreateFilesRequest=mA={}));var gA;(function(t){t.method=\"workspace/didCreateFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method)})(gA||(qt.DidCreateFilesNotification=gA={}));var yA;(function(t){t.method=\"workspace/willRenameFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolRequestType(t.method)})(yA||(qt.WillRenameFilesRequest=yA={}));var xA;(function(t){t.method=\"workspace/didRenameFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method)})(xA||(qt.DidRenameFilesNotification=xA={}));var TA;(function(t){t.method=\"workspace/didDeleteFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method)})(TA||(qt.DidDeleteFilesNotification=TA={}));var wA;(function(t){t.method=\"workspace/willDeleteFiles\",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolRequestType(t.method)})(wA||(qt.WillDeleteFilesRequest=wA={}))});var AA=ge(Mi=>{\"use strict\";Object.defineProperty(Mi,\"__esModule\",{value:!0});Mi.MonikerRequest=Mi.MonikerKind=Mi.UniquenessLevel=void 0;var _A=yt(),EA;(function(t){t.document=\"document\",t.project=\"project\",t.group=\"group\",t.scheme=\"scheme\",t.global=\"global\"})(EA||(Mi.UniquenessLevel=EA={}));var vA;(function(t){t.$import=\"import\",t.$export=\"export\",t.local=\"local\"})(vA||(Mi.MonikerKind=vA={}));var RA;(function(t){t.method=\"textDocument/moniker\",t.messageDirection=_A.MessageDirection.clientToServer,t.type=new _A.ProtocolRequestType(t.method)})(RA||(Mi.MonikerRequest=RA={}))});var NA=ge($i=>{\"use strict\";Object.defineProperty($i,\"__esModule\",{value:!0});$i.TypeHierarchySubtypesRequest=$i.TypeHierarchySupertypesRequest=$i.TypeHierarchyPrepareRequest=void 0;var ka=yt(),kA;(function(t){t.method=\"textDocument/prepareTypeHierarchy\",t.messageDirection=ka.MessageDirection.clientToServer,t.type=new ka.ProtocolRequestType(t.method)})(kA||($i.TypeHierarchyPrepareRequest=kA={}));var IA;(function(t){t.method=\"typeHierarchy/supertypes\",t.messageDirection=ka.MessageDirection.clientToServer,t.type=new ka.ProtocolRequestType(t.method)})(IA||($i.TypeHierarchySupertypesRequest=IA={}));var SA;(function(t){t.method=\"typeHierarchy/subtypes\",t.messageDirection=ka.MessageDirection.clientToServer,t.type=new ka.ProtocolRequestType(t.method)})(SA||($i.TypeHierarchySubtypesRequest=SA={}))});var OA=ge(Ia=>{\"use strict\";Object.defineProperty(Ia,\"__esModule\",{value:!0});Ia.InlineValueRefreshRequest=Ia.InlineValueRequest=void 0;var Op=yt(),CA;(function(t){t.method=\"textDocument/inlineValue\",t.messageDirection=Op.MessageDirection.clientToServer,t.type=new Op.ProtocolRequestType(t.method)})(CA||(Ia.InlineValueRequest=CA={}));var PA;(function(t){t.method=\"workspace/inlineValue/refresh\",t.messageDirection=Op.MessageDirection.serverToClient,t.type=new Op.ProtocolRequestType0(t.method)})(PA||(Ia.InlineValueRefreshRequest=PA={}))});var $A=ge(Fi=>{\"use strict\";Object.defineProperty(Fi,\"__esModule\",{value:!0});Fi.InlayHintRefreshRequest=Fi.InlayHintResolveRequest=Fi.InlayHintRequest=void 0;var Sa=yt(),LA;(function(t){t.method=\"textDocument/inlayHint\",t.messageDirection=Sa.MessageDirection.clientToServer,t.type=new Sa.ProtocolRequestType(t.method)})(LA||(Fi.InlayHintRequest=LA={}));var DA;(function(t){t.method=\"inlayHint/resolve\",t.messageDirection=Sa.MessageDirection.clientToServer,t.type=new Sa.ProtocolRequestType(t.method)})(DA||(Fi.InlayHintResolveRequest=DA={}));var MA;(function(t){t.method=\"workspace/inlayHint/refresh\",t.messageDirection=Sa.MessageDirection.serverToClient,t.type=new Sa.ProtocolRequestType0(t.method)})(MA||(Fi.InlayHintRefreshRequest=MA={}))});var jA=ge(Sr=>{\"use strict\";Object.defineProperty(Sr,\"__esModule\",{value:!0});Sr.DiagnosticRefreshRequest=Sr.WorkspaceDiagnosticRequest=Sr.DocumentDiagnosticRequest=Sr.DocumentDiagnosticReportKind=Sr.DiagnosticServerCancellationData=void 0;var GA=Bo(),bU=bp(),Na=yt(),FA;(function(t){function e(r){let n=r;return n&&bU.boolean(n.retriggerRequest)}t.is=e})(FA||(Sr.DiagnosticServerCancellationData=FA={}));var UA;(function(t){t.Full=\"full\",t.Unchanged=\"unchanged\"})(UA||(Sr.DocumentDiagnosticReportKind=UA={}));var BA;(function(t){t.method=\"textDocument/diagnostic\",t.messageDirection=Na.MessageDirection.clientToServer,t.type=new Na.ProtocolRequestType(t.method),t.partialResult=new GA.ProgressType})(BA||(Sr.DocumentDiagnosticRequest=BA={}));var HA;(function(t){t.method=\"workspace/diagnostic\",t.messageDirection=Na.MessageDirection.clientToServer,t.type=new Na.ProtocolRequestType(t.method),t.partialResult=new GA.ProgressType})(HA||(Sr.WorkspaceDiagnosticRequest=HA={}));var XA;(function(t){t.method=\"workspace/diagnostic/refresh\",t.messageDirection=Na.MessageDirection.serverToClient,t.type=new Na.ProtocolRequestType0(t.method)})(XA||(Sr.DiagnosticRefreshRequest=XA={}))});var ZA=ge(vt=>{\"use strict\";Object.defineProperty(vt,\"__esModule\",{value:!0});vt.DidCloseNotebookDocumentNotification=vt.DidSaveNotebookDocumentNotification=vt.DidChangeNotebookDocumentNotification=vt.NotebookCellArrayChange=vt.DidOpenNotebookDocumentNotification=vt.NotebookDocumentSyncRegistrationType=vt.NotebookDocument=vt.NotebookCell=vt.ExecutionSummary=vt.NotebookCellKind=void 0;var Kl=(na(),om(Gd)),zr=bp(),mn=yt(),_T;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(_T||(vt.NotebookCellKind=_T={}));var ET;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return zr.objectLiteral(o)&&Kl.uinteger.is(o.executionOrder)&&(o.success===void 0||zr.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(ET||(vt.ExecutionSummary=ET={}));var Lp;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return zr.objectLiteral(s)&&_T.is(s.kind)&&Kl.DocumentUri.is(s.document)&&(s.metadata===void 0||zr.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add(\"document\"),o.kind!==s.kind&&a.add(\"kind\"),o.executionSummary!==s.executionSummary&&a.add(\"executionSummary\"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add(\"metadata\"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!ET.equals(o.executionSummary,s.executionSummary)&&a.add(\"executionSummary\"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!=\"object\")return!1;let a=Array.isArray(o),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let l=0;l<o.length;l++)if(!i(o[l],s[l]))return!1}if(zr.objectLiteral(o)&&zr.objectLiteral(s)){let l=Object.keys(o),u=Object.keys(s);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let f=0;f<l.length;f++){let d=l[f];if(!i(o[d],s[d]))return!1}}return!0}})(Lp||(vt.NotebookCell=Lp={}));var zA;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return zr.objectLiteral(i)&&zr.string(i.uri)&&Kl.integer.is(i.version)&&zr.typedArray(i.cells,Lp.is)}t.is=r})(zA||(vt.NotebookDocument=zA={}));var Ca;(function(t){t.method=\"notebookDocument/sync\",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.RegistrationType(t.method)})(Ca||(vt.NotebookDocumentSyncRegistrationType=Ca={}));var WA;(function(t){t.method=\"notebookDocument/didOpen\",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Ca.method})(WA||(vt.DidOpenNotebookDocumentNotification=WA={}));var qA;(function(t){function e(n){let i=n;return zr.objectLiteral(i)&&Kl.uinteger.is(i.start)&&Kl.uinteger.is(i.deleteCount)&&(i.cells===void 0||zr.typedArray(i.cells,Lp.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(qA||(vt.NotebookCellArrayChange=qA={}));var VA;(function(t){t.method=\"notebookDocument/didChange\",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Ca.method})(VA||(vt.DidChangeNotebookDocumentNotification=VA={}));var YA;(function(t){t.method=\"notebookDocument/didSave\",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Ca.method})(YA||(vt.DidSaveNotebookDocumentNotification=YA={}));var KA;(function(t){t.method=\"notebookDocument/didClose\",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Ca.method})(KA||(vt.DidCloseNotebookDocumentNotification=KA={}))});var ek=ge(Dp=>{\"use strict\";Object.defineProperty(Dp,\"__esModule\",{value:!0});Dp.InlineCompletionRequest=void 0;var JA=yt(),QA;(function(t){t.method=\"textDocument/inlineCompletion\",t.messageDirection=JA.MessageDirection.clientToServer,t.type=new JA.ProtocolRequestType(t.method)})(QA||(Dp.InlineCompletionRequest=QA={}))});var pI=ge(y=>{\"use strict\";Object.defineProperty(y,\"__esModule\",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var W=yt(),tk=(na(),om(Gd)),Mt=bp(),_U=AR();Object.defineProperty(y,\"ImplementationRequest\",{enumerable:!0,get:function(){return _U.ImplementationRequest}});var EU=SR();Object.defineProperty(y,\"TypeDefinitionRequest\",{enumerable:!0,get:function(){return EU.TypeDefinitionRequest}});var lI=PR();Object.defineProperty(y,\"WorkspaceFoldersRequest\",{enumerable:!0,get:function(){return lI.WorkspaceFoldersRequest}});Object.defineProperty(y,\"DidChangeWorkspaceFoldersNotification\",{enumerable:!0,get:function(){return lI.DidChangeWorkspaceFoldersNotification}});var vU=DR();Object.defineProperty(y,\"ConfigurationRequest\",{enumerable:!0,get:function(){return vU.ConfigurationRequest}});var uI=FR();Object.defineProperty(y,\"DocumentColorRequest\",{enumerable:!0,get:function(){return uI.DocumentColorRequest}});Object.defineProperty(y,\"ColorPresentationRequest\",{enumerable:!0,get:function(){return uI.ColorPresentationRequest}});var fI=HR();Object.defineProperty(y,\"FoldingRangeRequest\",{enumerable:!0,get:function(){return fI.FoldingRangeRequest}});Object.defineProperty(y,\"FoldingRangeRefreshRequest\",{enumerable:!0,get:function(){return fI.FoldingRangeRefreshRequest}});var RU=jR();Object.defineProperty(y,\"DeclarationRequest\",{enumerable:!0,get:function(){return RU.DeclarationRequest}});var AU=qR();Object.defineProperty(y,\"SelectionRangeRequest\",{enumerable:!0,get:function(){return AU.SelectionRangeRequest}});var IT=ZR();Object.defineProperty(y,\"WorkDoneProgress\",{enumerable:!0,get:function(){return IT.WorkDoneProgress}});Object.defineProperty(y,\"WorkDoneProgressCreateRequest\",{enumerable:!0,get:function(){return IT.WorkDoneProgressCreateRequest}});Object.defineProperty(y,\"WorkDoneProgressCancelNotification\",{enumerable:!0,get:function(){return IT.WorkDoneProgressCancelNotification}});var ST=tA();Object.defineProperty(y,\"CallHierarchyIncomingCallsRequest\",{enumerable:!0,get:function(){return ST.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,\"CallHierarchyOutgoingCallsRequest\",{enumerable:!0,get:function(){return ST.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,\"CallHierarchyPrepareRequest\",{enumerable:!0,get:function(){return ST.CallHierarchyPrepareRequest}});var Pa=aA();Object.defineProperty(y,\"TokenFormat\",{enumerable:!0,get:function(){return Pa.TokenFormat}});Object.defineProperty(y,\"SemanticTokensRequest\",{enumerable:!0,get:function(){return Pa.SemanticTokensRequest}});Object.defineProperty(y,\"SemanticTokensDeltaRequest\",{enumerable:!0,get:function(){return Pa.SemanticTokensDeltaRequest}});Object.defineProperty(y,\"SemanticTokensRangeRequest\",{enumerable:!0,get:function(){return Pa.SemanticTokensRangeRequest}});Object.defineProperty(y,\"SemanticTokensRefreshRequest\",{enumerable:!0,get:function(){return Pa.SemanticTokensRefreshRequest}});Object.defineProperty(y,\"SemanticTokensRegistrationType\",{enumerable:!0,get:function(){return Pa.SemanticTokensRegistrationType}});var kU=uA();Object.defineProperty(y,\"ShowDocumentRequest\",{enumerable:!0,get:function(){return kU.ShowDocumentRequest}});var IU=pA();Object.defineProperty(y,\"LinkedEditingRangeRequest\",{enumerable:!0,get:function(){return IU.LinkedEditingRangeRequest}});var Ho=bA();Object.defineProperty(y,\"FileOperationPatternKind\",{enumerable:!0,get:function(){return Ho.FileOperationPatternKind}});Object.defineProperty(y,\"DidCreateFilesNotification\",{enumerable:!0,get:function(){return Ho.DidCreateFilesNotification}});Object.defineProperty(y,\"WillCreateFilesRequest\",{enumerable:!0,get:function(){return Ho.WillCreateFilesRequest}});Object.defineProperty(y,\"DidRenameFilesNotification\",{enumerable:!0,get:function(){return Ho.DidRenameFilesNotification}});Object.defineProperty(y,\"WillRenameFilesRequest\",{enumerable:!0,get:function(){return Ho.WillRenameFilesRequest}});Object.defineProperty(y,\"DidDeleteFilesNotification\",{enumerable:!0,get:function(){return Ho.DidDeleteFilesNotification}});Object.defineProperty(y,\"WillDeleteFilesRequest\",{enumerable:!0,get:function(){return Ho.WillDeleteFilesRequest}});var NT=AA();Object.defineProperty(y,\"UniquenessLevel\",{enumerable:!0,get:function(){return NT.UniquenessLevel}});Object.defineProperty(y,\"MonikerKind\",{enumerable:!0,get:function(){return NT.MonikerKind}});Object.defineProperty(y,\"MonikerRequest\",{enumerable:!0,get:function(){return NT.MonikerRequest}});var CT=NA();Object.defineProperty(y,\"TypeHierarchyPrepareRequest\",{enumerable:!0,get:function(){return CT.TypeHierarchyPrepareRequest}});Object.defineProperty(y,\"TypeHierarchySubtypesRequest\",{enumerable:!0,get:function(){return CT.TypeHierarchySubtypesRequest}});Object.defineProperty(y,\"TypeHierarchySupertypesRequest\",{enumerable:!0,get:function(){return CT.TypeHierarchySupertypesRequest}});var dI=OA();Object.defineProperty(y,\"InlineValueRequest\",{enumerable:!0,get:function(){return dI.InlineValueRequest}});Object.defineProperty(y,\"InlineValueRefreshRequest\",{enumerable:!0,get:function(){return dI.InlineValueRefreshRequest}});var PT=$A();Object.defineProperty(y,\"InlayHintRequest\",{enumerable:!0,get:function(){return PT.InlayHintRequest}});Object.defineProperty(y,\"InlayHintResolveRequest\",{enumerable:!0,get:function(){return PT.InlayHintResolveRequest}});Object.defineProperty(y,\"InlayHintRefreshRequest\",{enumerable:!0,get:function(){return PT.InlayHintRefreshRequest}});var Zl=jA();Object.defineProperty(y,\"DiagnosticServerCancellationData\",{enumerable:!0,get:function(){return Zl.DiagnosticServerCancellationData}});Object.defineProperty(y,\"DocumentDiagnosticReportKind\",{enumerable:!0,get:function(){return Zl.DocumentDiagnosticReportKind}});Object.defineProperty(y,\"DocumentDiagnosticRequest\",{enumerable:!0,get:function(){return Zl.DocumentDiagnosticRequest}});Object.defineProperty(y,\"WorkspaceDiagnosticRequest\",{enumerable:!0,get:function(){return Zl.WorkspaceDiagnosticRequest}});Object.defineProperty(y,\"DiagnosticRefreshRequest\",{enumerable:!0,get:function(){return Zl.DiagnosticRefreshRequest}});var gn=ZA();Object.defineProperty(y,\"NotebookCellKind\",{enumerable:!0,get:function(){return gn.NotebookCellKind}});Object.defineProperty(y,\"ExecutionSummary\",{enumerable:!0,get:function(){return gn.ExecutionSummary}});Object.defineProperty(y,\"NotebookCell\",{enumerable:!0,get:function(){return gn.NotebookCell}});Object.defineProperty(y,\"NotebookDocument\",{enumerable:!0,get:function(){return gn.NotebookDocument}});Object.defineProperty(y,\"NotebookDocumentSyncRegistrationType\",{enumerable:!0,get:function(){return gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,\"DidOpenNotebookDocumentNotification\",{enumerable:!0,get:function(){return gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,\"NotebookCellArrayChange\",{enumerable:!0,get:function(){return gn.NotebookCellArrayChange}});Object.defineProperty(y,\"DidChangeNotebookDocumentNotification\",{enumerable:!0,get:function(){return gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,\"DidSaveNotebookDocumentNotification\",{enumerable:!0,get:function(){return gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,\"DidCloseNotebookDocumentNotification\",{enumerable:!0,get:function(){return gn.DidCloseNotebookDocumentNotification}});var SU=ek();Object.defineProperty(y,\"InlineCompletionRequest\",{enumerable:!0,get:function(){return SU.InlineCompletionRequest}});var vT;(function(t){function e(r){let n=r;return Mt.string(n)||Mt.string(n.language)||Mt.string(n.scheme)||Mt.string(n.pattern)}t.is=e})(vT||(y.TextDocumentFilter=vT={}));var RT;(function(t){function e(r){let n=r;return Mt.objectLiteral(n)&&(Mt.string(n.notebookType)||Mt.string(n.scheme)||Mt.string(n.pattern))}t.is=e})(RT||(y.NotebookDocumentFilter=RT={}));var AT;(function(t){function e(r){let n=r;return Mt.objectLiteral(n)&&(Mt.string(n.notebook)||RT.is(n.notebook))&&(n.language===void 0||Mt.string(n.language))}t.is=e})(AT||(y.NotebookCellTextDocumentFilter=AT={}));var kT;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Mt.string(n)&&!vT.is(n)&&!AT.is(n))return!1;return!0}t.is=e})(kT||(y.DocumentSelector=kT={}));var rk;(function(t){t.method=\"client/registerCapability\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(rk||(y.RegistrationRequest=rk={}));var nk;(function(t){t.method=\"client/unregisterCapability\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(nk||(y.UnregistrationRequest=nk={}));var ik;(function(t){t.Create=\"create\",t.Rename=\"rename\",t.Delete=\"delete\"})(ik||(y.ResourceOperationKind=ik={}));var ok;(function(t){t.Abort=\"abort\",t.Transactional=\"transactional\",t.TextOnlyTransactional=\"textOnlyTransactional\",t.Undo=\"undo\"})(ok||(y.FailureHandlingKind=ok={}));var sk;(function(t){t.UTF8=\"utf-8\",t.UTF16=\"utf-16\",t.UTF32=\"utf-32\"})(sk||(y.PositionEncodingKind=sk={}));var ak;(function(t){function e(r){let n=r;return n&&Mt.string(n.id)&&n.id.length>0}t.hasId=e})(ak||(y.StaticRegistrationOptions=ak={}));var ck;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||kT.is(n.documentSelector))}t.is=e})(ck||(y.TextDocumentRegistrationOptions=ck={}));var lk;(function(t){function e(n){let i=n;return Mt.objectLiteral(i)&&(i.workDoneProgress===void 0||Mt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Mt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(lk||(y.WorkDoneProgressOptions=lk={}));var uk;(function(t){t.method=\"initialize\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(uk||(y.InitializeRequest=uk={}));var fk;(function(t){t.unknownProtocolVersion=1})(fk||(y.InitializeErrorCodes=fk={}));var dk;(function(t){t.method=\"initialized\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(dk||(y.InitializedNotification=dk={}));var pk;(function(t){t.method=\"shutdown\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType0(t.method)})(pk||(y.ShutdownRequest=pk={}));var hk;(function(t){t.method=\"exit\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType0(t.method)})(hk||(y.ExitNotification=hk={}));var mk;(function(t){t.method=\"workspace/didChangeConfiguration\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(mk||(y.DidChangeConfigurationNotification=mk={}));var gk;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(gk||(y.MessageType=gk={}));var yk;(function(t){t.method=\"window/showMessage\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(yk||(y.ShowMessageNotification=yk={}));var xk;(function(t){t.method=\"window/showMessageRequest\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(t.method)})(xk||(y.ShowMessageRequest=xk={}));var Tk;(function(t){t.method=\"window/logMessage\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(Tk||(y.LogMessageNotification=Tk={}));var wk;(function(t){t.method=\"telemetry/event\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(wk||(y.TelemetryEventNotification=wk={}));var bk;(function(t){t.None=0,t.Full=1,t.Incremental=2})(bk||(y.TextDocumentSyncKind=bk={}));var _k;(function(t){t.method=\"textDocument/didOpen\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(_k||(y.DidOpenTextDocumentNotification=_k={}));var Ek;(function(t){function e(n){let i=n;return i!=null&&typeof i.text==\"string\"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength==\"number\")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text==\"string\"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Ek||(y.TextDocumentContentChangeEvent=Ek={}));var vk;(function(t){t.method=\"textDocument/didChange\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(vk||(y.DidChangeTextDocumentNotification=vk={}));var Rk;(function(t){t.method=\"textDocument/didClose\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(Rk||(y.DidCloseTextDocumentNotification=Rk={}));var Ak;(function(t){t.method=\"textDocument/didSave\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(Ak||(y.DidSaveTextDocumentNotification=Ak={}));var kk;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(kk||(y.TextDocumentSaveReason=kk={}));var Ik;(function(t){t.method=\"textDocument/willSave\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(Ik||(y.WillSaveTextDocumentNotification=Ik={}));var Sk;(function(t){t.method=\"textDocument/willSaveWaitUntil\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Sk||(y.WillSaveTextDocumentWaitUntilRequest=Sk={}));var Nk;(function(t){t.method=\"workspace/didChangeWatchedFiles\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolNotificationType(t.method)})(Nk||(y.DidChangeWatchedFilesNotification=Nk={}));var Ck;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Ck||(y.FileChangeType=Ck={}));var Pk;(function(t){function e(r){let n=r;return Mt.objectLiteral(n)&&(tk.URI.is(n.baseUri)||tk.WorkspaceFolder.is(n.baseUri))&&Mt.string(n.pattern)}t.is=e})(Pk||(y.RelativePattern=Pk={}));var Ok;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Ok||(y.WatchKind=Ok={}));var Lk;(function(t){t.method=\"textDocument/publishDiagnostics\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolNotificationType(t.method)})(Lk||(y.PublishDiagnosticsNotification=Lk={}));var Dk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Dk||(y.CompletionTriggerKind=Dk={}));var Mk;(function(t){t.method=\"textDocument/completion\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Mk||(y.CompletionRequest=Mk={}));var $k;(function(t){t.method=\"completionItem/resolve\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})($k||(y.CompletionResolveRequest=$k={}));var Fk;(function(t){t.method=\"textDocument/hover\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Fk||(y.HoverRequest=Fk={}));var Uk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Uk||(y.SignatureHelpTriggerKind=Uk={}));var Bk;(function(t){t.method=\"textDocument/signatureHelp\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Bk||(y.SignatureHelpRequest=Bk={}));var Hk;(function(t){t.method=\"textDocument/definition\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Hk||(y.DefinitionRequest=Hk={}));var Xk;(function(t){t.method=\"textDocument/references\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Xk||(y.ReferencesRequest=Xk={}));var Gk;(function(t){t.method=\"textDocument/documentHighlight\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Gk||(y.DocumentHighlightRequest=Gk={}));var jk;(function(t){t.method=\"textDocument/documentSymbol\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(jk||(y.DocumentSymbolRequest=jk={}));var zk;(function(t){t.method=\"textDocument/codeAction\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(zk||(y.CodeActionRequest=zk={}));var Wk;(function(t){t.method=\"codeAction/resolve\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Wk||(y.CodeActionResolveRequest=Wk={}));var qk;(function(t){t.method=\"workspace/symbol\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(qk||(y.WorkspaceSymbolRequest=qk={}));var Vk;(function(t){t.method=\"workspaceSymbol/resolve\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Vk||(y.WorkspaceSymbolResolveRequest=Vk={}));var Yk;(function(t){t.method=\"textDocument/codeLens\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Yk||(y.CodeLensRequest=Yk={}));var Kk;(function(t){t.method=\"codeLens/resolve\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Kk||(y.CodeLensResolveRequest=Kk={}));var Zk;(function(t){t.method=\"workspace/codeLens/refresh\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType0(t.method)})(Zk||(y.CodeLensRefreshRequest=Zk={}));var Jk;(function(t){t.method=\"textDocument/documentLink\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Jk||(y.DocumentLinkRequest=Jk={}));var Qk;(function(t){t.method=\"documentLink/resolve\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(Qk||(y.DocumentLinkResolveRequest=Qk={}));var eI;(function(t){t.method=\"textDocument/formatting\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(eI||(y.DocumentFormattingRequest=eI={}));var tI;(function(t){t.method=\"textDocument/rangeFormatting\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(tI||(y.DocumentRangeFormattingRequest=tI={}));var rI;(function(t){t.method=\"textDocument/rangesFormatting\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(rI||(y.DocumentRangesFormattingRequest=rI={}));var nI;(function(t){t.method=\"textDocument/onTypeFormatting\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(nI||(y.DocumentOnTypeFormattingRequest=nI={}));var iI;(function(t){t.Identifier=1})(iI||(y.PrepareSupportDefaultBehavior=iI={}));var oI;(function(t){t.method=\"textDocument/rename\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(oI||(y.RenameRequest=oI={}));var sI;(function(t){t.method=\"textDocument/prepareRename\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(sI||(y.PrepareRenameRequest=sI={}));var aI;(function(t){t.method=\"workspace/executeCommand\",t.messageDirection=W.MessageDirection.clientToServer,t.type=new W.ProtocolRequestType(t.method)})(aI||(y.ExecuteCommandRequest=aI={}));var cI;(function(t){t.method=\"workspace/applyEdit\",t.messageDirection=W.MessageDirection.serverToClient,t.type=new W.ProtocolRequestType(\"workspace/applyEdit\")})(cI||(y.ApplyWorkspaceEditRequest=cI={}))});var mI=ge(Mp=>{\"use strict\";Object.defineProperty(Mp,\"__esModule\",{value:!0});Mp.createProtocolConnection=void 0;var hI=Bo();function NU(t,e,r,n){return hI.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,hI.createMessageConnection)(t,e,r,n)}Mp.createProtocolConnection=NU});var yI=ge(dr=>{\"use strict\";var CU=dr&&dr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||(\"get\"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$p=dr&&dr.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&CU(e,t,r)};Object.defineProperty(dr,\"__esModule\",{value:!0});dr.LSPErrorCodes=dr.createProtocolConnection=void 0;$p(Bo(),dr);$p((na(),om(Gd)),dr);$p(yt(),dr);$p(pI(),dr);var PU=mI();Object.defineProperty(dr,\"createProtocolConnection\",{enumerable:!0,get:function(){return PU.createProtocolConnection}});var gI;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(gI||(dr.LSPErrorCodes=gI={}))});var TI=ge(yn=>{\"use strict\";var OU=yn&&yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||(\"get\"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xI=yn&&yn.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&OU(e,t,r)};Object.defineProperty(yn,\"__esModule\",{value:!0});yn.createProtocolConnection=void 0;var LU=gT();xI(gT(),yn);xI(yI(),yn);function DU(t,e,r,n){return(0,LU.createMessageConnection)(t,e,r,n)}yn.createProtocolConnection=DU});var qI={};Rn(qI,{nodeReadFile:()=>n2});async function n2(){throw new Error(\"nowline: filesystem readers are unavailable in the in-chat preview\")}var VI=Pb(()=>{});var rP=new Set([\"none\",\"multiplier\",\"person\",\"people\",\"points\",\"time\"]),nP=/^\\d+$/,iP=/^\\d+\\.\\d+$/,oP=/^\\d+(?:\\.\\d+)?%$/;function ri(t){if(!t)return null;if(nP.test(t)){let e=parseInt(t,10);return e>0?e:null}if(iP.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}if(oP.test(t)){let e=parseFloat(t.slice(0,-1))/100;return Number.isFinite(e)&&e>0?e:null}return null}function wc(t){if(Number.isInteger(t))return String(t);let e=t.toFixed(6);return e=e.replace(/0+$/,\"\"),e=e.replace(/\\.$/,\"\"),e}function sP(t){return t.key.endsWith(\":\")?t.key.slice(0,-1):t.key}function aP(t){for(let e of t.properties)if(sP(e)===\"unicode\"&&e.value)return e.value}function bc(t,e){if(t===\"none\")return null;if(rP.has(t))return{kind:\"builtin\",name:t};let r=e.get(t);return r?{kind:\"literal\",text:aP(r)??t}:{kind:\"literal\",text:t}}function Zi(t,e,r){return e?e.kind===\"builtin\"&&e.name===\"multiplier\"?(t.length+1)*r*.58:t.length*r*.58+(.1+1)*r:t.length*r*.58}function _c(t,e,r,n=0,i=0){let o=t+10,s=o+12,a=e.length*6.5,c=s+a,l=0,u=0;r&&(l=`owner: ${r}`.length*5,u=c+6,c=u+l);let f=0;n>0&&(f=c+6,c=f+n);let d=0;i>0&&(d=c+6+i,c=d);let p=c-o+12,m=Math.max(56,p);return{titleTextWidth:a,ownerTextWidth:l,capacityBadgeWidth:n,footnoteIndicatorWidth:i,titleX:s,ownerX:u,badgeX:f,footnoteRightX:d,tabX:o,tabW:m,rightX:o+m}}function Ec(t,e,r){let n=t+24,i=n+10,o=e.length*6,s=Math.max(60,o+10+10),a=n+s+6,c=a+18,l=0,u=0,f=0,d=0,p=c;return r&&(u=c+6,l=r.length*5.5,f=u-3,d=l+6,p=f+d),{labelTextWidth:o,sourceTextWidth:l,tabX:n,tabWidth:s,tabLabelX:i,badgeX:a,badgeSize:18,sourceHaloX:f,sourceHaloWidth:d,sourceTextX:u,chromeRightX:p}}function sm(t,e){if(t.length===0)return{rows:[[]],expanded:!1};let r=[[]],n=0,i=e,o=!1;for(let s of t){let a=r[r.length-1],c=(a.length===0?0:4)+s.width,l=n+c;if(l<=i){a.push(s),n=l;continue}if(a.length===0){a.push(s),n=s.width;continue}let u=l-i,f=s.width*.25;if(!o&&u<=f){a.push(s),n=l,i=l,o=!0;continue}r.push([s]),n=s.width,i=e}return{rows:r,expanded:o}}var Ob=\"lexing-error\",Lb=\"parsing-error\";function Db(t){if(!t||typeof t!=\"object\")return!1;let e=t.code;return e===Ob||e===Lb}function am(t){let e=[];for(let r of t.parseResult.lexerErrors)e.push({origin:\"lexer\",error:r});for(let r of t.parseResult.parserErrors)e.push({origin:\"parser\",error:r});for(let r of t.diagnostics??[]){let n=r;Db(n.data)||e.push({origin:\"validation\",diagnostic:n})}return e}var cP=/did you mean ['\"]?([^'\"?]+)['\"]?\\??/i;function cm(t){let e=t.match(cP);return e?e[1].trim():void 0}function Mb(t){let e=t.toLowerCase();return e.includes(\"duplicate identifier\")?\"duplicate-identifier\":e.includes(\"unknown reference\")||e.includes(\"did you mean\")?\"unknown-reference\":e.includes(\"circular\")?\"circular-dependency\":e.includes(\"requires\")&&e.includes(\"date:\")?\"missing-date\":e.includes(\"duration\")?\"duration\":e.includes(\"include\")?\"include\":e.includes(\"indent\")?\"indentation\":\"validation\"}function $b(t){if(!t||typeof t!=\"object\")return;let e=t;if(typeof e.code==\"string\"&&Array.isArray(e.args))return e.code}function lm(t){let e=$b(t.data);return e||(typeof t.code==\"string\"&&t.code!==\"\"?t.code:typeof t.code==\"number\"?String(t.code):Mb(t.message))}var gt={};Rn(gt,{AbstractAstReflection:()=>Ji,AbstractCstNode:()=>bl,AbstractLangiumParser:()=>_l,AbstractParserErrorMessageProvider:()=>zd,AbstractThreadedAsyncParser:()=>BT,AstUtils:()=>nf,BiMap:()=>Mo,Cancellation:()=>le,CompositeCstNodeImpl:()=>Co,ContextCache:()=>$o,CstNodeBuilder:()=>wl,CstUtils:()=>vf,DEFAULT_TOKENIZE_OPTIONS:()=>Fp,DONE_RESULT:()=>Ht,DatatypeSymbol:()=>jd,DefaultAstNodeDescriptionProvider:()=>Ul,DefaultAstNodeLocator:()=>Hl,DefaultAsyncParser:()=>su,DefaultCommentProvider:()=>ou,DefaultConfigurationProvider:()=>Xl,DefaultDocumentBuilder:()=>Jl,DefaultDocumentValidator:()=>Fl,DefaultHydrator:()=>cu,DefaultIndexManager:()=>Ql,DefaultJsonSerializer:()=>Dl,DefaultLangiumDocumentFactory:()=>Al,DefaultLangiumDocuments:()=>kl,DefaultLangiumProfiler:()=>jT,DefaultLexer:()=>Xo,DefaultLexerErrorMessageProvider:()=>tu,DefaultLinker:()=>Il,DefaultNameProvider:()=>Sl,DefaultReferenceDescriptionProvider:()=>Bl,DefaultReferences:()=>Nl,DefaultScopeComputation:()=>Cl,DefaultScopeProvider:()=>Ll,DefaultServiceRegistry:()=>Ml,DefaultTokenBuilder:()=>Oo,DefaultValueConverter:()=>Lo,DefaultWorkspaceLock:()=>au,DefaultWorkspaceManager:()=>eu,Deferred:()=>rr,Disposable:()=>Ui,DisposableCache:()=>da,DocumentCache:()=>ep,DocumentState:()=>Ae,DocumentValidator:()=>kr,EMPTY_SCOPE:()=>BF,EMPTY_STREAM:()=>ii,EmptyFileSystem:()=>pu,EmptyFileSystemProvider:()=>Xp,ErrorWithLocation:()=>ho,GrammarAST:()=>Mc,GrammarUtils:()=>_s,IndentationAwareLexer:()=>du,IndentationAwareTokenBuilder:()=>La,JSDocDocumentationProvider:()=>iu,LangiumCompletionParser:()=>vl,LangiumParser:()=>El,LangiumParserErrorMessageProvider:()=>oa,LeafCstNodeImpl:()=>No,LexingMode:()=>jo,MapScope:()=>sx,Module:()=>XT,MultiMap:()=>jt,MultiMapScope:()=>Pl,OperationCancelled:()=>Ar,ParserWorker:()=>HT,ProfilingTask:()=>jp,Reduction:()=>as,RefResolving:()=>Do,RegExpUtils:()=>kf,RootCstNodeImpl:()=>ia,SimpleCache:()=>Ol,StreamImpl:()=>gr,StreamScope:()=>fa,TextDocument:()=>ca,TreeStreamImpl:()=>rn,URI:()=>wt,UriTrie:()=>ua,UriUtils:()=>At,VALIDATE_EACH_NODE:()=>z0,ValidationCategory:()=>tp,ValidationRegistry:()=>$l,ValueConverter:()=>dn,WorkspaceCache:()=>pa,assertCondition:()=>jb,assertUnreachable:()=>sn,createCompletionParser:()=>Vy,createDefaultCoreModule:()=>lu,createDefaultSharedCoreModule:()=>uu,createGrammarConfig:()=>eg,createLangiumParser:()=>Yy,createParser:()=>Rl,delayNextTick:()=>ix,diagnosticData:()=>Fo,eagerLoad:()=>SI,getDiagnosticRange:()=>W0,indentationBuilderDefaultOptions:()=>GT,inject:()=>Go,interruptAndCheck:()=>Tt,isAstNode:()=>xt,isAstNodeDescription:()=>um,isAstNodeWithComment:()=>ax,isCompositeCstNode:()=>Dr,isIMultiModeLexerDefinition:()=>LT,isJSDoc:()=>FT,isLeafCstNode:()=>ni,isLinkingError:()=>Qi,isMultiReference:()=>mr,isNamed:()=>G0,isOperationCancelled:()=>pn,isReference:()=>Nt,isRootCstNode:()=>vc,isTokenTypeArray:()=>Up,isTokenTypeDictionary:()=>OT,loadGrammarFromJson:()=>Gp,parseJSDoc:()=>$T,prepareLangiumParser:()=>C0,setInterruptionPeriod:()=>F0,startCancelableOperation:()=>Jd,stream:()=>Se,toDiagnosticData:()=>q0,toDiagnosticSeverity:()=>rp});var vf={};Rn(vf,{DefaultNameRegexp:()=>Ef,RangeComparison:()=>on,compareRange:()=>Bb,findCommentNode:()=>Dm,findDeclarationNodeAtOffset:()=>CP,findLeafNodeAtOffset:()=>Mm,findLeafNodeBeforeOffset:()=>Hb,flattenCst:()=>NP,getDatatypeNode:()=>SP,getInteriorNodes:()=>LP,getNextNode:()=>PP,getPreviousNode:()=>Gb,getStartlineNode:()=>OP,inRange:()=>hm,isChildNode:()=>Lm,isCommentNode:()=>Om,streamCst:()=>fo,toDocumentSegment:()=>po,tokenToRange:()=>xs});function xt(t){return typeof t==\"object\"&&t!==null&&typeof t.$type==\"string\"}function Nt(t){return typeof t==\"object\"&&t!==null&&typeof t.$refText==\"string\"&&\"ref\"in t}function mr(t){return typeof t==\"object\"&&t!==null&&typeof t.$refText==\"string\"&&\"items\"in t}function um(t){return typeof t==\"object\"&&t!==null&&typeof t.name==\"string\"&&typeof t.type==\"string\"&&typeof t.path==\"string\"}function Qi(t){return typeof t==\"object\"&&t!==null&&typeof t.info==\"object\"&&typeof t.message==\"string\"}var Ji=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||\"undefined\"} not found.`);let n=r.properties[e.property]?.referenceType;if(!n)throw new Error(`Property ${e.property||\"undefined\"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){let r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return xt(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.types[e],s=o?o.superTypes.some(a=>this.isSubtype(a,r)):!1;return n[r]=s,s}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function Dr(t){return typeof t==\"object\"&&t!==null&&Array.isArray(t.content)}function ni(t){return typeof t==\"object\"&&t!==null&&typeof t.tokenType==\"object\"}function vc(t){return Dr(t)&&typeof t.fullText==\"string\"}var gr=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new t(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ht})}join(e=\",\"){let r=this.iterator(),n=\"\",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=uP(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Ht:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ht})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(tf(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Ht})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(tf(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Ht})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ht:this.nextFn(r.state)))}distinct(e){return new t(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Ht})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function uP(t){return typeof t==\"string\"?t:typeof t>\"u\"?\"undefined\":typeof t.toString==\"function\"?t.toString():Object.prototype.toString.call(t)}function tf(t){return!!t&&typeof t[Symbol.iterator]==\"function\"}var ii=new gr(()=>{},()=>Ht),Ht=Object.freeze({done:!0,value:void 0});function Se(...t){if(t.length===1){let e=t[0];if(e instanceof gr)return e;if(tf(e))return new gr(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length==\"number\")return new gr(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ht)}return t.length>1?new gr(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];tf(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length==\"number\"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ht}):ii}var rn=class extends gr{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Ht})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},as;(function(t){function e(o){return o.reduce((s,a)=>s+a,0)}t.sum=e;function r(o){return o.reduce((s,a)=>s*a,0)}t.product=r;function n(o){return o.reduce((s,a)=>Math.min(s,a))}t.min=n;function i(o){return o.reduce((s,a)=>Math.max(s,a))}t.max=i})(as||(as={}));var nf={};Rn(nf,{assignMandatoryProperties:()=>pm,copyAstNode:()=>dm,findRootNode:()=>ls,getContainerOfType:()=>An,getDocument:()=>Xt,getReferenceNodes:()=>rf,hasContainerOfType:()=>fP,linkContentToContainer:()=>cs,streamAllContents:()=>Mr,streamAst:()=>Yt,streamContents:()=>Rc,streamReferences:()=>oi});function cs(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith(\"$\")||(Array.isArray(n)?n.forEach((i,o)=>{xt(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=o,e.deep&&cs(i,e))}):xt(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&cs(n,e)))}function An(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function fP(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Xt(t){let r=ls(t).$document;if(!r)throw new Error(\"AST node has no document.\");return r}function ls(t){for(;t.$container;)t=t.$container;return t}function rf(t){return Nt(t)?t.ref?[t.ref]:[]:mr(t)?t.items.map(e=>e.ref):[]}function Rc(t,e){if(!t)throw new Error(\"Node must be an AstNode.\");let r=e?.range;return new gr(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith(\"$\")){let o=t[i];if(xt(o)){if(n.keyIndex++,fm(o,r))return{done:!1,value:o}}else if(Array.isArray(o)){for(;n.arrayIndex<o.length;){let s=n.arrayIndex++,a=o[s];if(xt(a)&&fm(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Ht})}function Mr(t,e){if(!t)throw new Error(\"Root node must be an AstNode.\");return new rn(t,r=>Rc(r,e))}function Yt(t,e){if(t){if(e?.range&&!fm(t,e.range))return new rn(t,()=>[])}else throw new Error(\"Root node must be an AstNode.\");return new rn(t,r=>Rc(r,e),{includeRoot:!0})}function fm(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?hm(r,e):!1}function oi(t){return new gr(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith(\"$\")){let n=t[r];if(Nt(n)||mr(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Nt(o)||mr(n))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ht})}function pm(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Fb(i.defaultValue))}function Fb(t){return Array.isArray(t)?[...t.map(Fb)]:t}function dm(t,e,r){let n={$type:t.$type};r&&(r.set(t,n),r.set(n,t));for(let[i,o]of Object.entries(t))if(!i.startsWith(\"$\"))if(xt(o))n[i]=dm(o,e,r);else if(Nt(o))n[i]=e(n,i,o.$refNode,o.$refText,o);else if(Array.isArray(o)){let s=[];for(let a of o)xt(a)?s.push(dm(a,e,r)):Nt(a)?s.push(e(n,i,a.$refNode,a.$refText,a)):s.push(a);n[i]=s}else n[i]=o;return cs(n,{deep:!0}),n}var Mc={};Rn(Mc,{AbstractElement:()=>sr,AbstractParserRule:()=>Ac,AbstractRule:()=>us,AbstractType:()=>yr,Action:()=>si,Alternatives:()=>kc,ArrayLiteral:()=>of,ArrayType:()=>sf,Assignment:()=>ai,BooleanLiteral:()=>af,CharacterRange:()=>ci,Condition:()=>li,Conjunction:()=>Ic,CrossReference:()=>ui,Disjunction:()=>Sc,EndOfFile:()=>cf,Grammar:()=>kn,GrammarImport:()=>lf,Group:()=>eo,InferredType:()=>uf,InfixRule:()=>nn,InfixRuleOperatorList:()=>Nc,InfixRuleOperators:()=>ff,Interface:()=>fs,Keyword:()=>ds,LangiumGrammarAstReflection:()=>ys,LangiumGrammarTerminals:()=>dP,NamedArgument:()=>ps,NegatedToken:()=>to,Negation:()=>df,NumberLiteral:()=>pf,Parameter:()=>hs,ParameterReference:()=>hf,ParserRule:()=>$r,ReferenceType:()=>Cc,RegexToken:()=>ro,ReturnType:()=>mf,RuleCall:()=>no,SimpleType:()=>ms,StringLiteral:()=>gf,TerminalAlternatives:()=>io,TerminalElement:()=>ar,TerminalGroup:()=>oo,TerminalRule:()=>In,TerminalRuleCall:()=>so,Type:()=>Pc,TypeAttribute:()=>ao,TypeDefinition:()=>co,UnionType:()=>yf,UnorderedGroup:()=>Oc,UntilToken:()=>lo,ValueLiteral:()=>uo,Wildcard:()=>gs,isAbstractElement:()=>Lc,isAbstractParserRule:()=>Sn,isAbstractRule:()=>pP,isAbstractType:()=>hP,isAction:()=>Nn,isAlternatives:()=>xf,isArrayLiteral:()=>mP,isArrayType:()=>mm,isAssignment:()=>Fr,isBooleanLiteral:()=>gm,isCharacterRange:()=>ym,isCondition:()=>gP,isConjunction:()=>xm,isCrossReference:()=>Ur,isDisjunction:()=>Tm,isEndOfFile:()=>wm,isGrammar:()=>yP,isGrammarImport:()=>xP,isGroup:()=>fi,isInferredType:()=>Dc,isInfixRule:()=>di,isInfixRuleOperatorList:()=>TP,isInfixRuleOperators:()=>wP,isInterface:()=>bm,isKeyword:()=>vr,isNamedArgument:()=>bP,isNegatedToken:()=>_m,isNegation:()=>Em,isNumberLiteral:()=>_P,isParameter:()=>EP,isParameterReference:()=>vm,isParserRule:()=>Ot,isReferenceType:()=>Rm,isRegexToken:()=>Am,isReturnType:()=>km,isRuleCall:()=>Br,isSimpleType:()=>Tf,isStringLiteral:()=>vP,isTerminalAlternatives:()=>Im,isTerminalElement:()=>RP,isTerminalGroup:()=>Sm,isTerminalRule:()=>Kt,isTerminalRuleCall:()=>wf,isType:()=>bf,isTypeAttribute:()=>AP,isTypeDefinition:()=>kP,isUnionType:()=>Nm,isUnorderedGroup:()=>_f,isUntilToken:()=>Cm,isValueLiteral:()=>IP,isWildcard:()=>Pm,reflection:()=>ce});var dP={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 Lc(t){return ce.isInstance(t,sr.$type)}var Ac={$type:\"AbstractParserRule\"};function Sn(t){return ce.isInstance(t,Ac.$type)}var us={$type:\"AbstractRule\"};function pP(t){return ce.isInstance(t,us.$type)}var yr={$type:\"AbstractType\"};function hP(t){return ce.isInstance(t,yr.$type)}var si={$type:\"Action\",cardinality:\"cardinality\",feature:\"feature\",inferredType:\"inferredType\",operator:\"operator\",type:\"type\"};function Nn(t){return ce.isInstance(t,si.$type)}var kc={$type:\"Alternatives\",cardinality:\"cardinality\",elements:\"elements\"};function xf(t){return ce.isInstance(t,kc.$type)}var of={$type:\"ArrayLiteral\",elements:\"elements\"};function mP(t){return ce.isInstance(t,of.$type)}var sf={$type:\"ArrayType\",elementType:\"elementType\"};function mm(t){return ce.isInstance(t,sf.$type)}var ai={$type:\"Assignment\",cardinality:\"cardinality\",feature:\"feature\",operator:\"operator\",predicate:\"predicate\",terminal:\"terminal\"};function Fr(t){return ce.isInstance(t,ai.$type)}var af={$type:\"BooleanLiteral\",true:\"true\"};function gm(t){return ce.isInstance(t,af.$type)}var ci={$type:\"CharacterRange\",cardinality:\"cardinality\",left:\"left\",lookahead:\"lookahead\",parenthesized:\"parenthesized\",right:\"right\"};function ym(t){return ce.isInstance(t,ci.$type)}var li={$type:\"Condition\"};function gP(t){return ce.isInstance(t,li.$type)}var Ic={$type:\"Conjunction\",left:\"left\",right:\"right\"};function xm(t){return ce.isInstance(t,Ic.$type)}var ui={$type:\"CrossReference\",cardinality:\"cardinality\",deprecatedSyntax:\"deprecatedSyntax\",isMulti:\"isMulti\",terminal:\"terminal\",type:\"type\"};function Ur(t){return ce.isInstance(t,ui.$type)}var Sc={$type:\"Disjunction\",left:\"left\",right:\"right\"};function Tm(t){return ce.isInstance(t,Sc.$type)}var cf={$type:\"EndOfFile\",cardinality:\"cardinality\"};function wm(t){return ce.isInstance(t,cf.$type)}var kn={$type:\"Grammar\",imports:\"imports\",interfaces:\"interfaces\",isDeclared:\"isDeclared\",name:\"name\",rules:\"rules\",types:\"types\"};function yP(t){return ce.isInstance(t,kn.$type)}var lf={$type:\"GrammarImport\",path:\"path\"};function xP(t){return ce.isInstance(t,lf.$type)}var eo={$type:\"Group\",cardinality:\"cardinality\",elements:\"elements\",guardCondition:\"guardCondition\",predicate:\"predicate\"};function fi(t){return ce.isInstance(t,eo.$type)}var uf={$type:\"InferredType\",name:\"name\"};function Dc(t){return ce.isInstance(t,uf.$type)}var nn={$type:\"InfixRule\",call:\"call\",dataType:\"dataType\",inferredType:\"inferredType\",name:\"name\",operators:\"operators\",parameters:\"parameters\",returnType:\"returnType\"};function di(t){return ce.isInstance(t,nn.$type)}var Nc={$type:\"InfixRuleOperatorList\",associativity:\"associativity\",operators:\"operators\"};function TP(t){return ce.isInstance(t,Nc.$type)}var ff={$type:\"InfixRuleOperators\",precedences:\"precedences\"};function wP(t){return ce.isInstance(t,ff.$type)}var fs={$type:\"Interface\",attributes:\"attributes\",name:\"name\",superTypes:\"superTypes\"};function bm(t){return ce.isInstance(t,fs.$type)}var ds={$type:\"Keyword\",cardinality:\"cardinality\",predicate:\"predicate\",value:\"value\"};function vr(t){return ce.isInstance(t,ds.$type)}var ps={$type:\"NamedArgument\",calledByName:\"calledByName\",parameter:\"parameter\",value:\"value\"};function bP(t){return ce.isInstance(t,ps.$type)}var to={$type:\"NegatedToken\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\",terminal:\"terminal\"};function _m(t){return ce.isInstance(t,to.$type)}var df={$type:\"Negation\",value:\"value\"};function Em(t){return ce.isInstance(t,df.$type)}var pf={$type:\"NumberLiteral\",value:\"value\"};function _P(t){return ce.isInstance(t,pf.$type)}var hs={$type:\"Parameter\",name:\"name\"};function EP(t){return ce.isInstance(t,hs.$type)}var hf={$type:\"ParameterReference\",parameter:\"parameter\"};function vm(t){return ce.isInstance(t,hf.$type)}var $r={$type:\"ParserRule\",dataType:\"dataType\",definition:\"definition\",entry:\"entry\",fragment:\"fragment\",inferredType:\"inferredType\",name:\"name\",parameters:\"parameters\",returnType:\"returnType\"};function Ot(t){return ce.isInstance(t,$r.$type)}var Cc={$type:\"ReferenceType\",isMulti:\"isMulti\",referenceType:\"referenceType\"};function Rm(t){return ce.isInstance(t,Cc.$type)}var ro={$type:\"RegexToken\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\",regex:\"regex\"};function Am(t){return ce.isInstance(t,ro.$type)}var mf={$type:\"ReturnType\",name:\"name\"};function km(t){return ce.isInstance(t,mf.$type)}var no={$type:\"RuleCall\",arguments:\"arguments\",cardinality:\"cardinality\",predicate:\"predicate\",rule:\"rule\"};function Br(t){return ce.isInstance(t,no.$type)}var ms={$type:\"SimpleType\",primitiveType:\"primitiveType\",stringType:\"stringType\",typeRef:\"typeRef\"};function Tf(t){return ce.isInstance(t,ms.$type)}var gf={$type:\"StringLiteral\",value:\"value\"};function vP(t){return ce.isInstance(t,gf.$type)}var io={$type:\"TerminalAlternatives\",cardinality:\"cardinality\",elements:\"elements\",lookahead:\"lookahead\",parenthesized:\"parenthesized\"};function Im(t){return ce.isInstance(t,io.$type)}var ar={$type:\"TerminalElement\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\"};function RP(t){return ce.isInstance(t,ar.$type)}var oo={$type:\"TerminalGroup\",cardinality:\"cardinality\",elements:\"elements\",lookahead:\"lookahead\",parenthesized:\"parenthesized\"};function Sm(t){return ce.isInstance(t,oo.$type)}var In={$type:\"TerminalRule\",definition:\"definition\",fragment:\"fragment\",hidden:\"hidden\",name:\"name\",type:\"type\"};function Kt(t){return ce.isInstance(t,In.$type)}var so={$type:\"TerminalRuleCall\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\",rule:\"rule\"};function wf(t){return ce.isInstance(t,so.$type)}var Pc={$type:\"Type\",name:\"name\",type:\"type\"};function bf(t){return ce.isInstance(t,Pc.$type)}var ao={$type:\"TypeAttribute\",defaultValue:\"defaultValue\",isOptional:\"isOptional\",name:\"name\",type:\"type\"};function AP(t){return ce.isInstance(t,ao.$type)}var co={$type:\"TypeDefinition\"};function kP(t){return ce.isInstance(t,co.$type)}var yf={$type:\"UnionType\",types:\"types\"};function Nm(t){return ce.isInstance(t,yf.$type)}var Oc={$type:\"UnorderedGroup\",cardinality:\"cardinality\",elements:\"elements\"};function _f(t){return ce.isInstance(t,Oc.$type)}var lo={$type:\"UntilToken\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\",terminal:\"terminal\"};function Cm(t){return ce.isInstance(t,lo.$type)}var uo={$type:\"ValueLiteral\"};function IP(t){return ce.isInstance(t,uo.$type)}var gs={$type:\"Wildcard\",cardinality:\"cardinality\",lookahead:\"lookahead\",parenthesized:\"parenthesized\"};function Pm(t){return ce.isInstance(t,gs.$type)}var ys=class extends Ji{constructor(){super(...arguments),this.types={AbstractElement:{name:sr.$type,properties:{cardinality:{name:sr.cardinality}},superTypes:[]},AbstractParserRule:{name:Ac.$type,properties:{},superTypes:[us.$type,yr.$type]},AbstractRule:{name:us.$type,properties:{},superTypes:[]},AbstractType:{name:yr.$type,properties:{},superTypes:[]},Action:{name:si.$type,properties:{cardinality:{name:si.cardinality},feature:{name:si.feature},inferredType:{name:si.inferredType},operator:{name:si.operator},type:{name:si.type,referenceType:yr.$type}},superTypes:[sr.$type]},Alternatives:{name:kc.$type,properties:{cardinality:{name:kc.cardinality},elements:{name:kc.elements,defaultValue:[]}},superTypes:[sr.$type]},ArrayLiteral:{name:of.$type,properties:{elements:{name:of.elements,defaultValue:[]}},superTypes:[uo.$type]},ArrayType:{name:sf.$type,properties:{elementType:{name:sf.elementType}},superTypes:[co.$type]},Assignment:{name:ai.$type,properties:{cardinality:{name:ai.cardinality},feature:{name:ai.feature},operator:{name:ai.operator},predicate:{name:ai.predicate},terminal:{name:ai.terminal}},superTypes:[sr.$type]},BooleanLiteral:{name:af.$type,properties:{true:{name:af.true,defaultValue:!1}},superTypes:[li.$type,uo.$type]},CharacterRange:{name:ci.$type,properties:{cardinality:{name:ci.cardinality},left:{name:ci.left},lookahead:{name:ci.lookahead},parenthesized:{name:ci.parenthesized,defaultValue:!1},right:{name:ci.right}},superTypes:[ar.$type]},Condition:{name:li.$type,properties:{},superTypes:[]},Conjunction:{name:Ic.$type,properties:{left:{name:Ic.left},right:{name:Ic.right}},superTypes:[li.$type]},CrossReference:{name:ui.$type,properties:{cardinality:{name:ui.cardinality},deprecatedSyntax:{name:ui.deprecatedSyntax,defaultValue:!1},isMulti:{name:ui.isMulti,defaultValue:!1},terminal:{name:ui.terminal},type:{name:ui.type,referenceType:yr.$type}},superTypes:[sr.$type]},Disjunction:{name:Sc.$type,properties:{left:{name:Sc.left},right:{name:Sc.right}},superTypes:[li.$type]},EndOfFile:{name:cf.$type,properties:{cardinality:{name:cf.cardinality}},superTypes:[sr.$type]},Grammar:{name:kn.$type,properties:{imports:{name:kn.imports,defaultValue:[]},interfaces:{name:kn.interfaces,defaultValue:[]},isDeclared:{name:kn.isDeclared,defaultValue:!1},name:{name:kn.name},rules:{name:kn.rules,defaultValue:[]},types:{name:kn.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:lf.$type,properties:{path:{name:lf.path}},superTypes:[]},Group:{name:eo.$type,properties:{cardinality:{name:eo.cardinality},elements:{name:eo.elements,defaultValue:[]},guardCondition:{name:eo.guardCondition},predicate:{name:eo.predicate}},superTypes:[sr.$type]},InferredType:{name:uf.$type,properties:{name:{name:uf.name}},superTypes:[yr.$type]},InfixRule:{name:nn.$type,properties:{call:{name:nn.call},dataType:{name:nn.dataType},inferredType:{name:nn.inferredType},name:{name:nn.name},operators:{name:nn.operators},parameters:{name:nn.parameters,defaultValue:[]},returnType:{name:nn.returnType,referenceType:yr.$type}},superTypes:[Ac.$type]},InfixRuleOperatorList:{name:Nc.$type,properties:{associativity:{name:Nc.associativity},operators:{name:Nc.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:ff.$type,properties:{precedences:{name:ff.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:fs.$type,properties:{attributes:{name:fs.attributes,defaultValue:[]},name:{name:fs.name},superTypes:{name:fs.superTypes,defaultValue:[],referenceType:yr.$type}},superTypes:[yr.$type]},Keyword:{name:ds.$type,properties:{cardinality:{name:ds.cardinality},predicate:{name:ds.predicate},value:{name:ds.value}},superTypes:[sr.$type]},NamedArgument:{name:ps.$type,properties:{calledByName:{name:ps.calledByName,defaultValue:!1},parameter:{name:ps.parameter,referenceType:hs.$type},value:{name:ps.value}},superTypes:[]},NegatedToken:{name:to.$type,properties:{cardinality:{name:to.cardinality},lookahead:{name:to.lookahead},parenthesized:{name:to.parenthesized,defaultValue:!1},terminal:{name:to.terminal}},superTypes:[ar.$type]},Negation:{name:df.$type,properties:{value:{name:df.value}},superTypes:[li.$type]},NumberLiteral:{name:pf.$type,properties:{value:{name:pf.value}},superTypes:[uo.$type]},Parameter:{name:hs.$type,properties:{name:{name:hs.name}},superTypes:[]},ParameterReference:{name:hf.$type,properties:{parameter:{name:hf.parameter,referenceType:hs.$type}},superTypes:[li.$type]},ParserRule:{name:$r.$type,properties:{dataType:{name:$r.dataType},definition:{name:$r.definition},entry:{name:$r.entry,defaultValue:!1},fragment:{name:$r.fragment,defaultValue:!1},inferredType:{name:$r.inferredType},name:{name:$r.name},parameters:{name:$r.parameters,defaultValue:[]},returnType:{name:$r.returnType,referenceType:yr.$type}},superTypes:[Ac.$type]},ReferenceType:{name:Cc.$type,properties:{isMulti:{name:Cc.isMulti,defaultValue:!1},referenceType:{name:Cc.referenceType}},superTypes:[co.$type]},RegexToken:{name:ro.$type,properties:{cardinality:{name:ro.cardinality},lookahead:{name:ro.lookahead},parenthesized:{name:ro.parenthesized,defaultValue:!1},regex:{name:ro.regex}},superTypes:[ar.$type]},ReturnType:{name:mf.$type,properties:{name:{name:mf.name}},superTypes:[]},RuleCall:{name:no.$type,properties:{arguments:{name:no.arguments,defaultValue:[]},cardinality:{name:no.cardinality},predicate:{name:no.predicate},rule:{name:no.rule,referenceType:us.$type}},superTypes:[sr.$type]},SimpleType:{name:ms.$type,properties:{primitiveType:{name:ms.primitiveType},stringType:{name:ms.stringType},typeRef:{name:ms.typeRef,referenceType:yr.$type}},superTypes:[co.$type]},StringLiteral:{name:gf.$type,properties:{value:{name:gf.value}},superTypes:[uo.$type]},TerminalAlternatives:{name:io.$type,properties:{cardinality:{name:io.cardinality},elements:{name:io.elements,defaultValue:[]},lookahead:{name:io.lookahead},parenthesized:{name:io.parenthesized,defaultValue:!1}},superTypes:[ar.$type]},TerminalElement:{name:ar.$type,properties:{cardinality:{name:ar.cardinality},lookahead:{name:ar.lookahead},parenthesized:{name:ar.parenthesized,defaultValue:!1}},superTypes:[sr.$type]},TerminalGroup:{name:oo.$type,properties:{cardinality:{name:oo.cardinality},elements:{name:oo.elements,defaultValue:[]},lookahead:{name:oo.lookahead},parenthesized:{name:oo.parenthesized,defaultValue:!1}},superTypes:[ar.$type]},TerminalRule:{name:In.$type,properties:{definition:{name:In.definition},fragment:{name:In.fragment,defaultValue:!1},hidden:{name:In.hidden,defaultValue:!1},name:{name:In.name},type:{name:In.type}},superTypes:[us.$type]},TerminalRuleCall:{name:so.$type,properties:{cardinality:{name:so.cardinality},lookahead:{name:so.lookahead},parenthesized:{name:so.parenthesized,defaultValue:!1},rule:{name:so.rule,referenceType:In.$type}},superTypes:[ar.$type]},Type:{name:Pc.$type,properties:{name:{name:Pc.name},type:{name:Pc.type}},superTypes:[yr.$type]},TypeAttribute:{name:ao.$type,properties:{defaultValue:{name:ao.defaultValue},isOptional:{name:ao.isOptional,defaultValue:!1},name:{name:ao.name},type:{name:ao.type}},superTypes:[]},TypeDefinition:{name:co.$type,properties:{},superTypes:[]},UnionType:{name:yf.$type,properties:{types:{name:yf.types,defaultValue:[]}},superTypes:[co.$type]},UnorderedGroup:{name:Oc.$type,properties:{cardinality:{name:Oc.cardinality},elements:{name:Oc.elements,defaultValue:[]}},superTypes:[sr.$type]},UntilToken:{name:lo.$type,properties:{cardinality:{name:lo.cardinality},lookahead:{name:lo.lookahead},parenthesized:{name:lo.parenthesized,defaultValue:!1},terminal:{name:lo.terminal}},superTypes:[ar.$type]},ValueLiteral:{name:uo.$type,properties:{},superTypes:[]},Wildcard:{name:gs.$type,properties:{cardinality:{name:gs.cardinality},lookahead:{name:gs.lookahead},parenthesized:{name:gs.parenthesized,defaultValue:!1}},superTypes:[ar.$type]}}}},ce=new ys;function SP(t){let e=t,r=!1;for(;e;){let n=An(e.grammarSource,Ot);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}function fo(t){return new rn(t,e=>Dr(e)?e.content:[],{includeRoot:!0})}function NP(t){return fo(t).filter(ni)}function Lm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function xs(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function po(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var on;(function(t){t[t.Before=0]=\"Before\",t[t.After=1]=\"After\",t[t.OverlapFront=2]=\"OverlapFront\",t[t.OverlapBack=3]=\"OverlapBack\",t[t.Inside=4]=\"Inside\",t[t.Outside=5]=\"Outside\"})(on||(on={}));function Bb(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return on.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return on.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?on.Inside:r?on.OverlapBack:n?on.OverlapFront:on.Outside}function hm(t,e){return Bb(t,e)>on.After}var Ef=/^[\\w\\p{L}]$/u;function CP(t,e,r=Ef){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Mm(t,e)}}function Dm(t,e){if(t){let r=Gb(t,!0);if(r&&Om(r,e))return r;if(vc(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(Om(o,e))return o}}}}function Om(t,e){return ni(t)&&e.includes(t.tokenType.name)}function Mm(t,e){if(ni(t))return t;if(Dr(t)){let r=Xb(t,e,!1);if(r)return Mm(r,e)}}function Hb(t,e){if(ni(t))return t;if(Dr(t)){let r=Xb(t,e,!0);if(r)return Hb(r,e)}}function Xb(t,e,r){let n=0,i=t.content.length-1,o;for(;n<=i;){let s=Math.floor((n+i)/2),a=t.content[s];if(a.offset<=e&&a.end>e)return a;a.end<=e?(o=r?a:void 0,n=s+1):i=s-1}return o}function Gb(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function PP(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let o=r.content[n];if(e||!o.hidden)return o}t=r}}function OP(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.container;){let i=t.container,o=n??i.content.indexOf(t);if(o===0?(t=i,n=void 0):(n=o-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function LP(t,e){let r=DP(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function DP(t,e){let r=Ub(t),n=Ub(e),i;for(let o=0;o<r.length&&o<n.length;o++){let s=r[o],a=n[o];if(s.parent===a.parent)i={parent:s.parent,a:s.index,b:a.index};else break}return i}function Ub(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}var _s={};Rn(_s,{findAssignment:()=>Zm,findNameAssignment:()=>If,findNodeForKeyword:()=>Ym,findNodeForProperty:()=>Xc,findNodesForKeyword:()=>BP,findNodesForKeywordInternal:()=>Km,findNodesForProperty:()=>qm,getActionAtElement:()=>Jb,getActionType:()=>e_,getAllReachableRules:()=>Hc,getAllRulesUsedForCrossReferences:()=>UP,getCrossReferenceTerminal:()=>zm,getEntryRule:()=>Vb,getExplicitRuleType:()=>Sf,getHiddenRules:()=>Yb,getRuleType:()=>Jm,getRuleTypeName:()=>zP,getTypeName:()=>hi,isArrayCardinality:()=>XP,isArrayOperator:()=>GP,isCommentTerminal:()=>Wm,isDataType:()=>jP,isDataTypeRule:()=>Gc,isOptionalCardinality:()=>HP,terminalRegex:()=>ws});var ho=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function sn(t,e=\"Error: Got unexpected value.\"){throw new Error(e)}function jb(t,e=\"Error: Condition is violated.\"){if(!t)throw new Error(e)}var kf={};Rn(kf,{NEWLINE_REGEXP:()=>Bm,escapeRegExp:()=>pi,getTerminalParts:()=>FP,isMultilineComment:()=>Hm,isWhitespace:()=>Bc,partialMatches:()=>Xm,partialRegExp:()=>qb,whitespaceCharacters:()=>Wb});function ue(t){return t.charCodeAt(0)}function Rf(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Ts(t,e){if(t[e]===!0)throw\"duplicate flag \"+e;let r=t[e];t[e]=!0}function mo(t){if(t===void 0)throw Error(\"Internal Error - Should never get here!\");return!0}function $c(){throw Error(\"Internal Error - Should never get here!\")}function $m(t){return t.type===\"Character\"}var Fc=[];for(let t=ue(\"0\");t<=ue(\"9\");t++)Fc.push(t);var Uc=[ue(\"_\")].concat(Fc);for(let t=ue(\"a\");t<=ue(\"z\");t++)Uc.push(t);for(let t=ue(\"A\");t<=ue(\"Z\");t++)Uc.push(t);var Fm=[ue(\" \"),ue(\"\\f\"),ue(`\n`),ue(\"\\r\"),ue(\"\t\"),ue(\"\\v\"),ue(\"\t\"),ue(\"\\xA0\"),ue(\"\\u1680\"),ue(\"\\u2000\"),ue(\"\\u2001\"),ue(\"\\u2002\"),ue(\"\\u2003\"),ue(\"\\u2004\"),ue(\"\\u2005\"),ue(\"\\u2006\"),ue(\"\\u2007\"),ue(\"\\u2008\"),ue(\"\\u2009\"),ue(\"\\u200A\"),ue(\"\\u2028\"),ue(\"\\u2029\"),ue(\"\\u202F\"),ue(\"\\u205F\"),ue(\"\\u3000\"),ue(\"\\uFEFF\")];var MP=/[0-9a-fA-F]/,Af=/[0-9]/,$P=/[1-9]/,go=class{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 r=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\":Ts(n,\"global\");break;case\"i\":Ts(n,\"ignoreCase\");break;case\"m\":Ts(n,\"multiLine\");break;case\"u\":Ts(n,\"unicode\");break;case\"y\":Ts(n,\"sticky\");break}if(this.idx!==this.input.length)throw Error(\"Redundant input: \"+this.input.substring(this.idx));return{type:\"Pattern\",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()===\"|\";)this.consumeChar(\"|\"),e.push(this.alternative());return{type:\"Disjunction\",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:\"Alternative\",value:e,loc:this.loc(r)}}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 r;switch(this.popChar()){case\"=\":r=\"Lookahead\";break;case\"!\":r=\"NegativeLookahead\";break;case\"<\":{switch(this.popChar()){case\"=\":r=\"Lookbehind\";break;case\"!\":r=\"NegativeLookbehind\"}break}}mo(r);let n=this.disjunction();return this.consumeChar(\")\"),{type:r,value:n,loc:this.loc(e)}}return $c()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case\"*\":r={atLeast:0,atMost:1/0};break;case\"+\":r={atLeast:1,atMost:1/0};break;case\"?\":r={atLeast:0,atMost:1};break;case\"{\":let i=this.integerIncludingZero();switch(this.popChar()){case\"}\":r={atLeast:i,atMost:i};break;case\",\":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar(\"}\");break}if(e===!0&&r===void 0)return;mo(r);break}if(!(e===!0&&r===void 0)&&mo(r))return this.peekChar(0)===\"?\"?(this.consumeChar(\"?\"),r.greedy=!1):r.greedy=!0,r.type=\"Quantifier\",r.loc=this.loc(n),r}atom(){let e,r=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()),mo(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):$c()}dotAll(){return this.consumeChar(\".\"),{type:\"Set\",complement:!0,value:[ue(`\n`),ue(\"\\r\"),ue(\"\\u2028\"),ue(\"\\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,r=!1;switch(this.popChar()){case\"d\":e=Fc;break;case\"D\":e=Fc,r=!0;break;case\"s\":e=Fm;break;case\"S\":e=Fm,r=!0;break;case\"w\":e=Uc;break;case\"W\":e=Uc,r=!0;break}return mo(e)?{type:\"Set\",value:e,complement:r}:$c()}controlEscapeAtom(){let e;switch(this.popChar()){case\"f\":e=ue(\"\\f\");break;case\"n\":e=ue(`\n`);break;case\"r\":e=ue(\"\\r\");break;case\"t\":e=ue(\"\t\");break;case\"v\":e=ue(\"\\v\");break}return mo(e)?{type:\"Character\",value:e}:$c()}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:ue(\"\\0\")}}hexEscapeSequenceAtom(){return this.consumeChar(\"x\"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(\"u\"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:\"Character\",value:ue(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`\n`:case\"\\r\":case\"\\u2028\":case\"\\u2029\":case\"\\\\\":case\"]\":throw Error(\"TBD\");default:let e=this.popChar();return{type:\"Character\",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar(\"[\"),this.peekChar(0)===\"^\"&&(this.consumeChar(\"^\"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type===\"Character\";if($m(n)&&this.isRangeDash()){this.consumeChar(\"-\");let o=this.classAtom(),s=o.type===\"Character\";if($m(o)){if(o.value<n.value)throw Error(\"Range out of order in character class\");e.push({from:n.value,to:o.value})}else Rf(n.value,e),e.push(ue(\"-\")),Rf(o.value,e)}else Rf(n.value,e)}return this.consumeChar(\"]\"),{type:\"Set\",complement:r,value:e}}classAtom(){switch(this.peekChar()){case\"]\":case`\n`: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:ue(\"\\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;this.consumeChar(\"(\"),this.peekChar(0)===\"?\"?(this.consumeChar(\"?\"),this.consumeChar(\":\"),e=!1):this.groupIdx++;let r=this.disjunction();this.consumeChar(\")\");let n={type:\"Group\",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if($P.test(e)===!1)throw Error(\"Expecting a positive integer\");for(;Af.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Af.test(e)===!1)throw Error(\"Expecting an integer\");for(;Af.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`\n`: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:ue(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 Af.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case\"]\":case`\n`: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`\n`:case\"\\r\":case\"\\u2028\":case\"\\u2029\":return!1;default:return!0}}parseHexDigits(e){let r=\"\";for(let i=0;i<e;i++){let o=this.popChar();if(MP.test(o)===!1)throw Error(\"Expecting a HexDecimal digits\");r+=o}return{type:\"Character\",value:parseInt(r,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}}};var an=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}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){}};var Bm=/\\r?\\n/gm,zb=new go,Um=class extends an{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 r=String.fromCharCode(e.value);if(!this.multiline&&r===`\n`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=pi(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`\n`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type===\"Group\"&&e.quantifier||super.visitChildren(e)}},yo=new Um;function FP(t){try{typeof t!=\"string\"&&(t=t.source),t=`/${t}/`;let e=zb.pattern(t),r=[];for(let n of e.value.value)yo.reset(t),yo.visit(n),r.push({start:yo.startRegexp,end:yo.endRegex});return r}catch{return[]}}function Hm(t){try{return typeof t==\"string\"&&(t=new RegExp(t)),t=t.toString(),yo.reset(t),yo.visit(zb.pattern(t)),yo.multiline}catch{return!1}}var Wb=`\\f\n\\r\t\\v \\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF`.split(\"\");function Bc(t){let e=typeof t==\"string\"?new RegExp(t):t;return Wb.some(r=>e.test(r))}function pi(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Xm(t,e){let r=qb(t),n=e.match(r);return!!n&&n[0].length>0}function qb(t){typeof t==\"string\"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o=\"\",s;function a(l){o+=r.substr(n,l),n+=l}function c(l){o+=\"(?:\"+r.substr(n,l)+\"|$)\",n+=l}for(;n<r.length;)switch(r[n]){case\"\\\\\":switch(r[n+1]){case\"c\":c(3);break;case\"x\":c(4);break;case\"u\":e.unicode?r[n+2]===\"{\"?c(r.indexOf(\"}\",n)-n+1):c(6):c(2);break;case\"p\":case\"P\":e.unicode?c(r.indexOf(\"}\",n)-n+1):c(2);break;case\"k\":c(r.indexOf(\">\",n)-n+1);break;default:c(2);break}break;case\"[\":s=/\\[(?:\\\\.|.)*?\\]/g,s.lastIndex=n,s=s.exec(r)||[],c(s[0].length);break;case\"|\":case\"^\":case\"$\":case\"*\":case\"+\":case\"?\":a(1);break;case\"{\":s=/\\{\\d+,?\\d*\\}/g,s.lastIndex=n,s=s.exec(r),s?a(s[0].length):c(1);break;case\"(\":if(r[n+1]===\"?\")switch(r[n+2]){case\":\":o+=\"(?:\",n+=3,o+=i()+\"|$)\";break;case\"=\":o+=\"(?=\",n+=3,o+=i()+\")\";break;case\"!\":s=n,n+=3,i(),o+=r.substr(s,n-s);break;case\"<\":switch(r[n+3]){case\"=\":case\"!\":s=n,n+=4,i(),o+=r.substr(s,n-s);break;default:a(r.indexOf(\">\",n)-n+1),o+=i()+\"|$)\";break}break}else a(1),o+=i()+\"|$)\";break;case\")\":return++n,o;default:c(1);break}return o}return new RegExp(i(),t.flags)}function Vb(t){return t.rules.find(e=>Ot(e)&&e.entry)}function Yb(t){return t.rules.filter(e=>Kt(e)&&e.hidden)}function Hc(t,e){let r=new Set,n=Vb(t);if(!n)return new Set(t.rules);let i=[n].concat(Yb(t));for(let s of i)Kb(s,r,e);let o=new Set;for(let s of t.rules)(r.has(s.name)||Kt(s)&&s.hidden)&&o.add(s);return o}function Kb(t,e,r){e.add(t.name),Mr(t).forEach(n=>{if(Br(n)||r&&wf(n)){let i=n.rule.ref;i&&!e.has(i.name)&&Kb(i,e,r)}})}function UP(t){let e=new Set;return Mr(t).forEach(r=>{Ur(r)&&(Ot(r.type.ref)&&e.add(r.type.ref),Dc(r.type.ref)&&Ot(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function zm(t){if(t.terminal)return t.terminal;if(t.type.ref)return If(t.type.ref)?.terminal}function Wm(t){return t.hidden&&!Bc(ws(t))}function qm(t,e){return!t||!e?[]:Vm(t,e,t.astNode,!0)}function Xc(t,e,r){if(!t||!e)return;let n=Vm(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Vm(t,e,r,n){if(!n){let i=An(t.grammarSource,Fr);if(i&&i.feature===e)return[t]}return Dr(t)&&t.astNode===r?t.content.flatMap(i=>Vm(i,e,r,!1)):[]}function BP(t,e){return t?Km(t,e,t?.astNode):[]}function Ym(t,e,r){if(!t)return;let n=Km(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Km(t,e,r){if(t.astNode!==r)return[];if(vr(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=fo(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?vr(s.grammarSource)&&s.grammarSource.value===e&&o.push(s):n.prune()}while(!i.done);return o}function Zm(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=An(t.grammarSource,Fr);if(r)return r;t=t.container}}function If(t){let e=t;return Dc(e)&&(Nn(e.$container)?e=e.$container.$container:Sn(e.$container)?e=e.$container:sn(e.$container)),Zb(t,e,new Map)}function Zb(t,e,r){function n(i,o){let s;return An(i,Fr)||(s=Zb(o,o,r)),r.set(t,s),s}if(r.has(t))return r.get(t);r.set(t,void 0);for(let i of Mr(e)){if(Fr(i)&&i.feature.toLowerCase()===\"name\")return r.set(t,i),i;if(Br(i)&&Ot(i.rule.ref))return n(i,i.rule.ref);if(Tf(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function Jb(t){let e=t.$container;if(fi(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Nn(o))return o;{let s=Mr(r[i]).find(Nn);if(s)return s}}}if(Lc(e))return Jb(e)}function HP(t,e){return t===\"?\"||t===\"*\"||fi(e)&&!!e.guardCondition}function XP(t){return t===\"*\"||t===\"+\"}function GP(t){return t===\"+=\"}function Gc(t){return Qb(t,new Set)}function Qb(t,e){if(e.has(t))return!0;e.add(t);for(let r of Mr(t))if(Br(r)){if(!r.rule.ref||Ot(r.rule.ref)&&!Qb(r.rule.ref,e)||di(r.rule.ref))return!1}else{if(Fr(r))return!1;if(Nn(r))return!1}return!!t.definition}function jP(t){return jm(t.type,new Set)}function jm(t,e){if(e.has(t))return!0;if(e.add(t),mm(t))return!1;if(Rm(t))return!1;if(Nm(t))return t.types.every(r=>jm(r,e));if(Tf(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return bf(r)?jm(r.type,e):!1}else return!1}else return!1}function Sf(t){if(!Kt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e)return e.name}}}function hi(t){if(Sn(t))return Ot(t)&&Gc(t)?t.name:Sf(t)??t.name;if(bm(t)||bf(t)||km(t))return t.name;if(Nn(t)){let e=e_(t);if(e)return e}else if(Dc(t))return t.name;throw new Error(\"Cannot get name of Unknown Type\")}function e_(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return hi(t.type.ref)}function zP(t){return Kt(t)?t.type?.name??\"string\":Ot(t)&&Gc(t)?t.name:Sf(t)??t.name}function Jm(t){return Kt(t)?t.type?.name??\"string\":Sf(t)??t.name}function ws(t){let e={s:!1,i:!1,u:!1},r=bs(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(\"\");return new RegExp(r,n)}var Qm=/[\\s\\S]/.source;function bs(t,e){if(Im(t))return WP(t);if(Sm(t))return qP(t);if(ym(t))return KP(t);if(wf(t)){let r=t.rule.ref;if(!r)throw new Error(\"Missing rule reference.\");return Cn(bs(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(_m(t))return YP(t);if(Cm(t))return VP(t);if(Am(t)){let r=t.regex.lastIndexOf(\"/\"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes(\"i\"),e.s=i.includes(\"s\"),e.u=i.includes(\"u\")),Cn(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Pm(t))return Cn(Qm,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function WP(t){return Cn(t.elements.map(e=>bs(e)).join(\"|\"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function qP(t){return Cn(t.elements.map(e=>bs(e)).join(\"\"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function VP(t){return Cn(`${Qm}*?${bs(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function YP(t){return Cn(`(?!${bs(t.terminal)})${Qm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function KP(t){return t.right?Cn(`[${Gm(t.left)}-${Gm(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Cn(Gm(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Gm(t){return pi(t.value)}function Cn(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?\"\":\"?:\")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function eg(t){let e=[],r=t.Grammar;for(let n of r.rules)Kt(n)&&Wm(n)&&Hm(ws(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Ef}}function Es(t){console&&console.error&&console.error(`Error: ${t}`)}function jc(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function zc(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Wc(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function ZP(t){return JP(t)?t.LABEL:t.name}function JP(t){return typeof t.LABEL==\"string\"&&t.LABEL!==\"\"}var xr=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(r=>{r.accept(e)})}},Ye=class extends xr{constructor(e){super([]),this.idx=1,Object.assign(this,cn(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Zt=class extends xr{constructor(e){super(e.definition),this.orgText=\"\",Object.assign(this,cn(e))}},ot=class extends xr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,cn(e))}},Ke=class extends xr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},st=class extends xr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},at=class extends xr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},De=class extends xr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},et=class extends xr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},tt=class extends xr{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,Object.assign(this,cn(e))}},Ne=class{constructor(e){this.idx=1,Object.assign(this,cn(e))}accept(e){e.visit(this)}};function Nf(t){return t.map(vs)}function vs(t){function e(r){return r.map(vs)}if(t instanceof Ye){let r={type:\"NonTerminal\",name:t.nonTerminalName,idx:t.idx};return typeof t.label==\"string\"&&(r.label=t.label),r}else{if(t instanceof ot)return{type:\"Alternative\",definition:e(t.definition)};if(t instanceof Ke)return{type:\"Option\",idx:t.idx,definition:e(t.definition)};if(t instanceof st)return{type:\"RepetitionMandatory\",idx:t.idx,definition:e(t.definition)};if(t instanceof at)return{type:\"RepetitionMandatoryWithSeparator\",idx:t.idx,separator:vs(new Ne({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof et)return{type:\"RepetitionWithSeparator\",idx:t.idx,separator:vs(new Ne({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:\"Repetition\",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:\"Alternation\",idx:t.idx,definition:e(t.definition)};if(t instanceof Ne){let r={type:\"Terminal\",name:t.terminalType.name,label:ZP(t.terminalType),idx:t.idx};typeof t.label==\"string\"&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=n instanceof RegExp?n.source:n),r}else{if(t instanceof Zt)return{type:\"Rule\",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error(\"non exhaustive match\")}}}function cn(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}var Jt=class{visit(e){let r=e;switch(r.constructor){case Ye:return this.visitNonTerminal(r);case ot:return this.visitAlternative(r);case Ke:return this.visitOption(r);case st:return this.visitRepetitionMandatory(r);case at:return this.visitRepetitionMandatoryWithSeparator(r);case et:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case tt:return this.visitAlternation(r);case Ne:return this.visitTerminal(r);case Zt:return this.visitRule(r);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 tg(t){return t instanceof ot||t instanceof Ke||t instanceof De||t instanceof st||t instanceof at||t instanceof et||t instanceof Ne||t instanceof Zt}function xo(t,e=[]){return t instanceof Ke||t instanceof De||t instanceof et?!0:t instanceof tt?t.definition.some(n=>xo(n,e)):t instanceof Ye&&e.includes(t)?!1:t instanceof xr?(t instanceof Ye&&e.push(t),t.definition.every(n=>xo(n,e))):!1}function rg(t){return t instanceof tt}function cr(t){if(t instanceof Ye)return\"SUBRULE\";if(t instanceof Ke)return\"OPTION\";if(t instanceof tt)return\"OR\";if(t instanceof st)return\"AT_LEAST_ONE\";if(t instanceof at)return\"AT_LEAST_ONE_SEP\";if(t instanceof et)return\"MANY_SEP\";if(t instanceof De)return\"MANY\";if(t instanceof Ne)return\"CONSUME\";throw Error(\"non exhaustive match\")}var Pn=class{walk(e,r=[]){e.definition.forEach((n,i)=>{let o=e.definition.slice(i+1);if(n instanceof Ye)this.walkProdRef(n,o,r);else if(n instanceof Ne)this.walkTerminal(n,o,r);else if(n instanceof ot)this.walkFlat(n,o,r);else if(n instanceof Ke)this.walkOption(n,o,r);else if(n instanceof st)this.walkAtLeastOne(n,o,r);else if(n instanceof at)this.walkAtLeastOneSep(n,o,r);else if(n instanceof et)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof tt)this.walkOr(n,o,r);else throw Error(\"non exhaustive match\")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ke({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=t_(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ke({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=t_(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);e.definition.forEach(o=>{let s=new ot({definition:[o]});this.walk(s,i)})}};function t_(t,e,r){return[new Ke({definition:[new Ne({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function To(t){if(t instanceof Ye)return To(t.referencedRule);if(t instanceof Ne)return tO(t);if(tg(t))return QP(t);if(rg(t))return eO(t);throw Error(\"non exhaustive match\")}function QP(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=xo(o),e=e.concat(To(o)),n=n+1,i=r.length>n;return[...new Set(e)]}function eO(t){let e=t.definition.map(r=>To(r));return[...new Set(e.flat())]}function tO(t){return[t.terminalType]}var Cf=\"_~IN~_\";var ng=class extends Pn{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=rO(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new ot({definition:o}),a=To(s);this.follows[i]=a}};function r_(t){let e={};return t.forEach(r=>{let n=new ng(r).startWalking();Object.assign(e,n)}),e}function rO(t,e){return t.name+e+Cf}var Pf={},nO=new go;function Rs(t){let e=t.toString();if(Pf.hasOwnProperty(e))return Pf[e];{let r=nO.pattern(e);return Pf[e]=r,r}}function n_(){Pf={}}var o_=\"Complement Sets are not supported for first char optimization\",qc=`Unable to use \"first char\" lexer optimizations:\n`;function s_(t,e=!1){try{let r=Rs(t);return ig(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===o_)e&&jc(`${qc}\tUnable to optimize: < ${t.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=\"\";e&&(n=`\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Es(`${qc}\n\tFailed parsing: < ${t.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ig(t,e,r){switch(t.type){case\"Disjunction\":for(let i=0;i<t.value.length;i++)ig(t.value[i],e,r);break;case\"Alternative\":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case\"EndAnchor\":case\"GroupBackReference\":case\"Lookahead\":case\"NegativeLookahead\":case\"Lookbehind\":case\"NegativeLookbehind\":case\"StartAnchor\":case\"WordBoundary\":case\"NonWordBoundary\":continue}let s=o;switch(s.type){case\"Character\":Of(s.value,e,r);break;case\"Set\":if(s.complement===!0)throw Error(o_);s.value.forEach(c=>{if(typeof c==\"number\")Of(c,e,r);else{let l=c;if(r===!0)for(let u=l.from;u<=l.to;u++)Of(u,e,r);else{for(let u=l.from;u<=l.to&&u<As;u++)Of(u,e,r);if(l.to>=As){let u=l.from>=As?l.from:As,f=l.to,d=ln(u),p=ln(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case\"Group\":ig(s.value,e,r);break;default:throw Error(\"Non Exhaustive Match\")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type===\"Group\"&&og(s)===!1||s.type!==\"Group\"&&a===!1)break}break;default:throw Error(\"non exhaustive match!\")}return Object.values(e)}function Of(t,e,r){let n=ln(t);e[n]=n,r===!0&&iO(t,e)}function iO(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=ln(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=ln(i.charCodeAt(0));e[o]=o}}}function i_(t,e){return t.value.find(r=>{if(typeof r==\"number\")return e.includes(r);{let n=r;return e.find(i=>n.from<=i&&i<=n.to)!==void 0}})}function og(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(og):og(t.value):!1}var sg=class extends an{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){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?i_(e,this.targetCharCodes)===void 0&&(this.found=!0):i_(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Lf(t,e){if(e instanceof RegExp){let r=Rs(e),n=new sg(t);return n.visit(r),n.found}else{for(let r of e){let n=r.charCodeAt(0);if(t.includes(n))return!0}return!1}}var wo=\"PATTERN\",ks=\"defaultMode\",Df=\"modes\";function c_(t,e){e=Object.assign({safeMode:!1,positionTracking:\"full\",lineTerminatorCharacters:[\"\\r\",`\n`],tracer:(E,b)=>b()},e);let r=e.tracer;r(\"initCharCodeToOptimizedIndexMap\",()=>{EO()});let n;r(\"Reject Lexer.NA\",()=>{n=t.filter(E=>E[wo]!==ht.NA)});let i=!1,o;r(\"Transform Patterns\",()=>{i=!1,o=n.map(E=>{let b=E[wo];if(b instanceof RegExp){let N=b.source;return N.length===1&&N!==\"^\"&&N!==\"$\"&&N!==\".\"&&!b.ignoreCase?N:N.length===2&&N[0]===\"\\\\\"&&![\"d\",\"D\",\"s\",\"S\",\"t\",\"r\",\"n\",\"t\",\"0\",\"c\",\"b\",\"B\",\"f\",\"v\",\"w\",\"W\"].includes(N[1])?N[1]:a_(b)}else{if(typeof b==\"function\")return i=!0,{exec:b};if(typeof b==\"object\")return i=!0,b;if(typeof b==\"string\"){if(b.length===1)return b;{let N=b.replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\"),F=new RegExp(N);return a_(F)}}else throw Error(\"non exhaustive match\")}})});let s,a,c,l,u;r(\"misc mapping\",()=>{s=n.map(E=>E.tokenTypeIdx),a=n.map(E=>{let b=E.GROUP;if(b!==ht.SKIPPED){if(typeof b==\"string\")return b;if(b===void 0)return!1;throw Error(\"non exhaustive match\")}}),c=n.map(E=>{let b=E.LONGER_ALT;if(b)return Array.isArray(b)?b.map(F=>n.indexOf(F)):[n.indexOf(b)]}),l=n.map(E=>E.PUSH_MODE),u=n.map(E=>Object.hasOwn(E,\"POP_MODE\"))});let f;r(\"Line Terminator Handling\",()=>{let E=g_(e.lineTerminatorCharacters);f=n.map(b=>!1),e.positionTracking!==\"onlyOffset\"&&(f=n.map(b=>Object.hasOwn(b,\"LINE_BREAKS\")?!!b.LINE_BREAKS:m_(b,E)===!1&&Lf(E,b.PATTERN)))});let d,p,m,w;r(\"Misc Mapping #2\",()=>{d=n.map(p_),p=o.map(bO),m=n.reduce((E,b)=>{let N=b.GROUP;return typeof N==\"string\"&&N!==ht.SKIPPED&&(E[N]=[]),E},{}),w=o.map((E,b)=>({pattern:o[b],longerAlt:c[b],canLineTerminator:f[b],isCustom:d[b],short:p[b],group:a[b],push:l[b],pop:u[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let T=!0,_=[];return e.safeMode||r(\"First Char Optimization\",()=>{_=n.reduce((E,b,N)=>{if(typeof b.PATTERN==\"string\"){let F=b.PATTERN.charCodeAt(0),L=ln(F);ag(E,L,w[N])}else if(Array.isArray(b.START_CHARS_HINT)){let F;b.START_CHARS_HINT.forEach(L=>{let j=typeof L==\"string\"?L.charCodeAt(0):L,te=ln(j);F!==te&&(F=te,ag(E,te,w[N]))})}else if(b.PATTERN instanceof RegExp)if(b.PATTERN.unicode)T=!1,e.ensureOptimizations&&Es(`${qc}\tUnable to analyze < ${b.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let F=s_(b.PATTERN,e.ensureOptimizations);F.length===0&&(T=!1),F.forEach(L=>{ag(E,L,w[N])})}else e.ensureOptimizations&&Es(`${qc}\tTokenType: <${b.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),T=!1;return E},[])}),{emptyGroups:m,patternIdxToConfig:w,charCodeToPatternIdxToConfig:_,hasCustom:i,canBeOptimized:T}}function l_(t,e){let r=[],n=sO(t);r=r.concat(n.errors);let i=aO(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(oO(o)),r=r.concat(mO(o)),r=r.concat(gO(o,e)),r=r.concat(yO(o)),r}function oO(t){let e=[],r=t.filter(n=>n[wo]instanceof RegExp);return e=e.concat(lO(r)),e=e.concat(dO(r)),e=e.concat(pO(r)),e=e.concat(hO(r)),e=e.concat(uO(r)),e}function sO(t){let e=t.filter(i=>!Object.hasOwn(i,wo)),r=e.map(i=>({message:\"Token Type: ->\"+i.name+\"<- missing static 'PATTERN' property\",type:pt.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function aO(t){let e=t.filter(i=>{let o=i[wo];return!(o instanceof RegExp)&&typeof o!=\"function\"&&!Object.hasOwn(o,\"exec\")&&typeof o!=\"string\"}),r=e.map(i=>({message:\"Token Type: ->\"+i.name+\"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.\",type:pt.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}var cO=/[^\\\\][$]/;function lO(t){class e extends an{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Rs(o),a=new e;return a.visit(s),a.found}catch{return cO.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:\n\tToken Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.`,type:pt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function uO(t){return t.filter(n=>n.PATTERN.test(\"\")).map(n=>({message:\"Token Type: ->\"+n.name+\"<- static 'PATTERN' must not match an empty string\",type:pt.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var fO=/[^\\\\[][\\^]|^\\^/;function dO(t){class e extends an{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Rs(o),a=new e;return a.visit(s),a.found}catch{return fO.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:\n\tToken Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.`,type:pt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function pO(t){return t.filter(n=>{let i=n[wo];return i instanceof RegExp&&(i.multiline||i.global)}).map(n=>({message:\"Token Type: ->\"+n.name+\"<- static 'PATTERN' may NOT contain global('g') or multiline('m')\",type:pt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function hO(t){let e=[],r=t.map(o=>t.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!e.includes(a)&&a.PATTERN!==ht.NA&&(e.push(a),s.push(a)),s),[]));return r=r.filter(Boolean),r.filter(o=>o.length>1).map(o=>{let s=o.map(c=>c.name);return{message:`The same RegExp pattern ->${o[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(\", \")} <-`,type:pt.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function mO(t){return t.filter(n=>{if(!Object.hasOwn(n,\"GROUP\"))return!1;let i=n.GROUP;return i!==ht.SKIPPED&&i!==ht.NA&&typeof i!=\"string\"}).map(n=>({message:\"Token Type: ->\"+n.name+\"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String\",type:pt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function gO(t,e){return t.filter(i=>i.PUSH_MODE!==void 0&&!e.includes(i.PUSH_MODE)).map(i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:pt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function yO(t){let e=[],r=t.reduce((n,i,o)=>{let s=i.PATTERN;return s===ht.NA||(typeof s==\"string\"?n.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&TO(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return t.forEach((n,i)=>{r.forEach(({str:o,idx:s,tokenType:a})=>{if(i<s&&xO(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:pt.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function xO(t,e){if(e instanceof RegExp){if(wO(e))return!1;let r=e.exec(t);return r!==null&&r.index===0}else{if(typeof e==\"function\")return e(t,0,[],{});if(Object.hasOwn(e,\"exec\"))return e.exec(t,0,[],{});if(typeof e==\"string\")return e===t;throw Error(\"non exhaustive match\")}}function TO(t){return[\".\",\"\\\\\",\"[\",\"]\",\"|\",\"^\",\"$\",\"(\",\")\",\"?\",\"*\",\"+\",\"{\"].find(r=>t.source.indexOf(r)!==-1)===void 0}function wO(t){return/(\\(\\?=)|(\\(\\?!)|(\\(\\?<=)|(\\(\\?<!)/.test(t.source)}function a_(t){let e=t.ignoreCase?\"iy\":\"y\";return new RegExp(`${t.source}`,e)}function u_(t,e,r){let n=[];return Object.hasOwn(t,ks)||n.push({message:\"A MultiMode Lexer cannot be initialized without a <\"+ks+`> property in its definition\n`,type:pt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Df)||n.push({message:\"A MultiMode Lexer cannot be initialized without a <\"+Df+`> property in its definition\n`,type:pt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Df)&&Object.hasOwn(t,ks)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ks}: <${t.defaultMode}>which does not exist\n`,type:pt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Df)&&Object.keys(t.modes).forEach(i=>{let o=t.modes[i];o.forEach((s,a)=>{s===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${a}>\n`,type:pt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,\"LONGER_ALT\")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(l=>{l!==void 0&&!o.includes(l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${i}>\n`,type:pt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function f_(t,e,r){let n=[],i=!1,s=Object.values(t.modes||{}).flat().filter(Boolean).filter(c=>c[wo]!==ht.NA),a=g_(r);return e&&s.forEach(c=>{let l=m_(c,a);if(l!==!1){let f={message:_O(c,l),type:l.issue,tokenType:c};n.push(f)}else Object.hasOwn(c,\"LINE_BREAKS\")?c.LINE_BREAKS===!0&&(i=!0):Lf(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.`,type:pt.NO_LINE_BREAKS_FLAGS}),n}function d_(t){let e={};return Object.keys(t).forEach(n=>{let i=t[n];if(Array.isArray(i))e[n]=[];else throw Error(\"non exhaustive match\")}),e}function p_(t){let e=t.PATTERN;if(e instanceof RegExp)return!1;if(typeof e==\"function\")return!0;if(Object.hasOwn(e,\"exec\"))return!0;if(typeof e==\"string\")return!1;throw Error(\"non exhaustive match\")}function bO(t){return typeof t==\"string\"&&t.length===1?t.charCodeAt(0):!1}var h_={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function m_(t,e){if(Object.hasOwn(t,\"LINE_BREAKS\"))return!1;if(t.PATTERN instanceof RegExp){try{Lf(e,t.PATTERN)}catch(r){return{issue:pt.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN==\"string\")return!1;if(p_(t))return{issue:pt.CUSTOM_LINE_BREAK};throw Error(\"non exhaustive match\")}}function _O(t,e){if(e.issue===pt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${t.name}> Token Type\n\t Root cause: ${e.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===pt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${t.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(\"non exhaustive match\")}function g_(t){return t.map(r=>typeof r==\"string\"?r.charCodeAt(0):r)}function ag(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var As=256,Mf=[];function ln(t){return t<As?t:Mf[t]}function EO(){if(Mf.length===0){Mf=new Array(65536);for(let t=0;t<65536;t++)Mf[t]=t>255?255+~~(t/255):t}}function On(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Is(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var y_=1,T_={};function Ln(t){let e=vO(t);RO(e),kO(e),AO(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function vO(t){let e=[...t],r=t,n=!0;for(;n;){r=r.map(o=>o.CATEGORIES).flat().filter(Boolean);let i=r.filter(o=>!e.includes(o));e=e.concat(i),i.length===0?n=!1:r=i}return e}function RO(t){t.forEach(e=>{cg(e)||(T_[y_]=e,e.tokenTypeIdx=y_++),x_(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),x_(e)||(e.CATEGORIES=[]),IO(e)||(e.categoryMatches=[]),SO(e)||(e.categoryMatchesMap={})})}function AO(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(T_[r].tokenTypeIdx)})})}function kO(t){t.forEach(e=>{w_([],e)})}function w_(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{let n=t.concat(e);n.includes(r)||w_(n,r)})}function cg(t){return Object.hasOwn(t??{},\"tokenTypeIdx\")}function x_(t){return Object.hasOwn(t??{},\"CATEGORIES\")}function IO(t){return Object.hasOwn(t??{},\"categoryMatches\")}function SO(t){return Object.hasOwn(t??{},\"categoryMatchesMap\")}function b_(t){return Object.hasOwn(t??{},\"tokenTypeIdx\")}var Ss={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,o){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var pt;(function(t){t[t.MISSING_PATTERN=0]=\"MISSING_PATTERN\",t[t.INVALID_PATTERN=1]=\"INVALID_PATTERN\",t[t.EOI_ANCHOR_FOUND=2]=\"EOI_ANCHOR_FOUND\",t[t.UNSUPPORTED_FLAGS_FOUND=3]=\"UNSUPPORTED_FLAGS_FOUND\",t[t.DUPLICATE_PATTERNS_FOUND=4]=\"DUPLICATE_PATTERNS_FOUND\",t[t.INVALID_GROUP_TYPE_FOUND=5]=\"INVALID_GROUP_TYPE_FOUND\",t[t.PUSH_MODE_DOES_NOT_EXIST=6]=\"PUSH_MODE_DOES_NOT_EXIST\",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=\"MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE\",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=\"MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY\",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=\"MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST\",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=\"LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED\",t[t.SOI_ANCHOR_FOUND=11]=\"SOI_ANCHOR_FOUND\",t[t.EMPTY_MATCH_PATTERN=12]=\"EMPTY_MATCH_PATTERN\",t[t.NO_LINE_BREAKS_FLAGS=13]=\"NO_LINE_BREAKS_FLAGS\",t[t.UNREACHABLE_PATTERN=14]=\"UNREACHABLE_PATTERN\",t[t.IDENTIFY_TERMINATOR=15]=\"IDENTIFY_TERMINATOR\",t[t.CUSTOM_LINE_BREAK=16]=\"CUSTOM_LINE_BREAK\",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=\"MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE\"})(pt||(pt={}));var Vc={deferDefinitionErrorsHandling:!1,positionTracking:\"full\",lineTerminatorsPattern:/\\n|\\r\\n?/g,lineTerminatorCharacters:[`\n`,\"\\r\"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ss,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Vc);var ht=class{constructor(e,r=Vc){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=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(\"\t\");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:c}=zc(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return o()},typeof r==\"boolean\")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported`);this.config=Object.assign({},Vc,r);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 i,o=!0;this.TRACE_INIT(\"Lexer Config handling\",()=>{if(this.config.lineTerminatorsPattern===Vc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=h_;else if(this.config.lineTerminatorCharacters===Vc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.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),Array.isArray(e)?i={modes:{defaultMode:[...e]},defaultMode:ks}:(o=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT(\"performRuntimeChecks\",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(u_(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(\"performWarningRuntimeChecks\",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(f_(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([a,c])=>{i.modes[a]=c.filter(l=>l!==void 0)});let s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([a,c])=>{this.TRACE_INIT(`Mode: <${a}> processing`,()=>{if(this.modes.push(a),this.config.skipValidations===!1&&this.TRACE_INIT(\"validatePatterns\",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(l_(c,s))}),this.lexerDefinitionErrors.length===0){Ln(c);let l;this.TRACE_INIT(\"analyzeTokenTypes\",()=>{l=c_(c,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[a]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[a]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[a]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let c=this.lexerDefinitionErrors.map(l=>l.message).join(`-----------------------\n`);throw new Error(`Errors detected in definition of Lexer:\n`+c)}this.lexerDefinitionWarning.forEach(a=>{jc(a.message)}),this.TRACE_INIT(\"Choosing sub-methods implementations\",()=>{if(o&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=a=>a),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/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 a=Object.entries(this.canModeBeOptimized).reduce((c,[l,u])=>(u===!1&&c.push(l),c),[]);if(r.ensureOptimizations&&a.length>0)throw Error(`Lexer Modes: < ${a.join(\", \")} > cannot be optimized.\n\t Disable the \"ensureOptimizations\" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(\"clearRegExpParserCache\",()=>{n_()}),this.TRACE_INIT(\"toFastProperties\",()=>{Wc(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------\n`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:\n`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,l,u,f,d,p,m,w,T,_,E=e,b=E.length,N=0,F=0,L=this.hasCustom?0:Math.floor(e.length/10),j=new Array(L),te=[],oe=this.trackStartLines?1:void 0,Ce=this.trackStartLines?1:void 0,M=d_(this.emptyGroups),R=this.trackStartLines,D=this.config.lineTerminatorsPattern,X=0,A=[],I=[],S=[],G=[];Object.freeze(G);let V=!1,B=J=>{if(S.length===1&&J.tokenType.PUSH_MODE===void 0){let ye=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(J);te.push({offset:J.startOffset,line:J.startLine,column:J.startColumn,length:J.image.length,message:ye})}else{S.pop();let ye=S.at(-1);A=this.patternIdxToConfig[ye],I=this.charCodeToPatternIdxToConfig[ye],X=A.length;let nt=this.canModeBeOptimized[ye]&&this.config.safeMode===!1;I&&nt?V=!0:V=!1}};function K(J){S.push(J),I=this.charCodeToPatternIdxToConfig[J],A=this.patternIdxToConfig[J],X=A.length,X=A.length;let ye=this.canModeBeOptimized[J]&&this.config.safeMode===!1;I&&ye?V=!0:V=!1}K.call(this,r);let Q,_e=this.config.recoveryEnabled;for(;N<b;){c=null,f=-1;let J=E.charCodeAt(N),ye;if(V){let Le=ln(J),We=I[Le];ye=We!==void 0?We:G}else ye=A;let nt=ye.length;for(n=0;n<nt;n++){Q=ye[n];let Le=Q.pattern;l=null;let We=Q.short;if(We!==!1?J===We&&(f=1,c=Le):Q.isCustom===!0?(_=Le.exec(E,N,j,M),_!==null?(c=_[0],f=c.length,_.payload!==void 0&&(l=_.payload)):c=null):(Le.lastIndex=N,f=this.matchLength(Le,e,N)),f!==-1){if(a=Q.longerAlt,a!==void 0){c=e.substring(N,N+f);let z=a.length;for(o=0;o<z;o++){let ne=A[a[o]],ae=ne.pattern;if(u=null,ne.isCustom===!0?(_=ae.exec(E,N,j,M),_!==null?(s=_[0],_.payload!==void 0&&(u=_.payload)):s=null):(ae.lastIndex=N,s=this.match(ae,e,N)),s&&s.length>c.length){c=s,f=s.length,l=u,Q=ne;break}}}break}}if(f!==-1){if(d=Q.group,d!==void 0&&(c=c!==null?c:e.substring(N,N+f),p=Q.tokenTypeIdx,m=this.createTokenInstance(c,N,p,Q.tokenType,oe,Ce,f),this.handlePayload(m,l),d===!1?F=this.addToken(j,F,m):M[d].push(m)),R===!0&&Q.canLineTerminator===!0){let Le=0,We,z;D.lastIndex=0;do c=c!==null?c:e.substring(N,N+f),We=D.test(c),We===!0&&(z=D.lastIndex-1,Le++);while(We===!0);Le!==0?(oe=oe+Le,Ce=f-z,this.updateTokenEndLineColumnLocation(m,d,z,Le,oe,Ce,f)):Ce=this.computeNewColumn(Ce,f)}else Ce=this.computeNewColumn(Ce,f);N=N+f,this.handleModes(Q,B,K,m)}else{let Le=N,We=oe,z=Ce,ne=_e===!1;for(;ne===!1&&N<b;)for(N++,i=0;i<X;i++){let ae=A[i],O=ae.pattern,Fe=ae.short;if(Fe!==!1?E.charCodeAt(N)===Fe&&(ne=!0):ae.isCustom===!0?ne=O.exec(E,N,j,M)!==null:(O.lastIndex=N,ne=O.exec(e)!==null),ne===!0)break}if(w=N-Le,Ce=this.computeNewColumn(Ce,w),T=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,Le,w,We,z,S.at(-1)),te.push({offset:Le,line:We,column:z,length:w,message:T}),_e===!1)break}}return this.hasCustom||(j.length=F),{tokens:j,groups:M,errors:te}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let c,l;r!==void 0&&(c=n===a-1,l=c?-1:0,i===1&&c===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}};ht.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.\";ht.NA=/NOT_APPLICABLE/;function Dn(t){return lg(t)?t.LABEL:t.name}function lg(t){return typeof t.LABEL==\"string\"&&t.LABEL!==\"\"}var NO=\"parent\",__=\"categories\",E_=\"label\",v_=\"group\",R_=\"push_mode\",A_=\"pop_mode\",k_=\"longer_alt\",I_=\"line_breaks\",S_=\"start_chars_hint\";function mi(t){return CO(t)}function CO(t){let e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,NO))throw`The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,__)&&(r.CATEGORIES=t[__]),Ln([r]),Object.hasOwn(t,E_)&&(r.LABEL=t[E_]),Object.hasOwn(t,v_)&&(r.GROUP=t[v_]),Object.hasOwn(t,A_)&&(r.POP_MODE=t[A_]),Object.hasOwn(t,R_)&&(r.PUSH_MODE=t[R_]),Object.hasOwn(t,k_)&&(r.LONGER_ALT=t[k_]),Object.hasOwn(t,I_)&&(r.LINE_BREAKS=t[I_]),Object.hasOwn(t,S_)&&(r.START_CHARS_HINT=t[S_]),r}var Qt=mi({name:\"EOF\",pattern:ht.NA});Ln([Qt]);function Mn(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Ns(t,e){return On(t,e)}var $n={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${lg(t)?`--> ${Dn(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return\"Redundant input, expecting EOF but found: \"+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o=\"Expecting: \",a=`\nbut found: '`+e[0].image+\"'\";if(n)return o+n+a;{let f=`one of these possible Token sequences:\n${t.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>Dn(p)).join(\", \")}]`).map((d,p)=>` ${p+1}. ${d}`).join(`\n`)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i=\"Expecting: \",s=`\nbut found: '`+e[0].image+\"'\";if(r)return i+r+s;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::\n <${t.map(l=>`[${l.map(u=>Dn(u)).join(\",\")}]`).join(\" ,\")}>`;return i+c+s}}};Object.freeze($n);var N_={buildRuleNotFoundError(t,e){return\"Invalid grammar, reference to a rule which is not defined: ->\"+e.nonTerminalName+`<-\ninside top level rule: ->`+t.name+\"<-\"}},Hr={buildDuplicateFoundError(t,e){function r(u){return u instanceof Ne?u.terminalType.name:u instanceof Ye?u.nonTerminalName:\"\"}let n=t.name,i=e[0],o=i.idx,s=cr(i),a=r(i),c=o>0,l=`->${s}${c?o:\"\"}<- ${a?`with argument: ->${a}<-`:\"\"}\n appears more than once (${e.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \\t]+/g,\" \"),l=l.replace(/\\s\\s+/g,`\n`),l},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=t.prefixPath.map(i=>Dn(i)).join(\", \"),r=t.alternation.idx===0?\"\":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(\" ,\")}> due to common lookahead prefix\nin <OR${r}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(t){let e=t.alternation.idx===0?\"\":t.alternation.idx,r=t.prefixPath.length===0,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(\" ,\")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,\n`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n`;else{let i=t.prefixPath.map(o=>Dn(o)).join(\", \");n+=`<${i}> may appears as a prefix path in all these alternatives.\n`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.`,n},buildEmptyRepetitionError(t){let e=cr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError(t){return\"deprecated\"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:\n<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.\n has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=t.leftRecursionPath.map(o=>o.name),n=`${e} --> ${r.concat([e]).join(\" --> \")}`;return`Left Recursion found in grammar.\nrule: <${e}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${n}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return\"deprecated\"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Zt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function C_(t,e){let r=new ug(t,e);return r.resolveRefs(),r.errors}var ug=class extends Jt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Ct.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var fg=class extends Pn{constructor(e,r){super(),this.topProd=e,this.path=r,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=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName=\"\",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},$f=class extends fg{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName=\"\",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new ot({definition:i});this.possibleTokTypes=To(o),this.found=!0}}},Cs=class extends Pn{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Ff=class extends Cs{walkMany(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof Ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Yc=class extends Cs{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof Ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Uf=class extends Cs{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof Ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Kc=class extends Cs{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof Ne&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Bf(t,e,r=[]){r=[...r];let n=[],i=0;function o(a){return a.concat(t.slice(i+1))}function s(a){let c=Bf(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof ot)return s(a.definition);if(a instanceof Ye)return s(a.definition);if(a instanceof Ke)n=s(a.definition);else if(a instanceof st){let c=a.definition.concat([new De({definition:a.definition})]);return s(c)}else if(a instanceof at){let c=[new ot({definition:a.definition}),new De({definition:[new Ne({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof et){let c=a.definition.concat([new De({definition:[new Ne({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof De){let c=a.definition.concat([new De({definition:a.definition})]);n=s(c)}else{if(a instanceof tt)return a.definition.forEach(c=>{c.definition.length!==0&&(n=s(c.definition))}),n;if(a instanceof Ne)r.push(a.terminalType);else throw Error(\"non exhaustive match\")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function P_(t,e,r,n){let i=\"EXIT_NONE_TERMINAL\",o=[i],s=\"EXIT_ALTERNATIVE\",a=!1,c=e.length,l=c-n-1,u=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});f.length!==0;){let d=f.pop();if(d===s){a&&f.at(-1).idx<=l&&f.pop();continue}let p=d.def,m=d.idx,w=d.ruleStack,T=d.occurrenceStack;if(p.length===0)continue;let _=p[0];if(_===i){let E={idx:m,def:p.slice(1),ruleStack:w.slice(0,-1),occurrenceStack:T.slice(0,-1)};f.push(E)}else if(_ instanceof Ne)if(m<c-1){let E=m+1,b=e[E];if(r(b,_.terminalType)){let N={idx:E,def:p.slice(1),ruleStack:w,occurrenceStack:T};f.push(N)}}else if(m===c-1)u.push({nextTokenType:_.terminalType,nextTokenOccurrence:_.idx,ruleStack:w,occurrenceStack:T}),a=!0;else throw Error(\"non exhaustive match\");else if(_ instanceof Ye){let E=[...w];E.push(_.nonTerminalName);let b=[...T];b.push(_.idx);let N={idx:m,def:_.definition.concat(o,p.slice(1)),ruleStack:E,occurrenceStack:b};f.push(N)}else if(_ instanceof Ke){let E={idx:m,def:p.slice(1),ruleStack:w,occurrenceStack:T};f.push(E),f.push(s);let b={idx:m,def:_.definition.concat(p.slice(1)),ruleStack:w,occurrenceStack:T};f.push(b)}else if(_ instanceof st){let E=new De({definition:_.definition,idx:_.idx}),b=_.definition.concat([E],p.slice(1)),N={idx:m,def:b,ruleStack:w,occurrenceStack:T};f.push(N)}else if(_ instanceof at){let E=new Ne({terminalType:_.separator}),b=new De({definition:[E].concat(_.definition),idx:_.idx}),N=_.definition.concat([b],p.slice(1)),F={idx:m,def:N,ruleStack:w,occurrenceStack:T};f.push(F)}else if(_ instanceof et){let E={idx:m,def:p.slice(1),ruleStack:w,occurrenceStack:T};f.push(E),f.push(s);let b=new Ne({terminalType:_.separator}),N=new De({definition:[b].concat(_.definition),idx:_.idx}),F=_.definition.concat([N],p.slice(1)),L={idx:m,def:F,ruleStack:w,occurrenceStack:T};f.push(L)}else if(_ instanceof De){let E={idx:m,def:p.slice(1),ruleStack:w,occurrenceStack:T};f.push(E),f.push(s);let b=new De({definition:_.definition,idx:_.idx}),N=_.definition.concat([b],p.slice(1)),F={idx:m,def:N,ruleStack:w,occurrenceStack:T};f.push(F)}else if(_ instanceof tt)for(let E=_.definition.length-1;E>=0;E--){let b=_.definition[E],N={idx:m,def:b.definition.concat(p.slice(1)),ruleStack:w,occurrenceStack:T};f.push(N),f.push(s)}else if(_ instanceof ot)f.push({idx:m,def:_.definition.concat(p.slice(1)),ruleStack:w,occurrenceStack:T});else if(_ instanceof Zt)f.push(PO(_,m,w,T));else throw Error(\"non exhaustive match\")}return u}function PO(t,e,r,n){let i=[...r];i.push(t.name);let o=[...n];return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var mt;(function(t){t[t.OPTION=0]=\"OPTION\",t[t.REPETITION=1]=\"REPETITION\",t[t.REPETITION_MANDATORY=2]=\"REPETITION_MANDATORY\",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]=\"REPETITION_MANDATORY_WITH_SEPARATOR\",t[t.REPETITION_WITH_SEPARATOR=4]=\"REPETITION_WITH_SEPARATOR\",t[t.ALTERNATION=5]=\"ALTERNATION\"})(mt||(mt={}));function Zc(t){if(t instanceof Ke||t===\"Option\")return mt.OPTION;if(t instanceof De||t===\"Repetition\")return mt.REPETITION;if(t instanceof st||t===\"RepetitionMandatory\")return mt.REPETITION_MANDATORY;if(t instanceof at||t===\"RepetitionMandatoryWithSeparator\")return mt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof et||t===\"RepetitionWithSeparator\")return mt.REPETITION_WITH_SEPARATOR;if(t instanceof tt||t===\"Alternation\")return mt.ALTERNATION;throw Error(\"non exhaustive match\")}function Xf(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=Zc(n);return o===mt.ALTERNATION?Ps(e,r,i):Os(e,r,o,i)}function L_(t,e,r,n,i,o){let s=Ps(t,e,r),a=B_(s)?Is:On;return o(s,n,a,i)}function D_(t,e,r,n,i,o){let s=Os(t,e,i,r),a=B_(s)?Is:On;return o(s[0],a,n)}function M_(t,e,r,n){let i=t.length,o=t.every(s=>s.every(a=>a.length===1));if(e)return function(s){let a=s.map(c=>c.GATE);for(let c=0;c<i;c++){let l=t[c],u=l.length,f=a[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<u;d++){let p=l[d],m=p.length;for(let w=0;w<m;w++){let T=this.LA_FAST(w+1);if(r(T,p[w])===!1)continue e}return c}}};if(o&&!n){let a=t.map(c=>c.flat()).reduce((c,l,u)=>(l.forEach(f=>{f.tokenTypeIdx in c||(c[f.tokenTypeIdx]=u),f.categoryMatches.forEach(d=>{Object.hasOwn(c,d)||(c[d]=u)})}),c),{});return function(){let c=this.LA_FAST(1);return a[c.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],c=a.length;e:for(let l=0;l<c;l++){let u=a[l],f=u.length;for(let d=0;d<f;d++){let p=this.LA_FAST(d+1);if(r(p,u[d])===!1)continue e}return s}}}}function $_(t,e,r){let n=t.every(o=>o.length===1),i=t.length;if(n&&!r){let o=t.flat();if(o.length===1&&o[0].categoryMatches.length===0){let a=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===a}}else{let s=o.reduce((a,c,l)=>(a[c.tokenTypeIdx]=!0,c.categoryMatches.forEach(u=>{a[u]=!0}),a),[]);return function(){let a=this.LA_FAST(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let c=0;c<a;c++){let l=this.LA_FAST(c+1);if(e(l,s[c])===!1)continue e}return!0}return!1}}var pg=class extends Pn{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,mt.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,mt.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,mt.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,mt.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,mt.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Hf=class extends Jt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,mt.OPTION)}visitRepetition(e){this.checkIsTarget(e,mt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,mt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,mt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,mt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,mt.ALTERNATION)}};function O_(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function dg(t){let e=[\"\"];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+\"_\"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c=\"_\"+n.categoryMatches[a];i.push(s+c)}}e=i}return e}function OO(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function F_(t,e){let r=t.map(s=>Bf([s],1)),n=O_(r.length),i=r.map(s=>{let a={};return s.forEach(c=>{dg(c.partialPath).forEach(u=>{a[u]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=O_(a.length);for(let c=0;c<a.length;c++){let l=a[c];for(let u=0;u<l.length;u++){let f=l[u].partialPath,d=l[u].suffixDef,p=dg(f);if(OO(i,p,c)||d.length===0||f.length===e){let w=n[c];if(Gf(w,f)===!1){w.push(f);for(let T=0;T<p.length;T++){let _=p[T];i[c][_]=!0}}}else{let w=Bf(d,s+1,f);o[c]=o[c].concat(w),w.forEach(T=>{dg(T.partialPath).forEach(E=>{i[c][E]=!0})})}}}}return n}function Ps(t,e,r,n){let i=new Hf(t,mt.ALTERNATION,n);return e.accept(i),F_(i.result,r)}function Os(t,e,r,n){let i=new Hf(t,r);e.accept(i);let o=i.result,a=new pg(e,t,r).startWalking(),c=new ot({definition:o}),l=new ot({definition:a});return F_([c,l],n)}function Gf(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function U_(t,e){return t.length<e.length&&t.every((r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function B_(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function H_(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:Ct.CUSTOM_LOOKAHEAD_VALIDATION},r))}function X_(t,e,r,n){let i=t.flatMap(c=>LO(c,r)),o=BO(t,e,r),s=t.flatMap(c=>$O(c,r)),a=t.flatMap(c=>MO(c,t,n,r));return i.concat(o,s,a)}function LO(t,e){let r=new hg;t.accept(r);let n=r.allProductions,i=Object.groupBy(n,DO),o=Object.fromEntries(Object.entries(i).filter(([a,c])=>c.length>1));return Object.values(o).map(a=>{let c=a[0],l=e.buildDuplicateFoundError(t,a),u=cr(c),f={message:l,type:Ct.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},d=G_(c);return d&&(f.parameter=d),f})}function DO(t){return`${cr(t)}_#_${t.idx}_#_${G_(t)}`}function G_(t){return t instanceof Ne?t.terminalType.name:t instanceof Ye?t.nonTerminalName:\"\"}var hg=class extends Jt{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 MO(t,e,r,n){let i=[];if(e.reduce((s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Ct.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function j_(t,e,r){let n=[],i;return e.includes(t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Ct.INVALID_RULE_OVERRIDE,ruleName:t})),n}function gg(t,e,r,n=[]){let i=[],o=jf(e.definition);if(o.length===0)return[];{let s=t.name;o.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ct.LEFT_RECURSION,ruleName:s});let c=n.concat([t]),u=o.filter(f=>!c.includes(f)).flatMap(f=>{let d=[...n];return d.push(f),gg(t,f,r,d)});return i.concat(u)}}function jf(t){let e=[];if(t.length===0)return e;let r=t[0];if(r instanceof Ye)e.push(r.referencedRule);else if(r instanceof ot||r instanceof Ke||r instanceof st||r instanceof at||r instanceof et||r instanceof De)e=e.concat(jf(r.definition));else if(r instanceof tt)e=r.definition.map(o=>jf(o.definition)).flat();else if(!(r instanceof Ne))throw Error(\"non exhaustive match\");let n=xo(r),i=t.length>1;if(n&&i){let o=t.slice(1);return e.concat(jf(o))}else return e}var Jc=class extends Jt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function z_(t,e){let r=new Jc;return t.accept(r),r.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,c)=>P_([a],[],On,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:Ct.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]))}function W_(t,e,r){let n=new Jc;t.accept(n);let i=n.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{let a=s.idx,c=s.maxLookahead||e,l=Ps(a,t,c,s),u=FO(l,s,t,r),f=UO(l,s,t,r);return u.concat(f)})}var mg=class extends Jt{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 $O(t,e){let r=new Jc;return t.accept(r),r.alternations.flatMap(o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:Ct.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function q_(t,e,r){let n=[];return t.forEach(i=>{let o=new mg;i.accept(o),o.allProductions.forEach(a=>{let c=Zc(a),l=a.maxLookahead||e,u=a.idx;if(Os(u,i,c,l)[0].flat().length===0){let p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:p,type:Ct.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function FO(t,e,r,n){let i=[];return t.reduce((a,c,l)=>(e.definition[l].ignoreAmbiguities===!0||c.forEach(u=>{let f=[l];t.forEach((d,p)=>{l!==p&&Gf(d,u)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Gf(i,u)&&(i.push(u),a.push({alts:f,path:u}))}),a),[]).map(a=>{let c=a.alts.map(u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:Ct.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function UO(t,e,r,n){let i=t.reduce((s,a,c)=>{let l=a.map(u=>({idx:c,path:u}));return s.concat(l)},[]);return i.flatMap(s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let c=s.idx,l=s.path;return i.filter(d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<c&&U_(d.path,l)).map(d=>{let p=[d.idx+1,c+1],m=e.idx===0?\"\":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:d.path}),type:Ct.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})})}function BO(t,e,r){let n=[],i=e.map(o=>o.name);return t.forEach(o=>{let s=o.name;if(i.includes(s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:Ct.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function V_(t){let e=Object.assign({errMsgProvider:N_},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),C_(r,e.errMsgProvider)}function Y_(t){var e;let r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Hr;return X_(t.rules,t.tokenTypes,r,t.grammarName)}var K_=\"MismatchedTokenException\",Z_=\"NoViableAltException\",J_=\"EarlyExitException\",Q_=\"NotAllInputParsedException\",eE=[K_,Z_,J_,Q_];Object.freeze(eE);function gi(t){return eE.includes(t.name)}var Ls=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},bo=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=K_}},Qc=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Z_}},el=class extends Ls{constructor(e,r){super(e,r),this.name=Q_}},tl=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=J_}};var yg={},Tg=\"InRuleRecoveryException\",xg=class extends Error{constructor(e){super(e),this.name=Tg}},zf=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,\"recoveryEnabled\")?e.recoveryEnabled:er.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=HO)}getTokenToInsert(e){let r=Mn(e,\"\",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],c=!1,l=this.LA_FAST(1),u=this.LA_FAST(1),f=()=>{let d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:d,ruleName:this.getCurrRuleFullName()}),m=new bo(p,l,this.LA(0));m.resyncedTokens=a.slice(0,-1),this.SAVE_ERROR(m)};for(;!c;)if(this.tokenMatcher(u,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(u,o)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA_FAST(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getNextPossibleTokenTypes(e){let r=e.ruleStack[0],i=this.getGAstProductions()[r];return new $f(i,e).startWalking()}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new xg(\"sad sad panda\")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||r.length===0)return!1;let n=this.LA_FAST(1);return r.find(o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(r).includes(e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA_FAST(1),n=2;for(;;){let i=e.find(o=>Ns(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return yg;let e=this.currRuleShortName,r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,i=new Array(n);for(let o=0;o<n;o++)o===0?i[o]=yg:i[o]={ruleName:this.shortRuleNameToFullName(e[o]),idxInCallingRule:r[o],inRule:this.shortRuleNameToFullName(e[o-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(r=>this.getFollowSetFromFollowKey(r)).flat()}getFollowSetFromFollowKey(e){if(e===yg)return[Qt];let r=e.ruleName+e.idxInCallingRule+Cf+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Qt)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA_FAST(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return r.slice(0,-1)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){let e=this.RULE_STACK_IDX+1,r=new Array(e);for(let n=0;n<e;n++)r[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return r}};function HO(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let d=this.getCurrRuleFullName(),p=this.getGAstProductions()[d];c=new o(p,i).startWalking(),this.firstAfterRepMap[a]=c}let l=c.token,u=c.occurrence,f=c.isEndOfRule;this.RULE_STACK_IDX===0&&f&&l===void 0&&(l=Qt,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function Wf(t,e,r){return r|e|t}var Fn=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:er.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(r.length===0){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return e.flatMap(r=>gg(r,r,Hr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>z_(r,Hr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>W_(n,r,Hr))}validateSomeNonEmptyLookaheadPath(e,r){return q_(e,r,Hr)}buildLookaheadForAlternation(e){return L_(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,M_)}buildLookaheadForOptional(e){return D_(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zc(e.prodType),$_)}};var Vf=class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,\"dynamicTokensEnabled\")?e.dynamicTokensEnabled:er.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,\"maxLookahead\")?e.maxLookahead:er.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,\"lookaheadStrategy\")?e.lookaheadStrategy:new Fn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){e.forEach(r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=XO(r);n.forEach(l=>{let u=l.idx===0?\"\":l.idx;this.TRACE_INIT(`${cr(l)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Wf(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(d,f)})}),i.forEach(l=>{this.computeLookaheadFunc(r,l.idx,768,\"Repetition\",l.maxLookahead,cr(l))}),o.forEach(l=>{this.computeLookaheadFunc(r,l.idx,512,\"Option\",l.maxLookahead,cr(l))}),s.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1024,\"RepetitionMandatory\",l.maxLookahead,cr(l))}),a.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1536,\"RepetitionMandatoryWithSeparator\",l.maxLookahead,cr(l))}),c.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1280,\"RepetitionWithSeparator\",l.maxLookahead,cr(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?\"\":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Wf(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){return Wf(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},wg=class extends Jt{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)}},qf=new wg;function XO(t){qf.reset(),t.accept(qf);let e=qf.dslMethods;return qf.reset(),e}function Eg(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function vg(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function tE(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function rE(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var GO=\"name\";function Rg(t,e){Object.defineProperty(t,GO,{enumerable:!1,configurable:!0,writable:!1,value:e})}function jO(t,e){let r=Object.keys(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let c=0;c<a;c++){let l=s[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function nE(t,e){let r=function(){};Rg(r,t+\"BaseSemantics\");let n={visit:function(i,o){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,o)},validateVisitor:function(){let i=zO(this,e);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${o.join(`\n\n`).replace(/\\n/g,`\n\t`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function iE(t,e,r){let n=function(){};Rg(n,t+\"BaseSemanticsWithDefaults\");let i=Object.create(r.prototype);return e.forEach(o=>{i[o]=jO}),n.prototype=i,n.prototype.constructor=n,n}var Ag;(function(t){t[t.REDUNDANT_METHOD=0]=\"REDUNDANT_METHOD\",t[t.MISSING_METHOD=1]=\"MISSING_METHOD\"})(Ag||(Ag={}));function zO(t,e){return WO(t,e)}function WO(t,e){return e.filter(i=>typeof t[i]!=\"function\").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Ag.MISSING_METHOD,methodName:i})).filter(Boolean)}var Jf=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,\"nodeLocationTracking\")?e.nodeLocationTracking:er.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vg,this.setNodeLocationFromNode=vg,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eg,this.setNodeLocationFromNode=Eg,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: \"${e.nodeLocationTracking}\"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA_FAST(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];tE(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];rE(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=nE(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=iE(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}};var Qf=class{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.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Un}LA_FAST(e){let r=this.currIdx+e;return this.tokVector[r]}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Un:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}};var ed=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}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,r,n=Ds){if(this.definedRulesNames.includes(e)){let s={message:Hr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ct.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Ds){let i=j_(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){var n;let i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);let o=this.saveRecogState();try{return i.apply(this,r),!0}catch(s){if(gi(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Nf(Object.values(this.gastProductionsCache))}};var td=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Is,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(r,\"serializedGrammar\"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis 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.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((o,s)=>(o[s.name]=s,o),{});else if(Object.hasOwn(e,\"modes\")&&Object.values(e.modes).flat().every(b_)){let o=Object.values(e.modes).flat(),s=[...new Set(o)];this.tokensMap=s.reduce((a,c)=>(a[c.name]=c,a),{})}else if(typeof e==\"object\"&&e!==null)this.tokensMap=Object.assign({},e);else throw new Error(\"<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition\");this.tokensMap.EOF=Qt;let i=(Object.hasOwn(e,\"modes\")?Object.values(e.modes).flat():Object.values(e)).every(o=>{var s;return((s=o.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?Is:On,Ln(Object.values(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(n,\"resyncEnabled\")?n.resyncEnabled:Ds.resyncEnabled,o=Object.hasOwn(n,\"recoveryValueFunc\")?n.recoveryValueFunc:Ds.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...f){this.onBeforeParse(e);try{return a.apply(this,f)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:r,coreRule:a})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK_IDX===0,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(gi(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,s.partialCstResult=c}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!=\"function\"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!=\"function\"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,mt.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Uf)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Kc],a,1536,e,Kc)}else throw this.raiseEarlyExitException(e,mt.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!=\"function\"){o=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Ff,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Yc],a,1280,e,Yc)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Array.isArray(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.coreRule.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw gi(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA_FAST(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bo(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name===\"MismatchedTokenException\"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Tg?n:o}}else throw n}saveRecogState(){let e=this.errors,r=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);let r=e.RULE_STACK;for(let n=0;n<r.length;n++)this.RULE_STACK[n]=r[n];this.RULE_STACK_IDX=r.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Qt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let r=0;r<this.maxLookahead+1;r++)this.tokVector.push(Un)}onAfterParse(e){if(this.isAtEndOfInput()===!1){let r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new el(n,r))}for(;this.tokVector.at(-1)===Un;)this.tokVector.pop()}};var rd=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,\"errorMessageProvider\")?e.errorMessageProvider:er.errorMessageProvider}SAVE_ERROR(e){if(gi(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error(\"Trying to save an Error which is not a RecognitionException\")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Os(e,o,r,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new tl(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Ps(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Qc(c,this.LA(1),a))}};var od={description:\"This Object indicates the Parser is during Recording Phase\"};Object.freeze(od);var oE=!0,sE=Math.pow(2,8)-1,cE=mi({name:\"RECORDING_PHASE_TOKEN\",pattern:ht.NA});Ln([cE]);var lE=Mn(cE,`This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(lE);var VO={name:`This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},nd=class{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 r=e>0?e:\"\";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},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 r=0;r<10;r++){let n=r>0?r:\"\";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,r){return()=>!0}LA_RECORD(e){return Un}topLevelRuleRecord(e,r){try{let n=new Zt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`\n\t This error was thrown during the \"grammar recording phase\" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return nl.call(this,Ke,e,r)}atLeastOneInternalRecord(e,r){nl.call(this,st,r,e)}atLeastOneSepFirstInternalRecord(e,r){nl.call(this,at,r,e,oE)}manyInternalRecord(e,r){nl.call(this,De,r,e)}manySepFirstInternalRecord(e,r){nl.call(this,et,r,e,oE)}orInternalRecord(e,r){return YO.call(this,e,r)}subruleInternalRecord(e,r,n){if(id(r),!e||!Object.hasOwn(e,\"ruleName\")){let a=new Error(`<SUBRULE${aE(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=this.recordingProdStack.at(-1),o=e.ruleName,s=new Ye({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?VO:od}consumeInternalRecord(e,r,n){if(id(r),!cg(e)){let s=new Error(`<CONSUME${aE(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new Ne({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),lE}};function nl(t,e,r,n=!1){id(r);let i=this.recordingProdStack.at(-1),o=typeof e==\"function\"?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Object.hasOwn(e,\"MAX_LOOKAHEAD\")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),od}function YO(t,e){id(e);let r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,o=new tt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Object.hasOwn(t,\"MAX_LOOKAHEAD\")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=i.some(a=>typeof a.GATE==\"function\");return o.hasPredicates=s,r.definition.push(o),i.forEach(a=>{let c=new ot({definition:[]});o.definition.push(c),Object.hasOwn(a,\"IGNORE_AMBIGUITIES\")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Object.hasOwn(a,\"GATE\")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),od}function aE(t){return t===0?\"\":`${t}`}function id(t){if(t<0||t>sE){let e=new Error(`Invalid DSL Method idx value: <${t}>\n\tIdx value must be a none negative value smaller than ${sE+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var sd=class{initPerformanceTracer(e){if(Object.hasOwn(e,\"traceInitPerf\")){let r=e.traceInitPerf,n=typeof r==\"number\";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=er.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(\"\t\");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=zc(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function uE(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i===\"constructor\")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Un=Mn(Qt,\"\",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Un);var er=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:$n,nodeLocationTracking:\"none\",traceInitPerf:!1,skipValidations:!1}),Ds=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),Ct;(function(t){t[t.INVALID_RULE_NAME=0]=\"INVALID_RULE_NAME\",t[t.DUPLICATE_RULE_NAME=1]=\"DUPLICATE_RULE_NAME\",t[t.INVALID_RULE_OVERRIDE=2]=\"INVALID_RULE_OVERRIDE\",t[t.DUPLICATE_PRODUCTIONS=3]=\"DUPLICATE_PRODUCTIONS\",t[t.UNRESOLVED_SUBRULE_REF=4]=\"UNRESOLVED_SUBRULE_REF\",t[t.LEFT_RECURSION=5]=\"LEFT_RECURSION\",t[t.NONE_LAST_EMPTY_ALT=6]=\"NONE_LAST_EMPTY_ALT\",t[t.AMBIGUOUS_ALTS=7]=\"AMBIGUOUS_ALTS\",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]=\"CONFLICT_TOKENS_RULES_NAMESPACE\",t[t.INVALID_TOKEN_NAME=9]=\"INVALID_TOKEN_NAME\",t[t.NO_NON_EMPTY_LOOKAHEAD=10]=\"NO_NON_EMPTY_LOOKAHEAD\",t[t.AMBIGUOUS_PREFIX_ALTS=11]=\"AMBIGUOUS_PREFIX_ALTS\",t[t.TOO_MANY_ALTS=12]=\"TOO_MANY_ALTS\",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]=\"CUSTOM_LOOKAHEAD_VALIDATION\"})(Ct||(Ct={}));function ad(t=void 0){return function(){return t}}var il=class t{static performSelfAnalysis(e){throw Error(\"The **static** `performSelfAnalysis` method has been deprecated.\t\\nUse the **instance** method with the same name instead.\")}performSelfAnalysis(){this.TRACE_INIT(\"performSelfAnalysis\",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT(\"toFastProps\",()=>{Wc(this)}),this.TRACE_INIT(\"Grammar Recording\",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT(\"Grammar Resolving\",()=>{n=V_({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT(\"Grammar Validations\",()=>{if(n.length===0&&this.skipValidations===!1){let i=Y_({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Hr,grammarName:r}),o=H_({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT(\"computeAllProdsFollows\",()=>{let i=r_(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT(\"ComputeLookaheadFunctions\",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:\n ${e.join(`\n-------------------------------\n`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initGastRecorder(r),n.initPerformanceTracer(r),Object.hasOwn(r,\"ignoredIssues\"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.`);this.skipValidations=Object.hasOwn(r,\"skipValidations\")?r.skipValidations:er.skipValidations}};il.DEFER_DEFINITION_ERRORS_HANDLING=!1;uE(il,[zf,Vf,Jf,Qf,td,ed,rd,nd,sd]);var ol=class extends il{constructor(e,r=er){let n=Object.assign({},r);n.outputCst=!1,super(e,n)}};function ZO(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var cd=ZO;function JO(){this.__data__=[],this.size=0}var fE=JO;function QO(t,e){return t===e||t!==t&&e!==e}var ld=QO;function eL(t,e){for(var r=t.length;r--;)if(ld(t[r][0],e))return r;return-1}var yi=eL;var tL=Array.prototype,rL=tL.splice;function nL(t){var e=this.__data__,r=yi(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():rL.call(e,r,1),--this.size,!0}var dE=nL;function iL(t){var e=this.__data__,r=yi(e,t);return r<0?void 0:e[r][1]}var pE=iL;function oL(t){return yi(this.__data__,t)>-1}var hE=oL;function sL(t,e){var r=this.__data__,n=yi(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var mE=sL;function Ms(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ms.prototype.clear=fE;Ms.prototype.delete=dE;Ms.prototype.get=pE;Ms.prototype.has=hE;Ms.prototype.set=mE;var xi=Ms;function aL(){this.__data__=new xi,this.size=0}var gE=aL;function cL(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var yE=cL;function lL(t){return this.__data__.get(t)}var xE=lL;function uL(t){return this.__data__.has(t)}var TE=uL;var fL=typeof global==\"object\"&&global&&global.Object===Object&&global,ud=fL;var dL=typeof self==\"object\"&&self&&self.Object===Object&&self,pL=ud||dL||Function(\"return this\")(),Lt=pL;var hL=Lt.Symbol,tr=hL;var wE=Object.prototype,mL=wE.hasOwnProperty,gL=wE.toString,sl=tr?tr.toStringTag:void 0;function yL(t){var e=mL.call(t,sl),r=t[sl];try{t[sl]=void 0;var n=!0}catch{}var i=gL.call(t);return n&&(e?t[sl]=r:delete t[sl]),i}var bE=yL;var xL=Object.prototype,TL=xL.toString;function wL(t){return TL.call(t)}var _E=wL;var bL=\"[object Null]\",_L=\"[object Undefined]\",EE=tr?tr.toStringTag:void 0;function EL(t){return t==null?t===void 0?_L:bL:EE&&EE in Object(t)?bE(t):_E(t)}var Xr=EL;function vL(t){var e=typeof t;return t!=null&&(e==\"object\"||e==\"function\")}var $s=vL;var RL=\"[object AsyncFunction]\",AL=\"[object Function]\",kL=\"[object GeneratorFunction]\",IL=\"[object Proxy]\";function SL(t){if(!$s(t))return!1;var e=Xr(t);return e==AL||e==kL||e==RL||e==IL}var fd=SL;var NL=Lt[\"__core-js_shared__\"],dd=NL;var vE=(function(){var t=/[^.]+$/.exec(dd&&dd.keys&&dd.keys.IE_PROTO||\"\");return t?\"Symbol(src)_1.\"+t:\"\"})();function CL(t){return!!vE&&vE in t}var RE=CL;var PL=Function.prototype,OL=PL.toString;function LL(t){if(t!=null){try{return OL.call(t)}catch{}try{return t+\"\"}catch{}}return\"\"}var Bn=LL;var DL=/[\\\\^$.*+?()[\\]{}|]/g,ML=/^\\[object .+?Constructor\\]$/,$L=Function.prototype,FL=Object.prototype,UL=$L.toString,BL=FL.hasOwnProperty,HL=RegExp(\"^\"+UL.call(BL).replace(DL,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");function XL(t){if(!$s(t)||RE(t))return!1;var e=fd(t)?HL:ML;return e.test(Bn(t))}var AE=XL;function GL(t,e){return t?.[e]}var kE=GL;function jL(t,e){var r=kE(t,e);return AE(r)?r:void 0}var Rr=jL;var zL=Rr(Lt,\"Map\"),Ti=zL;var WL=Rr(Object,\"create\"),Hn=WL;function qL(){this.__data__=Hn?Hn(null):{},this.size=0}var IE=qL;function VL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var SE=VL;var YL=\"__lodash_hash_undefined__\",KL=Object.prototype,ZL=KL.hasOwnProperty;function JL(t){var e=this.__data__;if(Hn){var r=e[t];return r===YL?void 0:r}return ZL.call(e,t)?e[t]:void 0}var NE=JL;var QL=Object.prototype,eD=QL.hasOwnProperty;function tD(t){var e=this.__data__;return Hn?e[t]!==void 0:eD.call(e,t)}var CE=tD;var rD=\"__lodash_hash_undefined__\";function nD(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Hn&&e===void 0?rD:e,this}var PE=nD;function Fs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Fs.prototype.clear=IE;Fs.prototype.delete=SE;Fs.prototype.get=NE;Fs.prototype.has=CE;Fs.prototype.set=PE;var Ig=Fs;function iD(){this.size=0,this.__data__={hash:new Ig,map:new(Ti||xi),string:new Ig}}var OE=iD;function oD(t){var e=typeof t;return e==\"string\"||e==\"number\"||e==\"symbol\"||e==\"boolean\"?t!==\"__proto__\":t===null}var LE=oD;function sD(t,e){var r=t.__data__;return LE(e)?r[typeof e==\"string\"?\"string\":\"hash\"]:r.map}var wi=sD;function aD(t){var e=wi(this,t).delete(t);return this.size-=e?1:0,e}var DE=aD;function cD(t){return wi(this,t).get(t)}var ME=cD;function lD(t){return wi(this,t).has(t)}var $E=lD;function uD(t,e){var r=wi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var FE=uD;function Us(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Us.prototype.clear=OE;Us.prototype.delete=DE;Us.prototype.get=ME;Us.prototype.has=$E;Us.prototype.set=FE;var _o=Us;var fD=200;function dD(t,e){var r=this.__data__;if(r instanceof xi){var n=r.__data__;if(!Ti||n.length<fD-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _o(n)}return r.set(t,e),this.size=r.size,this}var UE=dD;function Bs(t){var e=this.__data__=new xi(t);this.size=e.size}Bs.prototype.clear=gE;Bs.prototype.delete=yE;Bs.prototype.get=xE;Bs.prototype.has=TE;Bs.prototype.set=UE;var Hs=Bs;var pD=\"__lodash_hash_undefined__\";function hD(t){return this.__data__.set(t,pD),this}var BE=hD;function mD(t){return this.__data__.has(t)}var HE=mD;function pd(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _o;++e<r;)this.add(t[e])}pd.prototype.add=pd.prototype.push=BE;pd.prototype.has=HE;var hd=pd;function gD(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var XE=gD;function yD(t,e){return t.has(e)}var md=yD;var xD=1,TD=2;function wD(t,e,r,n,i,o){var s=r&xD,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(t),u=o.get(e);if(l&&u)return l==e&&u==t;var f=-1,d=!0,p=r&TD?new hd:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],w=e[f];if(n)var T=s?n(w,m,f,e,t,o):n(m,w,f,t,e,o);if(T!==void 0){if(T)continue;d=!1;break}if(p){if(!XE(e,function(_,E){if(!md(p,E)&&(m===_||i(m,_,r,n,o)))return p.push(E)})){d=!1;break}}else if(!(m===w||i(m,w,r,n,o))){d=!1;break}}return o.delete(t),o.delete(e),d}var gd=wD;var bD=Lt.Uint8Array,Sg=bD;function _D(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var GE=_D;function ED(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Xs=ED;var vD=1,RD=2,AD=\"[object Boolean]\",kD=\"[object Date]\",ID=\"[object Error]\",SD=\"[object Map]\",ND=\"[object Number]\",CD=\"[object RegExp]\",PD=\"[object Set]\",OD=\"[object String]\",LD=\"[object Symbol]\",DD=\"[object ArrayBuffer]\",MD=\"[object DataView]\",jE=tr?tr.prototype:void 0,Ng=jE?jE.valueOf:void 0;function $D(t,e,r,n,i,o,s){switch(r){case MD:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case DD:return!(t.byteLength!=e.byteLength||!o(new Sg(t),new Sg(e)));case AD:case kD:case ND:return ld(+t,+e);case ID:return t.name==e.name&&t.message==e.message;case CD:case OD:return t==e+\"\";case SD:var a=GE;case PD:var c=n&vD;if(a||(a=Xs),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=RD,s.set(t,e);var u=gd(a(t),a(e),n,i,o,s);return s.delete(t),u;case LD:if(Ng)return Ng.call(t)==Ng.call(e)}return!1}var zE=$D;function FD(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var yd=FD;var UD=Array.isArray,Je=UD;function BD(t,e,r){var n=e(t);return Je(t)?n:yd(n,r(t))}var WE=BD;function HD(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var xd=HD;function XD(){return[]}var qE=XD;var GD=Object.prototype,jD=GD.propertyIsEnumerable,VE=Object.getOwnPropertySymbols,zD=VE?function(t){return t==null?[]:(t=Object(t),xd(VE(t),function(e){return jD.call(t,e)}))}:qE,YE=zD;function WD(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var KE=WD;function qD(t){return t!=null&&typeof t==\"object\"}var Gr=qD;var VD=\"[object Arguments]\";function YD(t){return Gr(t)&&Xr(t)==VD}var Cg=YD;var ZE=Object.prototype,KD=ZE.hasOwnProperty,ZD=ZE.propertyIsEnumerable,JD=Cg((function(){return arguments})())?Cg:function(t){return Gr(t)&&KD.call(t,\"callee\")&&!ZD.call(t,\"callee\")},bi=JD;function QD(){return!1}var JE=QD;var tv=typeof exports==\"object\"&&exports&&!exports.nodeType&&exports,QE=tv&&typeof module==\"object\"&&module&&!module.nodeType&&module,eM=QE&&QE.exports===tv,ev=eM?Lt.Buffer:void 0,tM=ev?ev.isBuffer:void 0,rM=tM||JE,Eo=rM;var nM=9007199254740991,iM=/^(?:0|[1-9]\\d*)$/;function oM(t,e){var r=typeof t;return e=e??nM,!!e&&(r==\"number\"||r!=\"symbol\"&&iM.test(t))&&t>-1&&t%1==0&&t<e}var Td=oM;var sM=9007199254740991;function aM(t){return typeof t==\"number\"&&t>-1&&t%1==0&&t<=sM}var Gs=aM;var cM=\"[object Arguments]\",lM=\"[object Array]\",uM=\"[object Boolean]\",fM=\"[object Date]\",dM=\"[object Error]\",pM=\"[object Function]\",hM=\"[object Map]\",mM=\"[object Number]\",gM=\"[object Object]\",yM=\"[object RegExp]\",xM=\"[object Set]\",TM=\"[object String]\",wM=\"[object WeakMap]\",bM=\"[object ArrayBuffer]\",_M=\"[object DataView]\",EM=\"[object Float32Array]\",vM=\"[object Float64Array]\",RM=\"[object Int8Array]\",AM=\"[object Int16Array]\",kM=\"[object Int32Array]\",IM=\"[object Uint8Array]\",SM=\"[object Uint8ClampedArray]\",NM=\"[object Uint16Array]\",CM=\"[object Uint32Array]\",ut={};ut[EM]=ut[vM]=ut[RM]=ut[AM]=ut[kM]=ut[IM]=ut[SM]=ut[NM]=ut[CM]=!0;ut[cM]=ut[lM]=ut[bM]=ut[uM]=ut[_M]=ut[fM]=ut[dM]=ut[pM]=ut[hM]=ut[mM]=ut[gM]=ut[yM]=ut[xM]=ut[TM]=ut[wM]=!1;function PM(t){return Gr(t)&&Gs(t.length)&&!!ut[Xr(t)]}var rv=PM;function OM(t){return function(e){return t(e)}}var nv=OM;var iv=typeof exports==\"object\"&&exports&&!exports.nodeType&&exports,al=iv&&typeof module==\"object\"&&module&&!module.nodeType&&module,LM=al&&al.exports===iv,Pg=LM&&ud.process,DM=(function(){try{var t=al&&al.require&&al.require(\"util\").types;return t||Pg&&Pg.binding&&Pg.binding(\"util\")}catch{}})(),Og=DM;var ov=Og&&Og.isTypedArray,MM=ov?nv(ov):rv,js=MM;var $M=Object.prototype,FM=$M.hasOwnProperty;function UM(t,e){var r=Je(t),n=!r&&bi(t),i=!r&&!n&&Eo(t),o=!r&&!n&&!i&&js(t),s=r||n||i||o,a=s?KE(t.length,String):[],c=a.length;for(var l in t)(e||FM.call(t,l))&&!(s&&(l==\"length\"||i&&(l==\"offset\"||l==\"parent\")||o&&(l==\"buffer\"||l==\"byteLength\"||l==\"byteOffset\")||Td(l,c)))&&a.push(l);return a}var sv=UM;var BM=Object.prototype;function HM(t){var e=t&&t.constructor,r=typeof e==\"function\"&&e.prototype||BM;return t===r}var wd=HM;function XM(t,e){return function(r){return t(e(r))}}var av=XM;var GM=av(Object.keys,Object),cv=GM;var jM=Object.prototype,zM=jM.hasOwnProperty;function WM(t){if(!wd(t))return cv(t);var e=[];for(var r in Object(t))zM.call(t,r)&&r!=\"constructor\"&&e.push(r);return e}var bd=WM;function qM(t){return t!=null&&Gs(t.length)&&!fd(t)}var _i=qM;function VM(t){return _i(t)?sv(t):bd(t)}var zs=VM;function YM(t){return WE(t,zs,YE)}var Lg=YM;var KM=1,ZM=Object.prototype,JM=ZM.hasOwnProperty;function QM(t,e,r,n,i,o){var s=r&KM,a=Lg(t),c=a.length,l=Lg(e),u=l.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in e:JM.call(e,d)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var w=!0;o.set(t,e),o.set(e,t);for(var T=s;++f<c;){d=a[f];var _=t[d],E=e[d];if(n)var b=s?n(E,_,d,e,t,o):n(_,E,d,t,e,o);if(!(b===void 0?_===E||i(_,E,r,n,o):b)){w=!1;break}T||(T=d==\"constructor\")}if(w&&!T){var N=t.constructor,F=e.constructor;N!=F&&\"constructor\"in t&&\"constructor\"in e&&!(typeof N==\"function\"&&N instanceof N&&typeof F==\"function\"&&F instanceof F)&&(w=!1)}return o.delete(t),o.delete(e),w}var lv=QM;var e$=Rr(Lt,\"DataView\"),_d=e$;var t$=Rr(Lt,\"Promise\"),Ed=t$;var r$=Rr(Lt,\"Set\"),Ei=r$;var n$=Rr(Lt,\"WeakMap\"),vd=n$;var uv=\"[object Map]\",i$=\"[object Object]\",fv=\"[object Promise]\",dv=\"[object Set]\",pv=\"[object WeakMap]\",hv=\"[object DataView]\",o$=Bn(_d),s$=Bn(Ti),a$=Bn(Ed),c$=Bn(Ei),l$=Bn(vd),vo=Xr;(_d&&vo(new _d(new ArrayBuffer(1)))!=hv||Ti&&vo(new Ti)!=uv||Ed&&vo(Ed.resolve())!=fv||Ei&&vo(new Ei)!=dv||vd&&vo(new vd)!=pv)&&(vo=function(t){var e=Xr(t),r=e==i$?t.constructor:void 0,n=r?Bn(r):\"\";if(n)switch(n){case o$:return hv;case s$:return uv;case a$:return fv;case c$:return dv;case l$:return pv}return e});var cl=vo;var u$=1,mv=\"[object Arguments]\",gv=\"[object Array]\",Rd=\"[object Object]\",f$=Object.prototype,yv=f$.hasOwnProperty;function d$(t,e,r,n,i,o){var s=Je(t),a=Je(e),c=s?gv:cl(t),l=a?gv:cl(e);c=c==mv?Rd:c,l=l==mv?Rd:l;var u=c==Rd,f=l==Rd,d=c==l;if(d&&Eo(t)){if(!Eo(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Hs),s||js(t)?gd(t,e,r,n,i,o):zE(t,e,c,r,n,i,o);if(!(r&u$)){var p=u&&yv.call(t,\"__wrapped__\"),m=f&&yv.call(e,\"__wrapped__\");if(p||m){var w=p?t.value():t,T=m?e.value():e;return o||(o=new Hs),i(w,T,r,n,o)}}return d?(o||(o=new Hs),lv(t,e,r,n,i,o)):!1}var xv=d$;function Tv(t,e,r,n,i){return t===e?!0:t==null||e==null||!Gr(t)&&!Gr(e)?t!==t&&e!==e:xv(t,e,r,n,Tv,i)}var Ad=Tv;var p$=1,h$=2;function m$(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var c=a[0],l=t[c],u=a[1];if(s&&a[2]){if(l===void 0&&!(c in t))return!1}else{var f=new Hs;if(n)var d=n(l,u,c,t,e,f);if(!(d===void 0?Ad(u,l,p$|h$,n,f):d))return!1}}return!0}var wv=m$;function g$(t){return t===t&&!$s(t)}var kd=g$;function y$(t){for(var e=zs(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,kd(i)]}return e}var bv=y$;function x$(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Id=x$;function T$(t){var e=bv(t);return e.length==1&&e[0][2]?Id(e[0][0],e[0][1]):function(r){return r===t||wv(r,t,e)}}var _v=T$;var w$=\"[object Symbol]\";function b$(t){return typeof t==\"symbol\"||Gr(t)&&Xr(t)==w$}var vi=b$;var _$=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,E$=/^\\w*$/;function v$(t,e){if(Je(t))return!1;var r=typeof t;return r==\"number\"||r==\"symbol\"||r==\"boolean\"||t==null||vi(t)?!0:E$.test(t)||!_$.test(t)||e!=null&&t in Object(e)}var Ws=v$;var R$=\"Expected a function\";function Dg(t,e){if(typeof t!=\"function\"||e!=null&&typeof e!=\"function\")throw new TypeError(R$);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Dg.Cache||_o),r}Dg.Cache=_o;var Ev=Dg;var A$=500;function k$(t){var e=Ev(t,function(n){return r.size===A$&&r.clear(),n}),r=e.cache;return e}var vv=k$;var I$=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,S$=/\\\\(\\\\)?/g,N$=vv(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(\"\"),t.replace(I$,function(r,n,i,o){e.push(i?o.replace(S$,\"$1\"):n||r)}),e}),Rv=N$;var C$=1/0,Av=tr?tr.prototype:void 0,kv=Av?Av.toString:void 0;function Iv(t){if(typeof t==\"string\")return t;if(Je(t))return cd(t,Iv)+\"\";if(vi(t))return kv?kv.call(t):\"\";var e=t+\"\";return e==\"0\"&&1/t==-C$?\"-0\":e}var Sv=Iv;function P$(t){return t==null?\"\":Sv(t)}var Nv=P$;function O$(t,e){return Je(t)?t:Ws(t,e)?[t]:Rv(Nv(t))}var Sd=O$;var L$=1/0;function D$(t){if(typeof t==\"string\"||vi(t))return t;var e=t+\"\";return e==\"0\"&&1/t==-L$?\"-0\":e}var Ri=D$;function M$(t,e){e=Sd(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ri(e[r++])];return r&&r==n?t:void 0}var Nd=M$;function $$(t,e,r){var n=t==null?void 0:Nd(t,e);return n===void 0?r:n}var Cv=$$;function F$(t,e){return t!=null&&e in Object(t)}var Pv=F$;function U$(t,e,r){e=Sd(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Ri(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Gs(i)&&Td(s,i)&&(Je(t)||bi(t)))}var Ov=U$;function B$(t,e){return t!=null&&Ov(t,e,Pv)}var Lv=B$;var H$=1,X$=2;function G$(t,e){return Ws(t)&&kd(e)?Id(Ri(t),e):function(r){var n=Cv(r,t);return n===void 0&&n===e?Lv(r,t):Ad(e,n,H$|X$)}}var Dv=G$;function j$(t){return t}var qs=j$;function z$(t){return function(e){return e?.[t]}}var Mv=z$;function W$(t){return function(e){return Nd(e,t)}}var $v=W$;function q$(t){return Ws(t)?Mv(Ri(t)):$v(t)}var Fv=q$;function V$(t){return typeof t==\"function\"?t:t==null?qs:typeof t==\"object\"?Je(t)?Dv(t[0],t[1]):_v(t):Fv(t)}var Ai=V$;function Y$(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}var Uv=Y$;var K$=Uv(),Bv=K$;function Z$(t,e){return t&&Bv(t,e,zs)}var Hv=Z$;function J$(t,e){return function(r,n){if(r==null)return r;if(!_i(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var Xv=J$;var Q$=Xv(Hv),ki=Q$;function e1(t,e){var r=-1,n=_i(t)?Array(t.length):[];return ki(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Gv=e1;function t1(t,e){var r=Je(t)?cd:Gv;return r(t,Ai(e,3))}var Tr=t1;function r1(t,e){var r=[];return ki(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var jv=r1;function n1(t,e){var r=Je(t)?xd:jv;return r(t,Ai(e,3))}var zv=n1;function Ro(t,e,r){return`${t.name}_${e}_${r}`}var Ii=1,i1=2,Wv=4,qv=5;var Ao=7,o1=8,s1=9,a1=10,c1=11,Vv=12,ll=class{constructor(e){this.target=e}isEpsilon(){return!1}},Vs=class extends ll{constructor(e,r){super(e),this.tokenType=r}},ul=class extends ll{constructor(e){super(e)}isEpsilon(){return!0}},Ys=class extends ll{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Yv(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};l1(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=ko(e,i,i);o!==void 0&&w1(e,i,o)}return e}function l1(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=Dt(t,i,void 0,{type:i1}),s=Dt(t,i,void 0,{type:Ao});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function Kv(t,e,r){return r instanceof Ne?Mg(t,e,r.terminalType,r):r instanceof Ye?T1(t,e,r):r instanceof tt?h1(t,e,r):r instanceof Ke?m1(t,e,r):r instanceof De?u1(t,e,r):r instanceof et?f1(t,e,r):r instanceof st?d1(t,e,r):r instanceof at?p1(t,e,r):ko(t,e,r)}function u1(t,e,r){let n=Dt(t,e,r,{type:qv});Si(t,n);let i=Ks(t,e,n,r,ko(t,e,r));return Jv(t,e,r,i)}function f1(t,e,r){let n=Dt(t,e,r,{type:qv});Si(t,n);let i=Ks(t,e,n,r,ko(t,e,r)),o=Mg(t,e,r.separator,r);return Jv(t,e,r,i,o)}function d1(t,e,r){let n=Dt(t,e,r,{type:Wv});Si(t,n);let i=Ks(t,e,n,r,ko(t,e,r));return Zv(t,e,r,i)}function p1(t,e,r){let n=Dt(t,e,r,{type:Wv});Si(t,n);let i=Ks(t,e,n,r,ko(t,e,r)),o=Mg(t,e,r.separator,r);return Zv(t,e,r,i,o)}function h1(t,e,r){let n=Dt(t,e,r,{type:Ii});Si(t,n);let i=Tr(r.definition,s=>Kv(t,e,s));return Ks(t,e,n,r,...i)}function m1(t,e,r){let n=Dt(t,e,r,{type:Ii});Si(t,n);let i=Ks(t,e,n,r,ko(t,e,r));return g1(t,e,r,i)}function ko(t,e,r){let n=zv(Tr(r.definition,i=>Kv(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:x1(t,n)}function Zv(t,e,r,n,i){let o=n.left,s=n.right,a=Dt(t,e,r,{type:c1});Si(t,a);let c=Dt(t,e,r,{type:Vv});return o.loopback=a,c.loopback=a,t.decisionMap[Ro(e,i?\"RepetitionMandatoryWithSeparator\":\"RepetitionMandatory\",r.idx)]=a,It(s,a),i===void 0?(It(a,o),It(a,c)):(It(a,c),It(a,i.left),It(i.right,o)),{left:o,right:c}}function Jv(t,e,r,n,i){let o=n.left,s=n.right,a=Dt(t,e,r,{type:a1});Si(t,a);let c=Dt(t,e,r,{type:Vv}),l=Dt(t,e,r,{type:s1});return a.loopback=l,c.loopback=l,It(a,o),It(a,c),It(s,l),i!==void 0?(It(l,c),It(l,i.left),It(i.right,o)):It(l,a),t.decisionMap[Ro(e,i?\"RepetitionWithSeparator\":\"Repetition\",r.idx)]=a,{left:a,right:c}}function g1(t,e,r,n){let i=n.left,o=n.right;return It(i,o),t.decisionMap[Ro(e,\"Option\",r.idx)]=i,n}function Si(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ks(t,e,r,n,...i){let o=Dt(t,e,n,{type:o1,start:r});r.end=o;for(let a of i)a!==void 0?(It(r,a.left),It(a.right,o)):It(r,o);let s={left:r,right:o};return t.decisionMap[Ro(e,y1(n),n.idx)]=r,s}function y1(t){if(t instanceof tt)return\"Alternation\";if(t instanceof Ke)return\"Option\";if(t instanceof De)return\"Repetition\";if(t instanceof et)return\"RepetitionWithSeparator\";if(t instanceof st)return\"RepetitionMandatory\";if(t instanceof at)return\"RepetitionMandatoryWithSeparator\";throw new Error(\"Invalid production type encountered\")}function x1(t,e){let r=e.length;for(let o=0;o<r-1;o++){let s=e[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let c=a instanceof Ys,l=a,u=e[o+1].left;s.left.type===Ii&&s.right.type===Ii&&a!==void 0&&(c&&l.followState===s.right||a.target===s.right)?(c?l.followState=u:a.target=u,b1(t,s.right)):It(s.right,u)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Mg(t,e,r,n){let i=Dt(t,e,n,{type:Ii}),o=Dt(t,e,n,{type:Ii});return $g(i,new Vs(o,r)),{left:i,right:o}}function T1(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=Dt(t,e,r,{type:Ii}),s=Dt(t,e,r,{type:Ii}),a=new Ys(i,n,s);return $g(o,a),{left:o,right:s}}function w1(t,e,r){let n=t.ruleToStartState.get(e);It(n,r.left);let i=t.ruleToStopState.get(e);return It(r.right,i),{left:n,right:i}}function It(t,e){let r=new ul(e);$g(t,r)}function Dt(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function $g(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function b1(t,e){t.states.splice(t.states.indexOf(e),1)}var fl={},Zs=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Fg(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return Tr(this.configs,e=>e.alt)}get key(){let e=\"\";for(let r in this.map)e+=r+\":\";return e}};function Fg(t,e=!0){return`${e?`a${t.alt}`:\"\"}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join(\"_\")}`}function _1(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(s!=null&&(a===void 0?s===s&&!vi(s):r(s,a)))var a=s,c=o}return c}var Qv=_1;function E1(t,e){return t<e}var e0=E1;function v1(t){return t&&t.length?Qv(t,qs,e0):void 0}var t0=v1;var r0=tr?tr.isConcatSpreadable:void 0;function R1(t){return Je(t)||bi(t)||!!(r0&&t&&t[r0])}var n0=R1;function i0(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=n0),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?i0(a,e-1,r,n,i):yd(i,a):n||(i[i.length]=a)}return i}var Cd=i0;function A1(t,e){return Cd(Tr(t,e),1)}var o0=A1;function k1(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var s0=k1;function I1(t){return t!==t}var a0=I1;function S1(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var c0=S1;function N1(t,e,r){return e===e?c0(t,e,r):s0(t,a0,r)}var l0=N1;function C1(t,e){var r=t==null?0:t.length;return!!r&&l0(t,e,0)>-1}var u0=C1;function P1(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var f0=P1;function O1(){}var d0=O1;var L1=1/0,D1=Ei&&1/Xs(new Ei([,-0]))[1]==L1?function(t){return new Ei(t)}:d0,p0=D1;var M1=200;function $1(t,e,r){var n=-1,i=u0,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=f0;else if(o>=M1){var l=e?null:p0(t);if(l)return Xs(l);s=!1,i=md,c=new hd}else c=e?[]:a;e:for(;++n<o;){var u=t[n],f=e?e(u):u;if(u=r||u!==0?u:0,s&&f===f){for(var d=c.length;d--;)if(c[d]===f)continue e;e&&c.push(f),a.push(u)}else i(c,f,r)||(c!==a&&c.push(f),a.push(u))}return a}var h0=$1;function F1(t,e){return t&&t.length?h0(t,Ai(e,2)):[]}var m0=F1;function U1(t){var e=t==null?0:t.length;return e?Cd(t,1):[]}var g0=U1;function B1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var y0=B1;function H1(t){return typeof t==\"function\"?t:qs}var x0=H1;function X1(t,e){var r=Je(t)?y0:ki;return r(t,x0(e))}var Pd=X1;var G1=\"[object Map]\",j1=\"[object Set]\",z1=Object.prototype,W1=z1.hasOwnProperty;function q1(t){if(t==null)return!0;if(_i(t)&&(Je(t)||typeof t==\"string\"||typeof t.splice==\"function\"||Eo(t)||js(t)||bi(t)))return!t.length;var e=cl(t);if(e==G1||e==j1)return!t.size;if(wd(t))return!bd(t).length;for(var r in t)if(W1.call(t,r))return!1;return!0}var T0=q1;function V1(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var w0=V1;function Y1(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var b0=Y1;function K1(t,e,r){var n=Je(t)?w0:b0,i=arguments.length<3;return n(t,Ai(e,4),r,i,ki)}var Ug=K1;function Z1(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}var Od=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e=\"\",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?\"1\":\"0\";return e}},_0=new Od,dl=class extends Fn{constructor(e){var r,n;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:(i=>console.log(i)),this.incomplete=(n=e?.incomplete)!==null&&n!==void 0?n:!1}initialize(e){this.atn=Yv(e.rules),this.dfas=J1(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=Ro(n,\"Alternation\",r),f=this.atn.decisionMap[l].decision,d=Tr(Xf({maxLookahead:1,occurrence:r,prodType:\"Alternation\",rule:n}),p=>Tr(p,m=>m[0]));if(E0(d,!1)&&!o){let p=Ug(d,(m,w,T)=>(Pd(w,_=>{_&&(m[_.tokenTypeIdx]=T,Pd(_.categoryMatches,E=>{m[E]=T}))}),m),{});return i?function(m){var w;let T=this.LA_FAST(1),_=p[T.tokenTypeIdx];if(m!==void 0&&_!==void 0){let E=(w=m[_])===null||w===void 0?void 0:w.GATE;if(E!==void 0&&E.call(this)===!1)return}return _}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Od,w=p===void 0?0:p.length;for(let _=0;_<w;_++){let E=p?.[_].GATE;m.set(_,E===void 0||E.call(this))}let T=Bg.call(this,s,f,m,a,c);return typeof T==\"number\"?T:void 0}:function(){let p=Bg.call(this,s,f,_0,a,c);return typeof p==\"number\"?p:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=Ro(n,i,r),f=this.atn.decisionMap[l].decision,d=Tr(Xf({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>Tr(p,m=>m[0]));if(E0(d)&&d[0][0]&&!o){let p=d[0],m=g0(p);if(m.length===1&&T0(m[0].categoryMatches)){let T=m[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===T}}else{let w=Ug(m,(T,_)=>(_!==void 0&&(T[_.tokenTypeIdx]=!0,Pd(_.categoryMatches,E=>{T[E]=!0})),T),{});return function(){let T=this.LA_FAST(1);return w[T.tokenTypeIdx]===!0}}}return function(){let p=Bg.call(this,s,f,_0,a,c);return typeof p==\"object\"?!1:p===0}}};function E0(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function J1(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=Z1(t.decisionStates[n],n);return r}function Bg(t,e,r,n,i){let o=t[e](r),s=o.start;if(s===void 0){let c=lF(o.atnStartState);s=A0(o,R0(c)),o.start=s}return Q1.apply(this,[o,s,r,n,i])}function Q1(t,e,r,n,i){let o=e,s=1,a=[],c=this.LA_FAST(s++);for(;;){let l=oF(o,c);if(l===void 0&&(l=eF.apply(this,[t,o,c,s,r,n])),l===fl)return iF(a,o,c);if(l.isAcceptState===!0){if(i===!0&&Ns(c,Qt)){let u=yF(o,r);if(u!==void 0)return u}return l.prediction}o=l,a.push(c),c=this.LA(s++)}}function eF(t,e,r,n,i,o){let s=sF(e.configs,r,i);if(s.size===0)return v0(t,e,r,fl),fl;let a=R0(s),c=cF(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(pF(s)){let l=t0(s.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,tF.apply(this,[t,n,s.alts,o])}return a=v0(t,e,r,a),a}function tF(t,e,r,n){let i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);let o=t.atnStartState,s=o.rule,a=o.production,c=rF({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function rF(t){let e=Tr(t.prefixPath,i=>Dn(i)).join(\", \"),r=t.production.idx===0?\"\":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(\", \")}> in <${nF(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.`,n}function nF(t){if(t instanceof Ye)return\"SUBRULE\";if(t instanceof Ke)return\"OPTION\";if(t instanceof tt)return\"OR\";if(t instanceof st)return\"AT_LEAST_ONE\";if(t instanceof at)return\"AT_LEAST_ONE_SEP\";if(t instanceof et)return\"MANY_SEP\";if(t instanceof De)return\"MANY\";if(t instanceof Ne)return\"CONSUME\";throw Error(\"non exhaustive match\")}function iF(t,e,r){let n=o0(e.configs.elements,o=>o.state.transitions),i=m0(n.filter(o=>o instanceof Vs).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function oF(t,e){return t.edges[e.tokenTypeIdx]}function sF(t,e,r){let n=new Zs,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ao){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let l=s.state.transitions[c],u=aF(l,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&n.size===1&&(o=n),o===void 0){o=new Zs;for(let s of n.elements)Ld(s,o)}if(i.length>0&&!fF(o))for(let s of i)o.add(s);return o}function aF(t,e){if(t instanceof Vs&&Ns(e,t.tokenType))return t.target}function cF(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function R0(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function v0(t,e,r,n){return n=A0(t,n),e.edges[r.tokenTypeIdx]=n,n}function A0(t,e){if(e===fl)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function lF(t){let e=new Zs,r=t.transitions.length;for(let n=0;n<r;n++){let o={state:t.transitions[n].target,alt:n,stack:[]};Ld(o,e)}return e}function Ld(t,e){let r=t.state;if(r.type===Ao){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Ld(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let o=r.transitions[i],s=uF(t,o);s!==void 0&&Ld(s,e)}}function uF(t,e){if(e instanceof ul)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Ys){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function fF(t){for(let e of t.elements)if(e.state.type===Ao)return!0;return!1}function dF(t){for(let e of t.elements)if(e.state.type!==Ao)return!1;return!0}function pF(t){if(dF(t))return!0;let e=hF(t.elements);return mF(e)&&!gF(e)}function hF(t){let e=new Map;for(let r of t){let n=Fg(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function mF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function gF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}function yF(t,e){let r;for(let n of t.configs.elements)if(!(e.is(n.alt)===!1||n.state.type===Ao)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}na();var wl=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new ia(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Co;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new No(e.startOffset,e.image.length,xs(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){let r=[];for(let o of e){let s=new No(o.startOffset,o.image.length,xs(o),o.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){let o=n.container.content.indexOf(n);if(o>0){n.container.content.splice(o,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){let r=this.current;typeof e.$type==\"string\"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},bl=class{get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type==\"string\"?this._astNode:this.container?.astNode;if(!e)throw new 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)}},No=class extends bl{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,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},Co=class extends bl{constructor(){super(...arguments),this.content=new Gy(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,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:Be.create(0,0),end:Be.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 r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},Gy=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},ia=class extends Co{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text=\"\",this._text=e??\"\"}};var jd=Symbol(\"Datatype\");function jy(t){return t.$type===jd}var k0=\"\\u200B\",I0=t=>t.endsWith(k0)?t:t+k0,_l=class{constructor(e,r){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let n=this.lexer.definition,i=e.LanguageMetaData.mode===\"production\";e.shared.profilers.LangiumProfiler?.isActive(\"parsing\")?this.wrapper=new zy(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r,e.shared.profilers.LangiumProfiler.createTask(\"parsing\",e.LanguageMetaData.languageId)):this.wrapper=new Wd(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r)}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}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()}},El=class extends _l{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e,!1),this.nodeBuilder=new wl,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,r){let n=this.computeRuleType(e),i;di(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(I0(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),Ot(e)&&e.entry&&(this.mainRule=o),o}registerPrecedenceMap(e){let r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){let o=e.operators.precedences[i];for(let s of o.operators)n.set(s.value,{precedence:i,rightAssoc:o.associativity===\"right\"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return di(e)?hi(e):e.fragment?void 0:Gc(e)?jd:hi(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:\"No main rule available.\");let o=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,cs(o,{deep:!0}),{value:o,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error(\"No result from parser\");if(this.stack.length>0)throw new Error(\"Parser stack is not empty after parsing\");return r}startImplementation(e,r,n){return i=>{let o=!this.isRecording()&&e!==void 0;if(o){let s={$type:e};this.stack.push(s),e===jd?s.value=\"\":r!==void 0&&(s.$infixName=r)}return n(i),o?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let s=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,crossRef:c}=this.getAssignment(n),l=this.current;if(a){let u=vr(n)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,c)}else if(jy(l)){let u=i.image;vr(n)||(u=this.converter.convert(u,s).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset==\"number\"&&!isNaN(e.endOffset)}subrule(e,r,n,i,o){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(e,r,o)}finally{this.isRecording()||(a===void 0&&!n&&(a=this.construct()),a!==void 0&&s&&s.length>0&&this.performSubruleAssignment(a,i,s))}}performSubruleAssignment(e,r,n){let{assignment:i,crossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let s=this.current;if(jy(s))s.value+=e.toString();else if(typeof e==\"object\"&&e){let c=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(c)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);let o={$type:e};this.stack.push(o),this.assign(r.operator,r.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)):jy(e)?this.converter.convert(e.value,e.$cstNode):(pm(this.astReflection,e),e)}constructInfix(e,r){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let o=0,s=-1;for(let w=0;w<i.length;w++){let T=i[w],_=r.get(T)??{precedence:1/0,rightAssoc:!1};_.precedence>s?(s=_.precedence,o=w):_.precedence===s&&(_.rightAssoc||(o=w))}let a=i.slice(0,o),c=i.slice(o+1),l=n.slice(0,o+1),u=n.slice(o+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:a},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:c},p=this.constructInfix(f,r),m=this.constructInfix(d,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[o],right:m}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=An(e,Fr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Ur(r.terminal)?r.terminal.isMulti?\"multi\":\"single\":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let s=this.current,a;switch(o===\"single\"&&typeof n==\"string\"?a=this.linker.buildReference(s,r,i,n):o===\"multi\"&&typeof n==\"string\"?a=this.linker.buildMultiReference(s,r,i,n):a=n,e){case\"=\":{s[r]=a;break}case\"?=\":{s[r]=!0;break}case\"+=\":Array.isArray(s[r])||(s[r]=[]),s[r].push(a)}}assignWithoutOverride(e,r){for(let[i,o]of Object.entries(r)){let s=e[i];s===void 0?e[i]=o:Array.isArray(s)&&Array.isArray(o)&&(o.push(...s),e[i]=o)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},zd=class{buildMismatchTokenMessage(e){return $n.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return $n.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return $n.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return $n.buildEarlyExitMessage(e)}},oa=class extends zd{buildMismatchTokenMessage({expected:e,actual:r}){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 \\`${r.image}\\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \\`${e.image}\\`.`}},vl=class extends _l{constructor(e){super(e,!0),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e,{mode:\"partial\"});return this.tokens=r.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,r){let n=this.wrapper.DEFINE_RULE(I0(e.name),this.startImplementation(r).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 r=>{let n=this.keepStackSize();try{e(r)}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,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,o){this.before(i),this.wrapper.wrapSubrule(e,r,o),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},TF={recoveryEnabled:!0,nodeLocationTracking:\"full\",skipValidations:!0,errorMessageProvider:new oa},Wd=class extends ol{constructor(e,r,n){let i=r&&\"maxLookahead\"in r;super(e,{...TF,lookaheadStrategy:i?new Fn({maxLookahead:r.maxLookahead}):new dl({logging:r.skipValidations?()=>{}:void 0,incomplete:n}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},zy=class extends Wd{constructor(e,r,n,i){super(e,r,n),this.task=i}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,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}};function Rl(t,e,r){return wF({parser:e,tokens:r,ruleNames:new Map},t),e}function wF(t,e){let r=Hc(e,!1),n=Se(e.rules).filter(Ot).filter(o=>r.has(o));for(let o of n){let s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(o,Po(s,o.definition))}let i=Se(e.rules).filter(di).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,bF(t,o))}function bF(t,e){let r=e.call.rule.ref;if(!r)throw new Error(\"Could not resolve reference to infix operator rule: \"+e.call.rule.$refText);if(Kt(r))throw new Error(\"Cannot use terminal rule in infix expression\");let n=e.operators.precedences.flatMap(p=>p.operators),i={$type:\"Group\",elements:[]},o={$container:i,$type:\"Assignment\",feature:\"parts\",operator:\"+=\",terminal:e.call},s={$container:i,$type:\"Group\",elements:[],cardinality:\"*\"};i.elements.push(o,s);let c={$container:s,$type:\"Assignment\",feature:\"operators\",operator:\"+=\",terminal:{$type:\"Alternatives\",elements:n}},l={...o,$container:s};s.elements.push(c,l);let f=n.map(p=>t.tokens[p.value]).map((p,m)=>({ALT:()=>t.parser.consume(m,p,c)})),d;return p=>{d??(d=qy(t,r)),t.parser.subrule(0,d,!1,o,p),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,d,!1,l,p)}})}}function Po(t,e,r=!1){let n;if(vr(e))n=IF(t,e);else if(Nn(e))n=_F(t,e);else if(Fr(e))n=Po(t,e.terminal);else if(Ur(e))n=S0(t,e);else if(Br(e))n=EF(t,e);else if(xf(e))n=RF(t,e);else if(_f(e))n=AF(t,e);else if(fi(e))n=kF(t,e);else if(wm(e)){let i=t.consume++;n=()=>t.parser.consume(i,Qt,e)}else throw new ho(e.$cstNode,`Unexpected element type: ${e.$type}`);return N0(t,r?void 0:qd(e),n,e.cardinality)}function _F(t,e){let r=hi(e);return()=>t.parser.action(r,e)}function EF(t,e){let r=e.rule.ref;if(Sn(r)){let n=t.subrule++,i=Ot(r)&&r.fragment,o=e.arguments.length>0?vF(r,e.arguments):()=>({}),s;return a=>{s??(s=qy(t,r)),t.parser.subrule(n,s,i,e,o(a))}}else if(Kt(r)){let n=t.consume++,i=Wy(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)sn(r);else throw new ho(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function vF(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:fn(i.value)}));return i=>{let o={};for(let{parameterName:s,predicate:a}of n)s&&(o[s]=a(i));return o}}else{let n=e.map(i=>fn(i.value));return i=>{let o={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){let a=t.parameters[s].name,c=n[s];o[a]=c(i)}return o}}}function fn(t){if(Tm(t)){let e=fn(t.left),r=fn(t.right);return n=>e(n)||r(n)}else if(xm(t)){let e=fn(t.left),r=fn(t.right);return n=>e(n)&&r(n)}else if(Em(t)){let e=fn(t.value);return r=>!e(r)}else if(vm(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(gm(t)){let e=!!t.true;return()=>e}sn(t)}function RF(t,e){if(e.elements.length===1)return Po(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Po(t,i,!0)},s=qd(i);s&&(o.GATE=fn(s)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function AF(t,e){if(e.elements.length===1)return Po(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:Po(t,a,!0)},l=qd(a);l&&(c.GATE=fn(l)),r.push(c)}let n=t.or++,i=(a,c)=>{let l=c.getRuleStack().join(\"-\");return`uGroup_${a}_${l}`},o=a=>t.parser.alternatives(n,r.map((c,l)=>{let u={ALT:()=>!0},f=t.parser;u.ALT=()=>{if(c.ALT(a),!f.isRecording()){let p=i(n,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);let m=f.unorderedGroups.get(p);typeof m?.[l]>\"u\"&&(m[l]=!0)}};let d=c.GATE;return d?u.GATE=()=>d(a):u.GATE=()=>!f.unorderedGroups.get(i(n,f))?.[l],u})),s=N0(t,qd(e),o,\"*\");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function kF(t,e){let r=e.elements.map(n=>Po(t,n));return n=>r.forEach(i=>i(n))}function qd(t){if(fi(t))return t.guardCondition}function S0(t,e,r=e.terminal){if(r)if(Br(r)&&Ot(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return s=>{o??(o=qy(t,n)),t.parser.subrule(i,o,!1,e,s)}}else if(Br(r)&&Kt(r.rule.ref)){let n=t.consume++,i=Wy(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(vr(r)){let n=t.consume++,i=Wy(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error(\"Could not build cross reference parser\");else{if(!e.type.ref)throw new Error(\"Could not resolve reference to type: \"+e.type.$refText);let i=If(e.type.ref)?.terminal;if(!i)throw new Error(\"Could not find name assignment for type: \"+hi(e.type.ref));return S0(t,e,i)}}function IF(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error(\"Could not find token for keyword: \"+e.value);return()=>t.parser.consume(r,n,e)}function N0(t,e,r,n){let i=e&&fn(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:ad(),GATE:()=>!i(s)}])}else return r;if(n===\"*\"){let o=t.many++;return s=>t.parser.many(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n===\"+\"){let o=t.many++;if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:ad(),GATE:()=>!i(a)}])}else return s=>t.parser.atLeastOne(o,{DEF:()=>r(s)})}else if(n===\"?\"){let o=t.optional++;return s=>t.parser.optional(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else sn(n)}function qy(t,e){let r=SF(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule \"${r}\" not found.\"`);return n}function SF(t,e){if(Sn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ot(n);)(fi(n)||xf(n)||_f(n))&&(i=n.elements.indexOf(r).toString()+\":\"+i),r=n,n=n.$container;return i=n.name+\":\"+i,t.ruleNames.set(e,i),i}}function Wy(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token \"${e}\" not found.\"`);return r}function Vy(t){let e=t.Grammar,r=t.parser.Lexer,n=new vl(t);return Rl(e,n,r.definition),n.finalize(),n}function Yy(t){let e=C0(t);return e.finalize(),e}function C0(t){let e=t.Grammar,r=t.parser.Lexer,n=new El(t);return Rl(e,n,r.definition)}var Oo=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=Se(Hc(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return o.push(...i),o}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Kt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=ws(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n==\"function\"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Bc(r)?ht.SKIPPED:\"hidden\"),i}requiresCustomPattern(e){return!!(e.flags.includes(\"u\")||e.flags.includes(\"s\"))}regexPatternFunction(e){let r=new RegExp(e,e.flags+\"y\");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Sn).flatMap(i=>Mr(i).filter(vr)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),o={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i==\"function\"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(e,r){return r?new RegExp(pi(e.value),\"i\"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&Xm(\"^\"+o.source+\"$\",e.value)&&n.push(i),n},[])}};var Lo=class{convert(e,r){let n=r.grammarSource;if(Ur(n)&&(n=zm(n)),Br(n)){let i=n.rule.ref;if(!i)throw new Error(\"This cst node was not parsed by a rule.\");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){switch(e.name.toUpperCase()){case\"INT\":return dn.convertInt(r);case\"STRING\":return dn.convertString(r);case\"ID\":return dn.convertID(r)}switch(Jm(e)?.toLowerCase()){case\"number\":return dn.convertNumber(r);case\"boolean\":return dn.convertBoolean(r);case\"bigint\":return dn.convertBigint(r);case\"date\":return dn.convertDate(r);default:return r}}},dn;(function(t){function e(l){let u=\"\";for(let f=1;f<l.length-1;f++){let d=l.charAt(f);if(d===\"\\\\\"){let p=l.charAt(++f);u+=r(p)}else u+=d}return u}t.convertString=e;function r(l){switch(l){case\"b\":return\"\\b\";case\"f\":return\"\\f\";case\"n\":return`\n`;case\"r\":return\"\\r\";case\"t\":return\"\t\";case\"v\":return\"\\v\";case\"0\":return\"\\0\";default:return l}}function n(l){return l.charAt(0)===\"^\"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function o(l){return BigInt(l)}t.convertBigint=o;function s(l){return new Date(l)}t.convertDate=s;function a(l){return Number(l)}t.convertNumber=a;function c(l){return l.toLowerCase()===\"true\"}t.convertBoolean=c})(dn||(dn={}));var le={};$e(le,im(M0(),1));function ix(){return new Promise(t=>{typeof setImmediate>\"u\"?setTimeout(t,0):setImmediate(t)})}var Zd=0,$0=10;function Jd(){return Zd=performance.now(),new le.CancellationTokenSource}function F0(t){$0=t}var Ar=Symbol(\"OperationCancelled\");function pn(t){return t===Ar}async function Tt(t){if(t===le.CancellationToken.None)return;let e=performance.now();if(e-Zd>=$0&&(Zd=e,await ix(),Zd=performance.now()),t.isCancellationRequested)throw Ar}var rr=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var Qd=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=H0(n.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=U0(n.text,!1,o);if(c-a===u.length)for(let d=0,p=u.length;d<p;d++)l[d+a+1]=u[d];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let f=n.text.length-(s-o);if(f!==0)for(let d=a+1+u.length,p=l.length;d<p;d++)l[d]=l[d]+f}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error(\"Unknown change event received\");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=U0(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return e=this.ensureBeforeEOL(e,r[o]),{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1<r.length?r[e.line+1]:this._content.length,o=Math.min(n+e.character,i);return this.ensureBeforeEOL(o,n)}ensureBeforeEOL(e,r){for(;e>r&&B0(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text==\"string\"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength==\"number\")}static isFull(e){let r=e;return r!=null&&typeof r.text==\"string\"&&r.range===void 0&&r.rangeLength===void 0}},ca;(function(t){function e(i,o,s,a){return new Qd(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof Qd)return i.update(o,s),i;throw new Error(\"TextDocument.update: document must be created by TextDocument.create\")}t.update=r;function n(i,o){let s=i.getText(),a=ox(o.map(UF),(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=0,l=[];for(let u of a){let f=i.offsetAt(u.range.start);if(f<c)throw new Error(\"Overlapping edit\");f>c&&l.push(s.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(s.substr(c)),l.join(\"\")}t.applyEdits=n})(ca||(ca={}));function ox(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);ox(n,e),ox(i,e);let o=0,s=0,a=0;for(;o<n.length&&s<i.length;)e(n[o],i[s])<=0?t[a++]=n[o++]:t[a++]=i[s++];for(;o<n.length;)t[a++]=n[o++];for(;s<i.length;)t[a++]=i[s++];return t}function U0(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);B0(o)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function B0(t){return t===13||t===10}function H0(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function UF(t){let e=H0(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var X0;(()=>{\"use strict\";var t={975:M=>{function R(A){if(typeof A!=\"string\")throw new TypeError(\"Path must be a string. Received \"+JSON.stringify(A))}function D(A,I){for(var S,G=\"\",V=0,B=-1,K=0,Q=0;Q<=A.length;++Q){if(Q<A.length)S=A.charCodeAt(Q);else{if(S===47)break;S=47}if(S===47){if(!(B===Q-1||K===1))if(B!==Q-1&&K===2){if(G.length<2||V!==2||G.charCodeAt(G.length-1)!==46||G.charCodeAt(G.length-2)!==46){if(G.length>2){var _e=G.lastIndexOf(\"/\");if(_e!==G.length-1){_e===-1?(G=\"\",V=0):V=(G=G.slice(0,_e)).length-1-G.lastIndexOf(\"/\"),B=Q,K=0;continue}}else if(G.length===2||G.length===1){G=\"\",V=0,B=Q,K=0;continue}}I&&(G.length>0?G+=\"/..\":G=\"..\",V=2)}else G.length>0?G+=\"/\"+A.slice(B+1,Q):G=A.slice(B+1,Q),V=Q-B-1;B=Q,K=0}else S===46&&K!==-1?++K:K=-1}return G}var X={resolve:function(){for(var A,I=\"\",S=!1,G=arguments.length-1;G>=-1&&!S;G--){var V;G>=0?V=arguments[G]:(A===void 0&&(A=process.cwd()),V=A),R(V),V.length!==0&&(I=V+\"/\"+I,S=V.charCodeAt(0)===47)}return I=D(I,!S),S?I.length>0?\"/\"+I:\"/\":I.length>0?I:\".\"},normalize:function(A){if(R(A),A.length===0)return\".\";var I=A.charCodeAt(0)===47,S=A.charCodeAt(A.length-1)===47;return(A=D(A,!I)).length!==0||I||(A=\".\"),A.length>0&&S&&(A+=\"/\"),I?\"/\"+A:A},isAbsolute:function(A){return R(A),A.length>0&&A.charCodeAt(0)===47},join:function(){if(arguments.length===0)return\".\";for(var A,I=0;I<arguments.length;++I){var S=arguments[I];R(S),S.length>0&&(A===void 0?A=S:A+=\"/\"+S)}return A===void 0?\".\":X.normalize(A)},relative:function(A,I){if(R(A),R(I),A===I||(A=X.resolve(A))===(I=X.resolve(I)))return\"\";for(var S=1;S<A.length&&A.charCodeAt(S)===47;++S);for(var G=A.length,V=G-S,B=1;B<I.length&&I.charCodeAt(B)===47;++B);for(var K=I.length-B,Q=V<K?V:K,_e=-1,J=0;J<=Q;++J){if(J===Q){if(K>Q){if(I.charCodeAt(B+J)===47)return I.slice(B+J+1);if(J===0)return I.slice(B+J)}else V>Q&&(A.charCodeAt(S+J)===47?_e=J:J===0&&(_e=0));break}var ye=A.charCodeAt(S+J);if(ye!==I.charCodeAt(B+J))break;ye===47&&(_e=J)}var nt=\"\";for(J=S+_e+1;J<=G;++J)J!==G&&A.charCodeAt(J)!==47||(nt.length===0?nt+=\"..\":nt+=\"/..\");return nt.length>0?nt+I.slice(B+_e):(B+=_e,I.charCodeAt(B)===47&&++B,I.slice(B))},_makeLong:function(A){return A},dirname:function(A){if(R(A),A.length===0)return\".\";for(var I=A.charCodeAt(0),S=I===47,G=-1,V=!0,B=A.length-1;B>=1;--B)if((I=A.charCodeAt(B))===47){if(!V){G=B;break}}else V=!1;return G===-1?S?\"/\":\".\":S&&G===1?\"//\":A.slice(0,G)},basename:function(A,I){if(I!==void 0&&typeof I!=\"string\")throw new TypeError('\"ext\" argument must be a string');R(A);var S,G=0,V=-1,B=!0;if(I!==void 0&&I.length>0&&I.length<=A.length){if(I.length===A.length&&I===A)return\"\";var K=I.length-1,Q=-1;for(S=A.length-1;S>=0;--S){var _e=A.charCodeAt(S);if(_e===47){if(!B){G=S+1;break}}else Q===-1&&(B=!1,Q=S+1),K>=0&&(_e===I.charCodeAt(K)?--K==-1&&(V=S):(K=-1,V=Q))}return G===V?V=Q:V===-1&&(V=A.length),A.slice(G,V)}for(S=A.length-1;S>=0;--S)if(A.charCodeAt(S)===47){if(!B){G=S+1;break}}else V===-1&&(B=!1,V=S+1);return V===-1?\"\":A.slice(G,V)},extname:function(A){R(A);for(var I=-1,S=0,G=-1,V=!0,B=0,K=A.length-1;K>=0;--K){var Q=A.charCodeAt(K);if(Q!==47)G===-1&&(V=!1,G=K+1),Q===46?I===-1?I=K:B!==1&&(B=1):I!==-1&&(B=-1);else if(!V){S=K+1;break}}return I===-1||G===-1||B===0||B===1&&I===G-1&&I===S+1?\"\":A.slice(I,G)},format:function(A){if(A===null||typeof A!=\"object\")throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof A);return(function(I,S){var G=S.dir||S.root,V=S.base||(S.name||\"\")+(S.ext||\"\");return G?G===S.root?G+V:G+\"/\"+V:V})(0,A)},parse:function(A){R(A);var I={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(A.length===0)return I;var S,G=A.charCodeAt(0),V=G===47;V?(I.root=\"/\",S=1):S=0;for(var B=-1,K=0,Q=-1,_e=!0,J=A.length-1,ye=0;J>=S;--J)if((G=A.charCodeAt(J))!==47)Q===-1&&(_e=!1,Q=J+1),G===46?B===-1?B=J:ye!==1&&(ye=1):B!==-1&&(ye=-1);else if(!_e){K=J+1;break}return B===-1||Q===-1||ye===0||ye===1&&B===Q-1&&B===K+1?Q!==-1&&(I.base=I.name=K===0&&V?A.slice(1,Q):A.slice(K,Q)):(K===0&&V?(I.name=A.slice(1,B),I.base=A.slice(1,Q)):(I.name=A.slice(K,B),I.base=A.slice(K,Q)),I.ext=A.slice(B,Q)),K>0?I.dir=A.slice(0,K-1):V&&(I.dir=\"/\"),I},sep:\"/\",delimiter:\":\",win32:null,posix:null};X.posix=X,M.exports=X}},e={};function r(M){var R=e[M];if(R!==void 0)return R.exports;var D=e[M]={exports:{}};return t[M](D,D.exports,r),D.exports}r.d=(M,R)=>{for(var D in R)r.o(R,D)&&!r.o(M,D)&&Object.defineProperty(M,D,{enumerable:!0,get:R[D]})},r.o=(M,R)=>Object.prototype.hasOwnProperty.call(M,R),r.r=M=>{typeof Symbol<\"u\"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(M,\"__esModule\",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>Ce}),typeof process==\"object\"?i=process.platform===\"win32\":typeof navigator==\"object\"&&(i=navigator.userAgent.indexOf(\"Windows\")>=0);let o=/^\\w[\\w\\d+.-]*$/,s=/^\\//,a=/^\\/\\//;function c(M,R){if(!M.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${M.authority}\", path: \"${M.path}\", query: \"${M.query}\", fragment: \"${M.fragment}\"}`);if(M.scheme&&!o.test(M.scheme))throw new Error(\"[UriError]: Scheme contains illegal characters.\");if(M.path){if(M.authority){if(!s.test(M.path))throw new 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(a.test(M.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")')}}let l=\"\",u=\"/\",f=/^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;class d{constructor(R,D,X,A,I,S=!1){xe(this,\"scheme\");xe(this,\"authority\");xe(this,\"path\");xe(this,\"query\");xe(this,\"fragment\");typeof R==\"object\"?(this.scheme=R.scheme||l,this.authority=R.authority||l,this.path=R.path||l,this.query=R.query||l,this.fragment=R.fragment||l):(this.scheme=(function(G,V){return G||V?G:\"file\"})(R,S),this.authority=D||l,this.path=(function(G,V){switch(G){case\"https\":case\"http\":case\"file\":V?V[0]!==u&&(V=u+V):V=u}return V})(this.scheme,X||l),this.query=A||l,this.fragment=I||l,c(this,S))}static isUri(R){return R instanceof d||!!R&&typeof R.authority==\"string\"&&typeof R.fragment==\"string\"&&typeof R.path==\"string\"&&typeof R.query==\"string\"&&typeof R.scheme==\"string\"&&typeof R.fsPath==\"string\"&&typeof R.with==\"function\"&&typeof R.toString==\"function\"}get fsPath(){return E(this,!1)}with(R){if(!R)return this;let{scheme:D,authority:X,path:A,query:I,fragment:S}=R;return D===void 0?D=this.scheme:D===null&&(D=l),X===void 0?X=this.authority:X===null&&(X=l),A===void 0?A=this.path:A===null&&(A=l),I===void 0?I=this.query:I===null&&(I=l),S===void 0?S=this.fragment:S===null&&(S=l),D===this.scheme&&X===this.authority&&A===this.path&&I===this.query&&S===this.fragment?this:new m(D,X,A,I,S)}static parse(R,D=!1){let X=f.exec(R);return X?new m(X[2]||l,L(X[4]||l),L(X[5]||l),L(X[7]||l),L(X[9]||l),D):new m(l,l,l,l,l)}static file(R){let D=l;if(i&&(R=R.replace(/\\\\/g,u)),R[0]===u&&R[1]===u){let X=R.indexOf(u,2);X===-1?(D=R.substring(2),R=u):(D=R.substring(2,X),R=R.substring(X)||u)}return new m(\"file\",D,R,l,l)}static from(R){let D=new m(R.scheme,R.authority,R.path,R.query,R.fragment);return c(D,!0),D}toString(R=!1){return b(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof d)return R;{let D=new m(R);return D._formatted=R.external,D._fsPath=R._sep===p?R.fsPath:null,D}}return R}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);xe(this,\"_formatted\",null);xe(this,\"_fsPath\",null)}get fsPath(){return this._fsPath||(this._fsPath=E(this,!1)),this._fsPath}toString(D=!1){return D?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let D={$mid:1};return this._fsPath&&(D.fsPath=this._fsPath,D._sep=p),this._formatted&&(D.external=this._formatted),this.path&&(D.path=this.path),this.scheme&&(D.scheme=this.scheme),this.authority&&(D.authority=this.authority),this.query&&(D.query=this.query),this.fragment&&(D.fragment=this.fragment),D}}let w={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 T(M,R,D){let X,A=-1;for(let I=0;I<M.length;I++){let S=M.charCodeAt(I);if(S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||R&&S===47||D&&S===91||D&&S===93||D&&S===58)A!==-1&&(X+=encodeURIComponent(M.substring(A,I)),A=-1),X!==void 0&&(X+=M.charAt(I));else{X===void 0&&(X=M.substr(0,I));let G=w[S];G!==void 0?(A!==-1&&(X+=encodeURIComponent(M.substring(A,I)),A=-1),X+=G):A===-1&&(A=I)}}return A!==-1&&(X+=encodeURIComponent(M.substring(A))),X!==void 0?X:M}function _(M){let R;for(let D=0;D<M.length;D++){let X=M.charCodeAt(D);X===35||X===63?(R===void 0&&(R=M.substr(0,D)),R+=w[X]):R!==void 0&&(R+=M[D])}return R!==void 0?R:M}function E(M,R){let D;return D=M.authority&&M.path.length>1&&M.scheme===\"file\"?`//${M.authority}${M.path}`:M.path.charCodeAt(0)===47&&(M.path.charCodeAt(1)>=65&&M.path.charCodeAt(1)<=90||M.path.charCodeAt(1)>=97&&M.path.charCodeAt(1)<=122)&&M.path.charCodeAt(2)===58?R?M.path.substr(1):M.path[1].toLowerCase()+M.path.substr(2):M.path,i&&(D=D.replace(/\\//g,\"\\\\\")),D}function b(M,R){let D=R?_:T,X=\"\",{scheme:A,authority:I,path:S,query:G,fragment:V}=M;if(A&&(X+=A,X+=\":\"),(I||A===\"file\")&&(X+=u,X+=u),I){let B=I.indexOf(\"@\");if(B!==-1){let K=I.substr(0,B);I=I.substr(B+1),B=K.lastIndexOf(\":\"),B===-1?X+=D(K,!1,!1):(X+=D(K.substr(0,B),!1,!1),X+=\":\",X+=D(K.substr(B+1),!1,!0)),X+=\"@\"}I=I.toLowerCase(),B=I.lastIndexOf(\":\"),B===-1?X+=D(I,!1,!0):(X+=D(I.substr(0,B),!1,!0),X+=I.substr(B))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){let B=S.charCodeAt(1);B>=65&&B<=90&&(S=`/${String.fromCharCode(B+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){let B=S.charCodeAt(0);B>=65&&B<=90&&(S=`${String.fromCharCode(B+32)}:${S.substr(2)}`)}X+=D(S,!0,!1)}return G&&(X+=\"?\",X+=D(G,!1,!1)),V&&(X+=\"#\",X+=R?V:T(V,!1,!1)),X}function N(M){try{return decodeURIComponent(M)}catch{return M.length>3?M.substr(0,3)+N(M.substr(3)):M}}let F=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function L(M){return M.match(F)?M.replace(F,(R=>N(R))):M}var j=r(975);let te=j.posix||j,oe=\"/\";var Ce;(function(M){M.joinPath=function(R,...D){return R.with({path:te.join(R.path,...D)})},M.resolvePath=function(R,...D){let X=R.path,A=!1;X[0]!==oe&&(X=oe+X,A=!0);let I=te.resolve(X,...D);return A&&I[0]===oe&&!R.authority&&(I=I.substring(1)),R.with({path:I})},M.dirname=function(R){if(R.path.length===0||R.path===oe)return R;let D=te.dirname(R.path);return D.length===1&&D.charCodeAt(0)===46&&(D=\"\"),R.with({path:D})},M.basename=function(R){return te.basename(R.path)},M.extname=function(R){return te.extname(R.path)}})(Ce||(Ce={})),X0=n})();var{URI:wt,Utils:la}=X0;var At;(function(t){t.basename=la.basename,t.dirname=la.dirname,t.extname=la.extname,t.joinPath=la.joinPath,t.resolvePath=la.resolvePath;let e=typeof process==\"object\"&&process?.platform===\"win32\";function r(s,a){return s?.toString()===a?.toString()}t.equals=r;function n(s,a){let c=typeof s==\"string\"?wt.parse(s).path:s.path,l=typeof a==\"string\"?wt.parse(a).path:a.path,u=c.split(\"/\").filter(w=>w.length>0),f=l.split(\"/\").filter(w=>w.length>0);if(e){let w=/^[A-Z]:$/;if(u[0]&&w.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&w.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return l.substring(1)}let d=0;for(;d<u.length&&u[d]===f[d];d++);let p=\"../\".repeat(u.length-d),m=f.slice(d).join(\"/\");return p+m}t.relative=n;function i(s){return wt.parse(s.toString()).toString()}t.normalize=i;function o(s,a){let c=typeof s==\"string\"?s:s.path,l=typeof a==\"string\"?a:a.path;return l.charAt(l.length-1)===\"/\"&&(l=l.slice(0,-1)),c.charAt(c.length-1)===\"/\"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!==\"/\"?!1:l.startsWith(c)}t.contains=o})(At||(At={}));var ua=class{constructor(){this.root={name:\"\",children:new Map}}normalizeUri(e){return At.normalize(e)}clear(){this.root.children.clear()}insert(e,r){let n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){let r=this.getNode(this.normalizeUri(e),!1);r?.parent&&r.parent.children.delete(r.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 r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:At.joinPath(wt.parse(r),n.name).toString(),element:n.element}}findChildren(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:At.joinPath(wt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(At.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){let n=e.split(\"/\");e.charAt(e.length-1)===\"/\"&&n.pop();let i=this.root;for(let o of n){let s=i.children.get(o);if(!s)if(r)s={name:o,children:new Map,parent:i},i.children.set(o,s);else return;i=s}return i}collectValues(e){let r=[];e.element&&r.push(e.element);for(let n of e.children.values())r.push(...this.collectValues(n));return r}};var Ae;(function(t){t[t.Changed=0]=\"Changed\",t[t.Parsed=1]=\"Parsed\",t[t.IndexedContent=2]=\"IndexedContent\",t[t.ComputedScopes=3]=\"ComputedScopes\",t[t.Linked=4]=\"Linked\",t[t.IndexedReferences=5]=\"IndexedReferences\",t[t.Validated=6]=\"Validated\"})(Ae||(Ae={}));var Al=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=le.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??wt.parse(e.uri),le.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return le.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r==\"string\"){let i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if(\"$model\"in r){let i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{let i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r==\"string\"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let o;if(n)o={parseResult:e,uri:r,state:Ae.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:Ae.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=o,o}async update(e,r){let n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),o=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,\"textDocument\",{value:i});else{let s=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,\"textDocument\",{get:s})}return n!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=Ae.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=ca.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??\"\"))}},kl=class{constructor(e){this.documentTrie=new ua,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Se(this.documentTrie.all())}addDocument(e){let r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){let r=e.toString();return this.documentTrie.find(r)}getDocuments(e){let r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Ae.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Ae.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=Ae.Changed;return this.documentTrie.delete(r),n}};var Do=Symbol(\"RefResolving\"),Il=class{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,r=le.CancellationToken.None){if(this.profiler?.isActive(\"linking\")){let n=this.profiler.createTask(\"linking\",this.languageId);n.start();try{for(let i of Yt(e.parseResult.value))await Tt(r),oi(i).forEach(o=>{let s=`${i.$type}:${o.property}`;n.startSubTask(s);try{this.doLink(o,e)}finally{n.stopSubTask(s)}})}finally{n.stop()}}else for(let n of Yt(e.parseResult.value))await Tt(r),oi(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if(\"_ref\"in n&&n._ref===void 0){n._ref=Do;try{let i=this.getCandidate(e);if(Qi(i))n._ref=i;else{n._nodeDescription=i;let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);let o=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${o}`}}r.references.push(n)}else if(\"_items\"in n&&n._items===void 0){n._items=Do;try{let i=this.getCandidates(e),o=[];if(Qi(i))n._linkingError=i;else for(let s of i){let a=this.loadAstNode(s);a&&o.push({ref:a,$nodeDescription:s})}n._items=o}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(let r of e.references)\"_ref\"in r?(r._ref=void 0,delete r._nodeDescription):\"_items\"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(xt(this._ref))return this._ref;if(um(this._nodeDescription)){let a=o.loadAstNode(this._nodeDescription);this._ref=a??o.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Do;let a=ls(e).$document,c=o.getLinkedNode({reference:s,container:e,property:r});if(c.error&&a&&a.state<Ae.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,a?.references.push(this)}else this._ref===Do&&o.throwCyclicReferenceError(e,r,i);return xt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Qi(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=Do;let a=ls(e).$document,c=o.getCandidates({reference:s,container:e,property:r}),l=[];if(Qi(c))this._linkingError=c;else for(let u of c){let f=o.loadAstNode(u);f&&l.push({ref:f,$nodeDescription:u})}this._items=l,a?.references.push(this)}else this._items===Do&&o.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=o.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{let r=this.getCandidate(e);if(Qi(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);let n=r.message??String(r);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 r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=ls(e.container).$document;n&&n.state<Ae.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}};function G0(t){return typeof t.name==\"string\"}var Sl=class{getName(e){if(G0(e))return e.name}getNameNode(e){return Xc(e.$cstNode,\"name\")}};var Nl=class{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=Yt(e.Grammar).some(r=>Ur(r)&&r.isMulti)}findDeclarations(e){if(e){let r=Zm(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Nt(i)||mr(i))return rf(i);if(Array.isArray(i)){for(let o of i)if((Nt(o)||mr(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return rf(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||Lm(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(let i of oi(n))if(mr(i.reference)&&i.reference.items.some(o=>o.ref===e))return i.reference.items.map(o=>o.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let r=this.findDeclarations(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&n.push(o)}return n}findReferences(e,r){let n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(o=>At.equals(o.sourceUri,r.documentUri))),n.push(...i),Se(n)}getSelfReferences(e){let r=this.getSelfNodes(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i);if(o){let s=Xt(i),a=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:a,targetUri:s.uri,targetPath:a,segment:po(o),local:!0})}}return n}};var jt=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return as.sum(Se(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let r=this.map.get(e);return r?Se(r):ii}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Se(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Se(this.map.keys())}values(){return Se(this.map.values()).flat()}entriesGroupedByKey(){return Se(this.map.entries())}},Mo=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}};var Cl=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=le.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Rc,i=le.CancellationToken.None){let o=[];this.addExportedSymbol(e,o,r);for(let s of n(e))await Tt(i),this.addExportedSymbol(s,o,r);return o}addExportedSymbol(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=le.CancellationToken.None){let n=e.parseResult.value,i=new jt;for(let o of Mr(n))await Tt(r),this.addLocalSymbol(o,e,i);return i}addLocalSymbol(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var fa=class{constructor(e,r,n){this.elements=e,this.outerScope=r,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 r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},sx=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Se(i).concat(this.outerScope.getElements(e)):Se(i)}getAllElements(){let e=Se(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},Pl=class{constructor(e,r,n){this.elements=new jt,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Se(n).concat(this.outerScope.getElements(e)):Se(n)}getAllElements(){let e=Se(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},BF={getElement(){},getElements(){return ii},getAllElements(){return ii}};var da=class{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 new Error(\"This cache has already been disposed\")}},Ol=class extends da{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},$o=class extends da{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},ep=class extends $o{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let o of i)this.clear(o)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let o=n.concat(i);for(let s of o)this.clear(s)}))}},pa=class extends Ol{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Ll=class{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 pa(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Xt(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(a=>this.reflection.isSubtype(a.type,n))),s=s.$container;while(s)}let o=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)o=this.createScope(r[s],o);return o}createScope(e,r,n){return new fa(Se(e),r,n)}createScopeForNodes(e,r,n){let i=Se(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new fa(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Pl(this.indexManager.allElements(e)))}};function ax(t){return typeof t.$comment==\"string\"}function j0(t){return typeof t==\"object\"&&!!t&&(\"$ref\"in t||\"$error\"in t)}var Dl=class{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,r){let n=r??{},i=r?.replacer,o=(a,c)=>this.replacer(a,c,n),s=i?(a,c)=>i(a,c,o):o;try{return this.currentDocument=Xt(e),JSON.stringify(e,s,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){let n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:o,comments:s,uriConverter:a}){if(!this.ignoreProperties.has(e))if(Nt(r)){let c=r.ref,l=n?r.$refText:void 0;if(c){let u=Xt(c),f=\"\";this.currentDocument&&this.currentDocument!==u&&(a?f=a(u.uri,c):f=u.uri.toString());let d=this.astNodeLocator.getAstNodePath(c);return{$ref:`${f}#${d}`,$refText:l}}else return{$error:r.error?.message??\"Could not resolve reference\",$refText:l}}else if(mr(r)){let c=n?r.$refText:void 0,l=[];for(let u of r.items){let f=u.ref,d=Xt(u.ref),p=\"\";this.currentDocument&&this.currentDocument!==d&&(a?p=a(d.uri,f):p=d.uri.toString());let m=this.astNodeLocator.getAstNodePath(f);l.push(`${p}#${m}`)}return{$refs:l,$refText:c}}else if(xt(r)){let c;if(o&&(c=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...r}),c.$sourceText=r.$cstNode?.text),s){c??(c={...r});let l=this.commentProvider.getComment(r);l&&(c.$comment=l.replace(/\\r/g,\"\"))}return c??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith(\"$\")).forEach(o=>{let s=qm(e.$cstNode,o).map(r);s.length!==0&&(i[o]=s)}),e}}linkNode(e,r,n,i,o,s){for(let[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){let f=l[u];j0(f)?l[u]=this.reviveReference(e,c,r,f,n):xt(f)&&this.linkNode(f,r,n,e,c,u)}else j0(l)?e[c]=this.reviveReference(e,c,r,l,n):xt(l)&&this.linkNode(l,r,n,e,c);let a=e;a.$container=i,a.$containerProperty=o,a.$containerIndex=s}reviveReference(e,r,n,i,o){let s=i.$refText,a=i.$error,c;if(i.$ref){let l=this.getRefNode(n,i.$ref,o.uriConverter);if(xt(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??\"\",ref:l};a=l}else if(i.$refs){let l=[];for(let u of i.$refs){let f=this.getRefNode(n,u,o.uriConverter);xt(f)&&l.push({ref:f})}if(l.length===0)c={$refText:s??\"\",items:l},a??(a=\"Could not resolve multi-reference\");else return{$refText:s??\"\",items:l}}if(a)return c??(c={$refText:s??\"\",ref:void 0}),c.error={info:{container:e,property:r,reference:c},message:a},c}getRefNode(e,r,n){try{let i=r.indexOf(\"#\");if(i===0){let c=this.astNodeLocator.getAstNode(e,r.substring(1));return c||\"Could not resolve path: \"+r}if(i<0){let c=n?n(r):wt.parse(r),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:\"Could not find document for URI: \"+r}let o=n?n(r.substring(0,i)):wt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(o);if(!s)return\"Could not find document for URI: \"+r;if(i===r.length-1)return s.parseResult.value;let a=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return a||\"Could not resolve URI: \"+r}catch(i){return String(i)}}};var Ml=class{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 r=e.LanguageMetaData;for(let n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(let n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error(\"The service registry is empty. Use `register` to register the services of a language.\");let r=this.textDocuments?.get(e)?.languageId;if(r!==void 0){let s=this.languageIdMap.get(r);if(s)return s}let n=At.extname(e),i=At.basename(e),o=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!o)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Fo(t){return{code:t}}var tp;(function(t){t.defaults=[\"fast\",\"slow\",\"built-in\"],t.all=t.defaults})(tp||(tp={}));var $l=class{constructor(e){this.entries=new jt,this.knownCategories=new Set(tp.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n=\"fast\"){if(n===\"built-in\")throw new Error(\"The 'built-in' category is reserved for lexer, parser, and linker errors.\");this.knownCategories.add(n);for(let[i,o]of Object.entries(e)){let s=o;if(Array.isArray(s))for(let a of s){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof s==\"function\"){let a={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,a)}else sn(s)}}wrapValidationException(e,r){return async(n,i,o)=>{await this.handleException(()=>e.call(r,n,i,o),\"An error occurred during validation\",i,n)}}async handleException(e,r,n,i){try{await e()}catch(o){if(pn(o))throw o;console.error(`${r}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let s=o instanceof Error?o.message:String(o);n(\"error\",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e===\"AstNode\"){this.entries.add(\"AstNode\",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Se(this.entries.get(e)).concat(this.entries.get(\"AstNode\"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,\"An error occurred during set-up of the validation\",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,\"An error occurred during tear-down of the validation\",r))}wrapPreparationException(e,r,n){return async(i,o,s,a)=>{await this.handleException(()=>e.call(n,i,o,s,a),r,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};var z0=Object.freeze({validateNode:!0,validateChildren:!0}),Fl=class{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,r={},n=le.CancellationToken.None){let i=e.parseResult,o=[];if(await Tt(n),(!r.categories||r.categories.includes(\"built-in\"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>s.data?.code===kr.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>s.data?.code===kr.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>s.data?.code===kr.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(pn(s))throw s;console.error(\"An error occurred during validation:\",s)}return await Tt(n),o}processLexingErrors(e,r,n){let i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let o of i){let s=o.severity??\"error\",a={severity:rp(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:q0(s),source:this.getSource()};r.push(a)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if(\"previousToken\"in i){let s=i.previousToken;if(isNaN(s.startOffset)){let a={line:0,character:0};o={start:a,end:a}}else{let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}}}else o=xs(i.token);if(o){let s={severity:rp(\"error\"),range:o,message:i.message,data:Fo(kr.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let s={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:kr.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic(\"error\",o.message,s))}}}async validateAst(e,r,n=le.CancellationToken.None){let i=[],o=(s,a,c)=>{i.push(this.toDiagnostic(s,a,c))};return await this.validateAstBefore(e,r,o,n),await this.validateAstNodes(e,r,o,n),await this.validateAstAfter(e,r,o,n),i}async validateAstBefore(e,r,n,i=le.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await Tt(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=le.CancellationToken.None){if(this.profiler?.isActive(\"validating\")){let o=this.profiler.createTask(\"validating\",this.languageId);o.start();try{let s=Yt(e).iterator();for(let a of s){o.startSubTask(a.$type);let c=this.validateSingleNodeOptions(a,r);if(c.validateNode)try{let l=this.validationRegistry.getChecks(a.$type,r.categories);for(let u of l)await u(a,n,i)}finally{o.stopSubTask(a.$type)}c.validateChildren||s.prune()}}finally{o.stop()}}else{let o=Yt(e).iterator();for(let s of o){await Tt(i);let a=this.validateSingleNodeOptions(s,r);if(a.validateNode){let c=this.validationRegistry.getChecks(s.$type,r.categories);for(let l of c)await l(s,n,i)}a.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return z0}async validateAstAfter(e,r,n,i=le.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await Tt(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:W0(n),severity:rp(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 W0(t){if(t.range)return t.range;let e;return typeof t.property==\"string\"?e=Xc(t.node.$cstNode,t.property,t.index):typeof t.keyword==\"string\"&&(e=Ym(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function rp(t){switch(t){case\"error\":return 1;case\"warning\":return 2;case\"info\":return 3;case\"hint\":return 4;default:throw new Error(\"Invalid diagnostic severity: \"+t)}}function q0(t){switch(t){case\"error\":return Fo(kr.LexingError);case\"warning\":return Fo(kr.LexingWarning);case\"info\":return Fo(kr.LexingInfo);case\"hint\":return Fo(kr.LexingHint);default:throw new Error(\"Invalid diagnostic severity: \"+t)}}var kr;(function(t){t.LexingError=\"lexing-error\",t.LexingWarning=\"lexing-warning\",t.LexingInfo=\"lexing-info\",t.LexingHint=\"lexing-hint\",t.ParsingError=\"parsing-error\",t.LinkingError=\"linking-error\"})(kr||(kr={}));var Ul=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n??Xt(e);r??(r=this.nameProvider.getName(e));let o=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${o} has no name.`);let s,a=()=>s??(s=po(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return a()},selectionSegment:po(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},Bl=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=le.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of Yt(i))await Tt(r),oi(o).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){let r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Nt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:mr(r)&&(n=r.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));let i=Xt(e.container).uri,o=this.nodeLocator.getAstNodePath(e.container),s=[],a=po(r.$refNode);for(let c of n)s.push({sourceUri:i,sourcePath:o,targetUri:c.documentUri,targetPath:c.path,segment:a,local:At.equals(c.documentUri,i)});return s}};var Hl=class{constructor(){this.segmentSeparator=\"/\",this.indexSeparator=\"@\"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return\"\"}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error(\"Missing '$containerProperty' in AST node.\");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),c=parseInt(o.substring(s+1));return i[a]?.[c]}return i[o]},e)}};var ft={};$e(ft,im(tx(),1));var Xl=class{constructor(e){this._ready=new rr,this.onConfigurationSectionUpdateEmitter=new ft.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 r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!=\"object\"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Oa=im(TI(),1);var Ui;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Ui||(Ui={}));var Jl=class{constructor(e){this.updateBuildOptions={validation:{categories:[\"built-in\",\"fast\"]}},this.updateListeners=[],this.buildPhaseListeners=new jt,this.documentPhaseListeners=new jt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Ae.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,r={},n=le.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===Ae.Validated){if(typeof r.validation==\"boolean\"&&r.validation)this.resetToState(i,Ae.IndexedReferences);else if(typeof r.validation==\"object\"){let s=this.findMissingValidationCategories(i,r);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(o)?.result}),i.state=Ae.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=Ae.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=le.CancellationToken.None){this.currentState=Ae.Changed;let i=[];for(let c of r){let l=this.langiumDocuments.deleteDocuments(c);for(let u of l)i.push(u.uri),this.cleanUpDeleted(u)}let o=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(let c of o){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:\"INVALID\"},c),l.state=Ae.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,Ae.Changed)}let s=Se(o).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!s.has(c.uri.toString())&&this.shouldRelink(c,s)).forEach(c=>this.resetToState(c,Ae.ComputedScopes)),await this.emitUpdate(o,i),await Tt(n);let a=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<Ae.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){let n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),o=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation==\"object\"?r.validation.categories??i:[];return Se(s).filter(a=>!o.has(a)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let n=await this.fileSystemProvider.stat(e);if(n.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(n))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Ui.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Ae.Changed:case Ae.Parsed:this.indexManager.removeContent(e.uri);case Ae.IndexedContent:e.localSymbols=void 0;case Ae.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Ae.Linked:this.indexManager.removeReferences(e.uri);case Ae.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Ae.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Ae.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Ae.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Ae.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Ae.ComputedScopes,n,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await a.collectLocalSymbols(s,n)});let i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Ae.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Ae.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));let o=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(o,Ae.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){let r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){for(let s of e)s.state<r&&(await Tt(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));let o=e.filter(s=>s.state===r);await this.notifyBuildPhase(o,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ui.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ui.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&\"path\"in r?i=r:n=r,n??(n=le.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){let i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Ar);if(this.currentState>=e&&e>i.state)return Promise.reject(new Oa.ResponseError(Oa.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Ae[i.state]}, requiring ${Ae[e]}, but workspace state is already ${Ae[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Oa.ResponseError(Oa.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(e,l=>{At.equals(l.uri,r)&&(a.dispose(),c.dispose(),o(l.uri))}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),s(Ar)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Ar):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(Ar)})})}async notifyDocumentPhase(e,r,n){let o=this.documentPhaseListeners.get(r).slice();for(let s of o)try{await Tt(n),await s(e,n)}catch(a){if(!pn(a))throw a}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let o=this.buildPhaseListeners.get(r).slice();for(let s of o)await Tt(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),o=typeof i.validation==\"object\"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(e,i);let s=await n.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;let a=this.buildState.get(e.uri.toString());a&&(a.result??(a.result={}),a.result.validationChecks?a.result.validationChecks=Se(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Ql=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new $o,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Xt(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{At.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Se(i)}allElements(e,r){let n=Se(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(o=>this.astReflection.isSubtype(o.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){let r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=le.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),o=e.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(e,r=le.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var eu=class{constructor(e){this.initialBuildOptions={},this._ready=new rr,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(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=le.CancellationToken.None){let n=await this.performStartup(e);await Tt(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);let i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));let o=Se(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(o,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{let i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return wt.parse(e.uri)}async traverseFolder(e,r){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error(\"Failure to read directory content of \"+e.toString(!0),n)}}async searchFolder(e){let r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){let r=At.basename(e.uri);return r.startsWith(\".\")?!1:e.isDirectory?r!==\"node_modules\"&&r!==\"out\":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var tu=class{buildUnexpectedCharactersMessage(e,r,n,i,o){return Ss.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return Ss.buildUnableToPopLexerModeMessage(e)}},Fp={mode:\"full\"},Xo=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=OT(r)?Object.values(r):r,i=e.LanguageMetaData.mode===\"production\";this.chevrotainLexer=new ht(n,{positionTracking:\"full\",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Fp){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(OT(e))return e;let r=LT(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function Up(t){return Array.isArray(t)&&(t.length===0||\"name\"in t[0])}function LT(t){return t&&\"modes\"in t&&\"defaultMode\"in t}function OT(t){return!Up(t)&&!LT(t)}na();function $T(t,e,r){let n,i;typeof t==\"string\"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Be.create(0,0));let o=_I(t),s=UT(n),a=$U({lines:o,position:i,options:s});return XU({index:0,tokens:a,position:i})}function FT(t,e){let r=UT(e),n=_I(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],s=r.start,a=r.end;return!!s?.exec(i)&&!!a?.exec(o)}function _I(t){let e=\"\";return typeof t==\"string\"?e=t:e=t.text,e.split(Bm)}var wI=/\\s*(@([\\p{L}][\\p{L}\\p{N}]*)?)/uy,MU=/\\{(@[\\p{L}][\\p{L}\\p{N}]*)(\\s*)([^\\r\\n}]+)?\\}/gu;function $U(t){let e=[],r=t.position.line,n=t.position.character;for(let i=0;i<t.lines.length;i++){let o=i===0,s=i===t.lines.length-1,a=t.lines[i],c=0;if(o&&t.options.start){let u=t.options.start?.exec(a);u&&(c=u.index+u[0].length)}else{let u=t.options.line?.exec(a);u&&(c=u.index+u[0].length)}if(s){let u=t.options.end?.exec(a);u&&(a=a.substring(0,u.index))}if(a=a.substring(0,HU(a)),MT(a,c)>=a.length){if(e.length>0){let u=Be.create(r,n);e.push({type:\"break\",content:\"\",range:Oe.create(u,u)})}}else{wI.lastIndex=c;let u=wI.exec(a);if(u){let f=u[0],d=u[1],p=Be.create(r,n+c),m=Be.create(r,n+c+f.length);e.push({type:\"tag\",content:d,range:Oe.create(p,m)}),c+=f.length,c=MT(a,c)}if(c<a.length){let f=a.substring(c),d=Array.from(f.matchAll(MU));e.push(...FU(d,f,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type===\"break\"?e.slice(0,-1):e}function FU(t,e,r,n){let i=[];if(t.length===0){let o=Be.create(r,n),s=Be.create(r,n+e.length);i.push({type:\"text\",content:e,range:Oe.create(o,s)})}else{let o=0;for(let a of t){let c=a.index,l=e.substring(o,c);l.length>0&&i.push({type:\"text\",content:e.substring(o,c),range:Oe.create(Be.create(r,o+n),Be.create(r,c+n))});let u=l.length+1,f=a[1];if(i.push({type:\"inline-tag\",content:f,range:Oe.create(Be.create(r,o+u+n),Be.create(r,o+u+f.length+n))}),u+=f.length,a.length===4){u+=a[2].length;let d=a[3];i.push({type:\"text\",content:d,range:Oe.create(Be.create(r,o+u+n),Be.create(r,o+u+d.length+n))})}else i.push({type:\"text\",content:\"\",range:Oe.create(Be.create(r,o+u+n),Be.create(r,o+u+n))});o=c+a[0].length}let s=e.substring(o);s.length>0&&i.push({type:\"text\",content:s,range:Oe.create(Be.create(r,o+n),Be.create(r,o+n+s.length))})}return i}var UU=/\\S/,BU=/\\s*$/;function MT(t,e){let r=t.substring(e).match(UU);return r?e+r.index:t.length}function HU(t){let e=t.match(BU);if(e&&typeof e.index==\"number\")return e.index}function XU(t){let e=Be.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Bp([],Oe.create(e,e));let r=[];for(;t.index<t.tokens.length;){let o=GU(t,r[r.length-1]);o&&r.push(o)}let n=r[0]?.range.start??e,i=r[r.length-1]?.range.end??e;return new Bp(r,Oe.create(n,i))}function GU(t,e){let r=t.tokens[t.index];if(r.type===\"tag\")return vI(t,!1);if(r.type===\"text\"||r.type===\"inline-tag\")return EI(t);jU(r,e),t.index++}function jU(t,e){if(e){let r=new Hp(\"\",t.range);\"inlines\"in e?e.inlines.push(r):e.content.inlines.push(r)}}function EI(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!==\"break\"&&e.type!==\"tag\";)i.push(zU(t)),n=e,e=t.tokens[t.index];return new nu(i,Oe.create(r.range.start,n.range.end))}function zU(t){return t.tokens[t.index].type===\"inline-tag\"?vI(t,!0):RI(t)}function vI(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type===\"text\")if(e){let o=RI(t);return new ru(n,new nu([o],o.range),e,Oe.create(r.range.start,o.range.end))}else{let o=EI(t);return new ru(n,o,e,Oe.create(r.range.start,o.range.end))}else{let o=r.range;return new ru(n,new nu([],o),e,o)}}function RI(t){let e=t.tokens[t.index++];return new Hp(e.content,e.range)}function UT(t){if(!t)return UT({start:\"/**\",end:\"*/\",line:\"*\"});let{start:e,end:r,line:n}=t;return{start:DT(e,!0),end:DT(r,!1),line:DT(n,!0)}}function DT(t,e){if(typeof t==\"string\"||typeof t==\"object\"){let r=typeof t==\"string\"?pi(t):t.source;return e?new RegExp(`^\\\\s*${r}`):new RegExp(`\\\\s*${r}\\\\s*$`)}else return t}var Bp=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>\"name\"in e)}toString(){let e=\"\";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=bI(e)+n}return e.trim()}toMarkdown(e){let r=\"\";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=bI(r)+i}return r.trim()}},ru=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}\n${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let o=WU(this.name,r,e??{});if(typeof o==\"string\")return o}let n=\"\";e?.tag===\"italic\"||e?.tag===void 0?n=\"*\":e?.tag===\"bold\"?n=\"**\":e?.tag===\"bold-italic\"&&(n=\"***\");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \\u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}\n${r}`),this.inline?`{${i}}`:i}};function WU(t,e,r){if(t===\"linkplain\"||t===\"linkcode\"||t===\"link\"){let n=e.indexOf(\" \"),i=e;if(n>0){let s=MT(e,n);i=e.substring(s),e=e.substring(0,n)}return(t===\"linkcode\"||t===\"link\"&&r.link===\"code\")&&(i=`\\`${i}\\``),r.renderLink?.(e,i)??qU(e,i)}}function qU(t,e){try{return wt.parse(t,!0),`[${e}](${t})`}catch{return t}}var nu=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e=\"\";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`\n`)}return e}toMarkdown(e){let r=\"\";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],o=this.inlines[n+1];r+=i.toMarkdown(e),o&&o.range.start.line>i.range.start.line&&(r+=`\n`)}return r}},Hp=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function bI(t){return t.endsWith(`\n`)?`\n`:`\n\n`}var iu=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&FT(r))return $T(r).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(e,i,o),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){let i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,a=i.documentUri.with({fragment:`L${o},${s}`});return`[${n}](${a.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){let i=Xt(e).localSymbols;if(!i)return;let o=e;do{let a=i.getStream(o).find(c=>c.name===r);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var ou=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return ax(e)?e.$comment:Dm(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var su=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},BT=class{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 r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new rr,o,s=r.onCancellationRequested(()=>{o=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(a=>{let c=this.hydrator.hydrate(a);i.resolve(c)}).catch(a=>{i.reject(a)}).finally(()=>{s.dispose(),clearTimeout(o)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new rr;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Ar)}),this.queue.push(r),r.promise}},HT=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new ft.Emitter,this.deferred=new rr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(o=>{let s=o;this.deferred.resolve(s),this.unlock()}),n(o=>{this.deferred.reject(o),this.unlock()})}terminate(){this.deferred.reject(Ar),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error(\"Parser worker is busy\");return this._parsing=!0,this.deferred=new rr,this.sendMessage(e),this.deferred.promise}};var au=class{constructor(){this.previousTokenSource=new le.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=Jd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=le.CancellationToken.None){let i=new rr,o={action:r,deferred:i,cancellationToken:n};return e.push(o),this.performNextOperation(),i.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:r,deferred:n,cancellationToken:i})=>{try{let o=await Promise.resolve().then(()=>r(i));n.resolve(o)}catch(o){pn(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var cu=class{constructor(e){this.grammarElementIdMap=new Mo,this.tokenTypeIdMap=new Mo,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(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of Yt(e))r.set(i,{});if(e.$cstNode)for(let i of fo(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.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,r));for(let[i,o]of Object.entries(e))if(!i.startsWith(\"$\"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)xt(a)?s.push(this.dehydrateAstNode(a,r)):Nt(a)?s.push(this.dehydrateReference(a,r)):s.push(a)}else xt(o)?n[i]=this.dehydrateAstNode(o,r):Nt(o)?n[i]=this.dehydrateReference(o,r):o!==void 0&&(n[i]=o);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return vc(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Dr(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):ni(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 r=e.value,n=this.createHydrationContext(r);return\"$cstNode\"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let o of Yt(e))r.set(o,{});let i;if(e.$cstNode)for(let o of fo(e.$cstNode)){let s;\"fullText\"in o?(s=new ia(o.fullText),i=s):\"content\"in o?s=new Co:\"tokenType\"in o&&(s=this.hydrateCstLeafNode(o)),s&&(n.set(o,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,o]of Object.entries(e))if(!i.startsWith(\"$\"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)xt(a)?s.push(this.setParent(this.hydrateAstNode(a,r),n)):Nt(a)?s.push(this.hydrateReference(a,n,i,r)):s.push(a)}else xt(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):Nt(o)?n[i]=this.hydrateReference(o,n,i,r):o!==void 0&&(n[i]=o);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource==\"number\"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Dr(i))for(let o of e.content){let s=this.hydrateCstNode(o,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,o=e.startLine,s=e.startColumn,a=e.endLine,c=e.endColumn,l=e.hidden;return new No(n,i,{start:{line:o,character:s},end:{line:a,character:c}},r,l)}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 r of Yt(this.grammar))Lc(r)&&this.grammarElementIdMap.set(r,e++)}};function lu(t){return{documentation:{CommentProvider:e=>new ou(e),DocumentationProvider:e=>new iu(e)},parser:{AsyncParser:e=>new su(e),GrammarConfig:e=>eg(e),LangiumParser:e=>Yy(e),CompletionParser:e=>Vy(e),ValueConverter:()=>new Lo,TokenBuilder:()=>new Oo,Lexer:e=>new Xo(e),ParserErrorMessageProvider:()=>new oa,LexerErrorMessageProvider:()=>new tu},workspace:{AstNodeLocator:()=>new Hl,AstNodeDescriptionProvider:e=>new Ul(e),ReferenceDescriptionProvider:e=>new Bl(e)},references:{Linker:e=>new Il(e),NameProvider:()=>new Sl,ScopeProvider:e=>new Ll(e),ScopeComputation:e=>new Cl(e),References:e=>new Nl(e)},serializer:{Hydrator:e=>new cu(e),JsonSerializer:e=>new Dl(e)},validation:{DocumentValidator:e=>new Fl(e),ValidationRegistry:e=>new $l(e)},shared:()=>t.shared}}function uu(t){return{ServiceRegistry:e=>new Ml(e),workspace:{LangiumDocuments:e=>new kl(e),LangiumDocumentFactory:e=>new Al(e),DocumentBuilder:e=>new Jl(e),IndexManager:e=>new Ql(e),WorkspaceManager:e=>new eu(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new au,ConfigurationProvider:e=>new Xl(e)},profilers:{}}}var XT;(function(t){t.merge=(e,r)=>fu(fu({},e),r)})(XT||(XT={}));function Go(t,e,r,n,i,o,s,a,c){let l=[t,e,r,n,i,o,s,a,c].reduce(fu,{});return NI(l)}var II=Symbol(\"isProxy\");function SI(t){if(t&&t[II])for(let e of Object.values(t))SI(e);return t}function NI(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error(\"Cannot set property on injected service container\")},get:(n,i)=>i===II?!0:kI(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(kI(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var AI=Symbol();function kI(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error(\"Construction failure. Please make sure that your dependencies are constructable. Cause: \"+t[e]);if(t[e]===AI)throw new Error('Cycle detected. Please make \"'+String(e)+'\" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=AI;try{t[e]=typeof i==\"function\"?i(n):NI(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function fu(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!=null)if(typeof n==\"object\"){let i=t[r];typeof i==\"object\"&&i!==null?t[r]=fu(i,n):t[r]=fu({},n)}else t[r]=n}return t}var GT={indentTokenName:\"INDENT\",dedentTokenName:\"DEDENT\",whitespaceTokenName:\"WS\",ignoreIndentationDelimiters:[]},jo;(function(t){t.REGULAR=\"indentation-sensitive\",t.IGNORE_INDENTATION=\"ignore-indentation\"})(jo||(jo={}));var La=class extends Oo{constructor(e=GT){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \\t]+/y,this.options={...GT,...e},this.indentTokenType=mi({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=mi({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!Up(n))throw new Error(\"Invalid tokens built by default builder\");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:s,ignoreIndentationDelimiters:a}=this.options,c,l,u,f=[];for(let d of n){for(let[p,m]of a)d.name===p?d.PUSH_MODE=jo.IGNORE_INDENTATION:d.name===m&&(d.POP_MODE=!0);d.name===o?c=d:d.name===i?l=d:d.name===s?u=d:f.push(d)}if(!c||!l||!u)throw new Error(\"Some indentation/whitespace tokens not found!\");return a.length>0?{modes:{[jo.REGULAR]:[c,l,...f,u],[jo.IGNORE_INDENTATION]:[...f,u]},defaultMode:jo.REGULAR}:[c,l,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\\r\n`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;let o=this.whitespaceRegExp.exec(e);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(e,r,n,i){let o=this.getLineNumber(r,i);return Mn(e,n,i,i+n.length,o,o,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\\r\\n|\\r|\\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);return o<=s?null:(this.indentationStack.push(o),a)}dedentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);if(o>=s)return null;let c=this.indentationStack.lastIndexOf(o);if(c===-1)return this.diagnostics.push({severity:\"error\",message:`Invalid dedent level ${o} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:a?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;let l=this.indentationStack.length-c-1,u=e.substring(0,r).match(/[\\r\\n]+$/)?.[0].length??1;for(let f=0;f<l;f++){let d=this.createIndentationTokenInstance(this.dedentTokenType,e,\"\",r-(u-1));n.push(d),this.indentationStack.pop()}return null}buildTerminalToken(e){let r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:o}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===o?mi({name:o,pattern:this.whitespaceRegExp,group:ht.SKIPPED}):r}flushRemainingDedents(e){let r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,\"\",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},du=class extends Xo{constructor(e){if(super(e),e.parser.TokenBuilder instanceof La)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error(\"IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder\")}tokenize(e,r=Fp){let n=super.tokenize(e),i=n.report;r?.mode===\"full\"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:s}=this.indentationTokenBuilder,a=o.tokenTypeIdx,c=s.tokenTypeIdx,l=[],u=n.tokens.length-1;for(let f=0;f<u;f++){let d=n.tokens[f],p=n.tokens[f+1];if(d.tokenTypeIdx===a&&p.tokenTypeIdx===c){f++;continue}l.push(d)}return u>=0&&l.push(n.tokens[u]),n.tokens=l,n}};var Xe={};Rn(Xe,{AstUtils:()=>nf,BiMap:()=>Mo,Cancellation:()=>le,ContextCache:()=>$o,CstUtils:()=>vf,DONE_RESULT:()=>Ht,Deferred:()=>rr,Disposable:()=>Ui,DisposableCache:()=>da,DocumentCache:()=>ep,EMPTY_STREAM:()=>ii,ErrorWithLocation:()=>ho,GrammarUtils:()=>_s,MultiMap:()=>jt,OperationCancelled:()=>Ar,Reduction:()=>as,RegExpUtils:()=>kf,SimpleCache:()=>Ol,StreamImpl:()=>gr,TreeStreamImpl:()=>rn,URI:()=>wt,UriTrie:()=>ua,UriUtils:()=>At,WorkspaceCache:()=>pa,assertCondition:()=>jb,assertUnreachable:()=>sn,delayNextTick:()=>ix,interruptAndCheck:()=>Tt,isOperationCancelled:()=>pn,loadGrammarFromJson:()=>Gp,setInterruptionPeriod:()=>F0,startCancelableOperation:()=>Jd,stream:()=>Se});$e(Xe,ft);var Xp=class{stat(e){throw new Error(\"No file system is available.\")}statSync(e){throw new Error(\"No file system is available.\")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error(\"No file system is available.\")}readBinarySync(){throw new Error(\"No file system is available.\")}readFile(){throw new Error(\"No file system is available.\")}readFileSync(){throw new Error(\"No file system is available.\")}async readDirectory(){return[]}readDirectorySync(){return[]}},pu={fileSystemProvider:()=>new Xp};var VU={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[\".langium\"],languageId:\"langium\"})},YU={AstReflection:()=>new ys};function KU(){let t=Go(uu(pu),YU),e=Go(lu({shared:t}),VU);return t.ServiceRegistry.register(e),e}function Gp(t){let e=KU(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,wt.parse(`memory:/${r.name??\"grammar\"}.langium`)),r}$e(gt,Xe);var jT=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set([\"validating\",\"parsing\",\"linking\"]),this.activeCategories=e??new Set(this.allCategories),this.records=new jt}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category \"${e}\" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new jp(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);let n=[];for(let s of r.entries.keys()){let a=r.entries.get(s),c=a.reduce((l,u)=>l+u);n.push({name:`${r.identifier}.${s}`,count:a.length,duration:c})}let i=r.duration-n.map(s=>s.duration).reduce((s,a)=>s+a,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,a)=>a.duration-s.duration);function o(s){return Math.round(100*s)/100}return console.table(n.map(s=>({Element:s.name,Count:s.count,\"Self %\":o(100*s.duration/r.duration),\"Time (ms)\":o(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},jp=class{constructor(e,r){this.stack=[],this.entries=new jt,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task \"${this.identifier}\" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task \"${this.identifier}\" was not started.`);if(this.stack.length!==0)throw new Error(`Task \"${this.identifier}\" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.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 r=this.stack.pop();if(!r)throw new Error(`Task \"${this.identifier}.${e}\" was not started.`);if(r.id!==e)throw new Error(`Sub-Task \"${r.id}\" is not already stopped.`);let n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let i=n-r.content;this.entries.add(e,i)}};var Ma={$type:\"AnchorDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function xu(t){return Pt.isInstance(t,Ma.$type)}var zT={$type:\"BlockProperty\",key:\"key\",value:\"value\"};var KT={$type:\"CalendarBlock\",properties:\"properties\"};function Kp(t){return Pt.isInstance(t,KT.$type)}var Da={$type:\"ConfigEntry\"};var Yp={$type:\"DefaultDeclaration\",entityType:\"entityType\",properties:\"properties\"};function Bi(t){return Pt.isInstance(t,Yp.$type)}var ZT={$type:\"DescriptionDirective\",text:\"text\"};function ew(t){return Pt.isInstance(t,ZT.$type)}var zp={$type:\"EntityProperty\",key:\"key\",value:\"value\",values:\"values\"};var $a={$type:\"FootnoteDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function Tu(t){return Pt.isInstance(t,$a.$type)}var Fa={$type:\"GroupBlock\",content:\"content\",name:\"name\",properties:\"properties\",title:\"title\"};function Wr(t){return Pt.isInstance(t,Fa.$type)}var hu={$type:\"GroupContent\"};var WT={$type:\"IncludeDeclaration\",options:\"options\",path:\"path\"};var qT={$type:\"IncludeOption\",key:\"key\",value:\"value\"};var Ua={$type:\"ItemDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function _r(t){return Pt.isInstance(t,Ua.$type)}var Ba={$type:\"LabelDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function wu(t){return Pt.isInstance(t,Ba.$type)}var Ha={$type:\"MilestoneDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function bu(t){return Pt.isInstance(t,Ha.$type)}var VT={$type:\"NowlineDirective\",properties:\"properties\",version:\"version\"};var zo={$type:\"NowlineFile\",configEntries:\"configEntries\",directive:\"directive\",hasConfig:\"hasConfig\",includes:\"includes\",roadmapDecl:\"roadmapDecl\",roadmapEntries:\"roadmapEntries\"};var Xa={$type:\"ParallelBlock\",content:\"content\",name:\"name\",properties:\"properties\",title:\"title\"};function qr(t){return Pt.isInstance(t,Xa.$type)}var Wp={$type:\"ParallelContent\"};var Ga={$type:\"PersonDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function jn(t){return Pt.isInstance(t,Ga.$type)}var JT={$type:\"PersonMemberRef\",ref:\"ref\"};function CI(t){return Pt.isInstance(t,JT.$type)}var qp={$type:\"RoadmapDeclaration\",name:\"name\",properties:\"properties\",title:\"title\"};var xn={$type:\"RoadmapEntry\"};var QT={$type:\"ScaleBlock\",properties:\"properties\"};function PI(t){return Pt.isInstance(t,QT.$type)}var ja={$type:\"SizeDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function Wo(t){return Pt.isInstance(t,ja.$type)}var za={$type:\"StatusDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function Ya(t){return Pt.isInstance(t,za.$type)}var gu={$type:\"StyleDeclaration\",name:\"name\",properties:\"properties\",title:\"title\"};function _u(t){return Pt.isInstance(t,gu.$type)}var YT={$type:\"StyleProperty\",key:\"key\",value:\"value\"};var mu={$type:\"SwimlaneContent\"};var Wa={$type:\"SwimlaneDeclaration\",content:\"content\",name:\"name\",properties:\"properties\",title:\"title\"};function Nr(t){return Pt.isInstance(t,Wa.$type)}var qa={$type:\"SymbolDeclaration\",description:\"description\",name:\"name\",properties:\"properties\",title:\"title\"};function Eu(t){return Pt.isInstance(t,qa.$type)}var Vp={$type:\"TeamContent\"};var Va={$type:\"TeamDeclaration\",content:\"content\",name:\"name\",properties:\"properties\",title:\"title\"};function Cr(t){return Pt.isInstance(t,Va.$type)}var yu=class extends Ji{constructor(){super(...arguments);xe(this,\"types\",{AnchorDeclaration:{name:Ma.$type,properties:{description:{name:Ma.description},name:{name:Ma.name},properties:{name:Ma.properties,defaultValue:[]},title:{name:Ma.title}},superTypes:[xn.$type]},BlockProperty:{name:zT.$type,properties:{key:{name:zT.key},value:{name:zT.value}},superTypes:[]},CalendarBlock:{name:KT.$type,properties:{properties:{name:KT.properties,defaultValue:[]}},superTypes:[Da.$type]},ConfigEntry:{name:Da.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:Yp.$type,properties:{entityType:{name:Yp.entityType},properties:{name:Yp.properties,defaultValue:[]}},superTypes:[Da.$type]},DescriptionDirective:{name:ZT.$type,properties:{text:{name:ZT.text}},superTypes:[hu.$type,Wp.$type,mu.$type,Vp.$type]},EntityProperty:{name:zp.$type,properties:{key:{name:zp.key},value:{name:zp.value},values:{name:zp.values,defaultValue:[]}},superTypes:[]},FootnoteDeclaration:{name:$a.$type,properties:{description:{name:$a.description},name:{name:$a.name},properties:{name:$a.properties,defaultValue:[]},title:{name:$a.title}},superTypes:[xn.$type]},GroupBlock:{name:Fa.$type,properties:{content:{name:Fa.content,defaultValue:[]},name:{name:Fa.name},properties:{name:Fa.properties,defaultValue:[]},title:{name:Fa.title}},superTypes:[hu.$type,Wp.$type,mu.$type]},GroupContent:{name:hu.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:WT.$type,properties:{options:{name:WT.options,defaultValue:[]},path:{name:WT.path}},superTypes:[]},IncludeOption:{name:qT.$type,properties:{key:{name:qT.key},value:{name:qT.value}},superTypes:[]},ItemDeclaration:{name:Ua.$type,properties:{description:{name:Ua.description},name:{name:Ua.name},properties:{name:Ua.properties,defaultValue:[]},title:{name:Ua.title}},superTypes:[hu.$type,Wp.$type,mu.$type]},LabelDeclaration:{name:Ba.$type,properties:{description:{name:Ba.description},name:{name:Ba.name},properties:{name:Ba.properties,defaultValue:[]},title:{name:Ba.title}},superTypes:[xn.$type]},MilestoneDeclaration:{name:Ha.$type,properties:{description:{name:Ha.description},name:{name:Ha.name},properties:{name:Ha.properties,defaultValue:[]},title:{name:Ha.title}},superTypes:[xn.$type]},NowlineDirective:{name:VT.$type,properties:{properties:{name:VT.properties,defaultValue:[]},version:{name:VT.version}},superTypes:[]},NowlineFile:{name:zo.$type,properties:{configEntries:{name:zo.configEntries,defaultValue:[]},directive:{name:zo.directive},hasConfig:{name:zo.hasConfig,defaultValue:!1},includes:{name:zo.includes,defaultValue:[]},roadmapDecl:{name:zo.roadmapDecl},roadmapEntries:{name:zo.roadmapEntries,defaultValue:[]}},superTypes:[]},ParallelBlock:{name:Xa.$type,properties:{content:{name:Xa.content,defaultValue:[]},name:{name:Xa.name},properties:{name:Xa.properties,defaultValue:[]},title:{name:Xa.title}},superTypes:[hu.$type,mu.$type]},ParallelContent:{name:Wp.$type,properties:{},superTypes:[]},PersonDeclaration:{name:Ga.$type,properties:{description:{name:Ga.description},name:{name:Ga.name},properties:{name:Ga.properties,defaultValue:[]},title:{name:Ga.title}},superTypes:[xn.$type]},PersonMemberRef:{name:JT.$type,properties:{ref:{name:JT.ref}},superTypes:[Vp.$type]},RoadmapDeclaration:{name:qp.$type,properties:{name:{name:qp.name},properties:{name:qp.properties,defaultValue:[]},title:{name:qp.title}},superTypes:[]},RoadmapEntry:{name:xn.$type,properties:{},superTypes:[]},ScaleBlock:{name:QT.$type,properties:{properties:{name:QT.properties,defaultValue:[]}},superTypes:[Da.$type]},SizeDeclaration:{name:ja.$type,properties:{description:{name:ja.description},name:{name:ja.name},properties:{name:ja.properties,defaultValue:[]},title:{name:ja.title}},superTypes:[xn.$type]},StatusDeclaration:{name:za.$type,properties:{description:{name:za.description},name:{name:za.name},properties:{name:za.properties,defaultValue:[]},title:{name:za.title}},superTypes:[xn.$type]},StyleDeclaration:{name:gu.$type,properties:{name:{name:gu.name},properties:{name:gu.properties,defaultValue:[]},title:{name:gu.title}},superTypes:[Da.$type]},StyleProperty:{name:YT.$type,properties:{key:{name:YT.key},value:{name:YT.value}},superTypes:[]},SwimlaneContent:{name:mu.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:Wa.$type,properties:{content:{name:Wa.content,defaultValue:[]},name:{name:Wa.name},properties:{name:Wa.properties,defaultValue:[]},title:{name:Wa.title}},superTypes:[xn.$type]},SymbolDeclaration:{name:qa.$type,properties:{description:{name:qa.description},name:{name:qa.name},properties:{name:qa.properties,defaultValue:[]},title:{name:qa.title}},superTypes:[Da.$type]},TeamContent:{name:Vp.$type,properties:{},superTypes:[]},TeamDeclaration:{name:Va.$type,properties:{content:{name:Va.content,defaultValue:[]},name:{name:Va.name},properties:{name:Va.properties,defaultValue:[]},title:{name:Va.title}},superTypes:[xn.$type,Vp.$type]}})}},Pt=new yu;var OI,LI=()=>OI??(OI=Gp(`{\n \"$type\": \"Grammar\",\n \"isDeclared\": true,\n \"name\": \"Nowline\",\n \"rules\": [\n {\n \"$type\": \"ParserRule\",\n \"entry\": true,\n \"name\": \"NowlineFile\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"directive\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@1\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"includes\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@2\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"hasConfig\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"config\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"configEntries\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@4\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"roadmapDecl\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@13\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"roadmapEntries\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@14\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ]\n },\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"NowlineDirective\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"nowline\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"version\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@34\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"IncludeDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"include\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"path\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"options\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@3\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"IncludeOption\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"key\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@39\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ConfigEntry\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@5\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@6\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@8\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@9\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@11\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ScaleBlock\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"scale\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@34\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"CalendarBlock\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"calendar\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@34\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"BlockPropertyValue\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@47\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@43\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"StyleDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"style\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@35\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"SymbolDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"symbol\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"StylePropertyValue\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@45\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"person\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"DefaultDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"default\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"entityType\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@12\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"DefaultEntityType\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"item\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"label\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"swimlane\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"roadmap\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"milestone\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"footnote\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"anchor\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"parallel\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"group\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RoadmapDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"roadmap\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RoadmapEntry\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@15\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@16\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@20\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@22\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@30\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@31\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"PersonDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"person\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TeamDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"team\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"content\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@17\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TeamContent\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@18\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@16\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"PersonMemberRef\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"person\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"ref\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"AnchorDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"anchor\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"LabelDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"label\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"SizeDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"size\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"StatusDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"status\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"SwimlaneDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"swimlane\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"content\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@24\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"SwimlaneContent\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@25\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@26\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@28\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ItemDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"item\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ParallelBlock\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"parallel\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"content\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@27\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ParallelContent\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@25\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@28\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"GroupBlock\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"group\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"content\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@29\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"GroupContent\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@25\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@26\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@28\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MilestoneDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"milestone\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FootnoteDeclaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"footnote\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"properties\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"description\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"DescriptionDirective\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"description\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"text\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"EntityProperty\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"key\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@48\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"[\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"values\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"values\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"]\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"BlockProperty\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"key\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@48\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@7\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"StyleProperty\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"key\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@48\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@10\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"PropertyAtom\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@43\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@44\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@40\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@42\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@45\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@47\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"person\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"INDENT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\x01/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"DEDENT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\x02/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"INCLUDE_OPTION_KEY\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/(config|roadmap):/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"URL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/https?:\\\\\\\\/\\\\\\\\/[^\\\\\\\\s\\\\\\\\[\\\\\\\\],]+/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"STRING\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\"([^\\\\\"\\\\\\\\\\\\\\\\]|\\\\\\\\\\\\\\\\.)*\\\\\"/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"DATE_LITERAL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\d{4}-\\\\\\\\d{2}-\\\\\\\\d{2}/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"DURATION_LITERAL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\d+(\\\\\\\\.\\\\\\\\d+)?[dwmqy]/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"PERCENTAGE\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\d+(\\\\\\\\.\\\\\\\\d+)?%/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"COLOR_HEX\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/#[0-9a-fA-F]{3,8}/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"DECIMAL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\d+\\\\\\\\.\\\\\\\\d+/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"INTEGER\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\d+/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"PROPERTY_KEY_WITH_COLON\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[a-zA-Z_][a-zA-Z0-9_-]*:/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"ID\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[a-zA-Z_][a-zA-Z0-9_-]*/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"WS\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[\\\\\\\\t ]+/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"NL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[\\\\\\\\r\\\\\\\\n]+/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"SL_COMMENT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\/\\\\\\\\/[^\\\\\\\\r\\\\\\\\n]*/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"ML_COMMENT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\/\\\\\\\\*[\\\\\\\\s\\\\\\\\S]*?\\\\\\\\*\\\\\\\\//\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"LINE_CONTINUATION\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\\\\\\\\\\\\[ \\\\\\\\t]*\\\\\\\\r?\\\\\\\\n[ \\\\\\\\t]*/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n }\n ],\n \"imports\": [],\n \"interfaces\": [],\n \"types\": []\n}`));var ZU={languageId:\"nowline\",fileExtensions:[\".nowline\"],caseInsensitive:!1,mode:\"development\"},DI={AstReflection:()=>new yu},MI={Grammar:()=>LI(),LanguageMetaData:()=>ZU,parser:{}};var $I={\"NL.E0001\":()=>\"Config section must appear before roadmap.\",\"NL.E0002\":()=>\"Include declarations must appear before the config section.\",\"NL.E0003\":()=>\"Include declarations must appear before the roadmap section.\",\"NL.E0004\":()=>\"At least one swimlane is required.\",\"NL.E0005\":t=>`Line ${t.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,\"NL.E0100\":t=>`Invalid version format \"${t.version}\". Expected format: v1, v2, etc.`,\"NL.E0101\":t=>`This file requires Nowline ${t.version}, but the parser only supports up to ${t.supported}.`,\"NL.E0102\":t=>`Unknown directive property \"${t.key}\". Allowed: ${t.allowed}.`,\"NL.E0103\":t=>`Duplicate directive property \"${t.key}\".`,\"NL.E0104\":t=>`Invalid locale \"${t.value}\". Use a BCP-47 tag like \"en-US\", \"fr\", or \"fr-CA\".`,\"NL.E0200\":t=>`Invalid include mode \"${t.value}\". Must be merge, ignore, or isolate.`,\"NL.E0201\":t=>`Duplicate \"${t.key}\" option on include.`,\"NL.E0300\":t=>`Duplicate identifier \"${t.name}\". First declared at ${t.location}.`,\"NL.E0301\":t=>`${t.type} must have an identifier, a title, or both.`,\"NL.E0400\":t=>`Invalid duration \"${t.value}\". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use \"size:NAME\" to reference a declared size.`,\"NL.E0401\":t=>`Invalid size \"${t.value}\". Use the id of a declared size (e.g. xs, m, lg).`,\"NL.E0402\":t=>`Invalid effort \"${t.value}\". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,\"NL.E0403\":t=>`Invalid remaining value \"${t.value}\". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,\"NL.E0404\":t=>`Remaining must be between 0% and 100%, got ${t.value}.`,\"NL.E0405\":t=>`Invalid ${t.key} \"${t.value}\". Use ISO 8601 format: YYYY-MM-DD.`,\"NL.E0406\":t=>`Invalid scale \"${t.value}\". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,\"NL.E0407\":t=>`Invalid calendar \"${t.value}\". Must be business, full, or custom.`,\"NL.E0408\":t=>`Property \"${t.key}\" requires at least one reference.`,\"NL.E0410\":t=>`\"${t.key}:\" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,\"NL.E0411\":t=>`Inline date in \"${t.key}:\" is not allowed on ${t.type}. Allowed only on item, parallel, and group; for a milestone use \"date:\" instead.`,\"NL.E0412\":t=>`Inline date \"${t.date}\" in \"${t.key}:\" requires the roadmap to declare \"start:\". Add start:YYYY-MM-DD to the roadmap.`,\"NL.E0413\":t=>`Inline date \"${t.date}\" in \"${t.key}:\" is before roadmap start ${t.start}.`,\"NL.E0500\":t=>`Anchor \"${t.name}\" requires a \"date:\" property.`,\"NL.E0501\":t=>`Anchor \"${t.name}\" has a date but the roadmap is missing \"start:\". Add start:YYYY-MM-DD to the roadmap.`,\"NL.E0502\":t=>`Anchor \"${t.name}\" date ${t.date} is before roadmap start ${t.start}.`,\"NL.E0503\":t=>`Milestone \"${t.name}\" requires at least one of \"date:\" or \"after:\".`,\"NL.E0504\":t=>`Milestone \"${t.name}\" date ${t.date} is before roadmap start ${t.start}.`,\"NL.E0505\":()=>'Footnote requires an \"on:\" property referencing one or more entities.',\"NL.E0600\":t=>`Item \"${t.name}\" requires a \"size:\" or \"duration:\" property.`,\"NL.W0700\":t=>`Unknown property \"${t.key}\" on ${t.entity}. The renderer ignores it.${t.suggested?` Did you mean \"${t.suggested}\"?`:\"\"}`};var FI={\"NL.E0001\":()=>\"La section config doit pr\\xE9c\\xE9der la section roadmap.\",\"NL.E0002\":()=>\"Les d\\xE9clarations include doivent pr\\xE9c\\xE9der la section config.\",\"NL.E0003\":()=>\"Les d\\xE9clarations include doivent pr\\xE9c\\xE9der la section roadmap.\",\"NL.E0004\":()=>\"Au moins une swimlane est requise.\",\"NL.E0005\":t=>`Ligne ${t.line}\\xA0: tabulations et espaces m\\xE9lang\\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,\"NL.E0100\":t=>`Format de version invalide \\xAB\\xA0${t.version}\\xA0\\xBB. Format attendu\\xA0: v1, v2, etc.`,\"NL.E0101\":t=>`Ce fichier requiert Nowline ${t.version}, mais l'analyseur ne prend en charge que jusqu'\\xE0 ${t.supported}.`,\"NL.E0102\":t=>`Propri\\xE9t\\xE9 de directive inconnue \\xAB\\xA0${t.key}\\xA0\\xBB. Valeurs admises\\xA0: ${t.allowed}.`,\"NL.E0103\":t=>`Propri\\xE9t\\xE9 de directive \\xAB\\xA0${t.key}\\xA0\\xBB en double.`,\"NL.E0104\":t=>`Locale invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez une \\xE9tiquette BCP-47 telle que \\xAB\\xA0en-US\\xA0\\xBB, \\xAB\\xA0fr\\xA0\\xBB ou \\xAB\\xA0fr-CA\\xA0\\xBB.`,\"NL.E0200\":t=>`Mode d'include invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Doit \\xEAtre merge, ignore ou isolate.`,\"NL.E0201\":t=>`Option \\xAB\\xA0${t.key}\\xA0\\xBB en double sur include.`,\"NL.E0300\":t=>`Identifiant en double \\xAB\\xA0${t.name}\\xA0\\xBB. Premi\\xE8re d\\xE9claration \\xE0 ${t.location}.`,\"NL.E0301\":t=>`${t.type} doit comporter un identifiant, un titre, ou les deux.`,\"NL.E0400\":t=>`Dur\\xE9e invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez un litt\\xE9ral de dur\\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \\xAB\\xA0size:NOM\\xA0\\xBB pour r\\xE9f\\xE9rencer une taille d\\xE9clar\\xE9e.`,\"NL.E0401\":t=>`Taille invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez l'identifiant d'une taille d\\xE9clar\\xE9e (p.\\xA0ex. xs, m, lg).`,\"NL.E0402\":t=>`Effort invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez un litt\\xE9ral de dur\\xE9e brut comme 0.5d, 2w, 1m, 2q.`,\"NL.E0403\":t=>`Valeur restante invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez un pourcentage tel que 30% ou un litt\\xE9ral de dur\\xE9e comme 1w, 0.5d.`,\"NL.E0404\":t=>`La valeur restante doit \\xEAtre comprise entre 0 % et 100 %, re\\xE7u ${t.value}.`,\"NL.E0405\":t=>`${t.key} invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez le format ISO 8601\\xA0: AAAA-MM-JJ.`,\"NL.E0406\":t=>`\\xC9chelle invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Utilisez un litt\\xE9ral de dur\\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,\"NL.E0407\":t=>`Calendrier invalide \\xAB\\xA0${t.value}\\xA0\\xBB. Doit \\xEAtre business, full ou custom.`,\"NL.E0408\":t=>`La propri\\xE9t\\xE9 \\xAB\\xA0${t.key}\\xA0\\xBB exige au moins une r\\xE9f\\xE9rence.`,\"NL.E0410\":t=>`\\xAB\\xA0${t.key}:\\xA0\\xBB n'accepte qu'une seule date inline par direction\\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\\xE9clar\\xE9e.`,\"NL.E0411\":t=>`Une date inline dans \\xAB\\xA0${t.key}:\\xA0\\xBB n'est pas autoris\\xE9e sur ${t.type}. Autoris\\xE9e seulement sur item, parallel et group\\xA0; pour un milestone utilisez \\xAB\\xA0date:\\xA0\\xBB \\xE0 la place.`,\"NL.E0412\":t=>`La date inline \\xAB\\xA0${t.date}\\xA0\\xBB dans \\xAB\\xA0${t.key}:\\xA0\\xBB exige que la roadmap d\\xE9clare \\xAB\\xA0start:\\xA0\\xBB. Ajoutez start:AAAA-MM-JJ \\xE0 la roadmap.`,\"NL.E0413\":t=>`La date inline \\xAB\\xA0${t.date}\\xA0\\xBB dans \\xAB\\xA0${t.key}:\\xA0\\xBB pr\\xE9c\\xE8de le d\\xE9but de la roadmap (${t.start}).`,\"NL.E0500\":t=>`L'ancre \\xAB\\xA0${t.name}\\xA0\\xBB exige une propri\\xE9t\\xE9 \\xAB\\xA0date:\\xA0\\xBB.`,\"NL.E0501\":t=>`L'ancre \\xAB\\xA0${t.name}\\xA0\\xBB a une date, mais \\xAB\\xA0start:\\xA0\\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \\xE0 la roadmap.`,\"NL.E0502\":t=>`La date ${t.date} de l'ancre \\xAB\\xA0${t.name}\\xA0\\xBB pr\\xE9c\\xE8de le d\\xE9but de la roadmap (${t.start}).`,\"NL.E0503\":t=>`Le jalon \\xAB\\xA0${t.name}\\xA0\\xBB exige au moins l'une des propri\\xE9t\\xE9s \\xAB\\xA0date:\\xA0\\xBB ou \\xAB\\xA0after:\\xA0\\xBB.`,\"NL.E0504\":t=>`La date ${t.date} du jalon \\xAB\\xA0${t.name}\\xA0\\xBB pr\\xE9c\\xE8de le d\\xE9but de la roadmap (${t.start}).`,\"NL.E0505\":()=>\"Une note de bas de page exige une propri\\xE9t\\xE9 \\xAB\\xA0on:\\xA0\\xBB r\\xE9f\\xE9ren\\xE7ant au moins une entit\\xE9.\",\"NL.E0600\":t=>`L'\\xE9l\\xE9ment \\xAB\\xA0${t.name}\\xA0\\xBB exige une propri\\xE9t\\xE9 \\xAB\\xA0size:\\xA0\\xBB ou \\xAB\\xA0duration:\\xA0\\xBB.`,\"NL.W0700\":t=>`Propri\\xE9t\\xE9 inconnue \\xAB\\xA0${t.key}\\xA0\\xBB sur ${t.entity}. Le moteur de rendu l'ignore.${t.suggested?` Vouliez-vous dire \\xAB\\xA0${t.suggested}\\xA0\\xBB\\xA0?`:\"\"}`};var UI={};var BI={};var JU=new Map([[\"en-US\",$I],[\"fr\",FI],[\"fr-CA\",UI],[\"fr-FR\",BI]]);function XI(t,e,...r){for(let n of QU(t)){let o=JU.get(n)?.[e];if(o)return o(...r)}return e}var HI=\"en-US\";function QU(t){let e=[],r=e2(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf(\"-\");if(n<=0)break;r=r.slice(0,n)}return e.includes(HI)||e.push(HI),e}function e2(t){return t.split(\"-\").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join(\"-\")}var t2=/[\\\\/]/;function zI(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r===47||r===92)return e}return-1}function GI(...t){for(let e of t)if(e){if(e.includes(\"\\\\\")&&!e.includes(\"/\"))return\"\\\\\";if(e.includes(\"/\"))return\"/\"}return\"/\"}function r2(t){return t?t[0]===\"/\"||t[0]===\"\\\\\"?!0:t.length>=3&&/^[A-Za-z]:[\\\\/]/.test(t):!1}function WI(t){let e=zI(t);return e<0?\".\":e===0?t[0]:e===2&&/^[A-Za-z]:[\\\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function Zp(t){let e=zI(t);return e<0?t:t.slice(e+1)}function tw(t,e){if(r2(e))return jI(e,GI(e));let r=GI(t,e);return jI(`${t}${r}${e}`,r)}function jI(t,e){let r=\"\",n=t,i=/^([A-Za-z]:)([\\\\/])?/.exec(n);i?(r=i[1]+(i[2]?e:\"\"),n=n.slice(i[0].length)):(n[0]===\"/\"||n[0]===\"\\\\\")&&(r=e,n=n.replace(/^[\\\\/]+/,\"\"));let o=[];for(let s of n.split(t2))if(!(s===\"\"||s===\".\")){if(s===\"..\"){o.length>0&&o[o.length-1]!==\"..\"?o.pop():r||o.push(\"..\");continue}o.push(s)}return r+o.join(e)}var i2=/^\\d{4}-\\d{2}-\\d{2}$/;function YI(t){let e=t?.properties.find(r=>r.key===\"start\");if(e?.value&&i2.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function o2(t,e,r){return e&&r?`Included \"${t}\" declares start:${r}, which doesn't match this file's start:${e}. Both files must declare the same start date, or neither should.`:e?`Included \"${t}\" has no start:, but this file declares start:${e}. Both files must declare the same start date, or neither should.`:`Included \"${t}\" declares start:${r}, but this file has no start:. Both files must declare the same start date, or neither should.`}function KI(){return{styles:new Map,defaults:new Map,symbols:new Map}}function ZI(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function nw(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(VI(),qI));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=tw(\"\",e),{config:s,content:a}=await QI(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function QI(t,e,r){if(r.processed.has(e))return r.processed.get(e);if(r.resolving.includes(e)){r.diagnostics.push({severity:\"error\",message:`Circular include detected: ${[...r.resolving,e].join(\" \\u2192 \")}`,sourcePath:e});let a={config:KI(),content:ZI()};return r.processed.set(e,a),a}r.resolving.push(e);let n=KI(),i=ZI();l2(n,t),d2(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=tw(WI(e),c);if(o.has(l)){r.diagnostics.push({severity:\"error\",message:`Duplicate include \"${c}\" in ${Zp(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=JI(a,\"config\")??\"merge\",f=JI(a,\"roadmap\")??\"merge\",d;try{let w=await r.readFile(l);d=await s2(r.services,w,l)}catch(w){r.diagnostics.push({severity:\"error\",message:`Could not read include \"${c}\": ${w.message}`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}let{config:p,content:m}=await QI(d,l,r);if(a2(n,p,u,l,r.diagnostics),c2(i,m,p,f,l,c,r.diagnostics),f===\"isolate\"&&!m.roadmap&&r.diagnostics.push({severity:\"error\",message:`Cannot isolate \"${c}\": it has no roadmap declaration.`,sourcePath:e,line:a.$cstNode?.range.start.line}),f!==\"ignore\"&&d.roadmapDecl){let w=YI(t.roadmapDecl),T=YI(d.roadmapDecl);w!==T&&r.diagnostics.push({severity:\"error\",message:o2(c,w,T),sourcePath:e,line:a.$cstNode?.range.start.line})}}r.resolving.pop();let s={config:n,content:i};return r.processed.set(e,s),s}function JI(t,e){let r=t.options.find(n=>n.key===e);if(r&&(r.value===\"merge\"||r.value===\"ignore\"||r.value===\"isolate\"))return r.value}async function s2(t,e,r){let n=wt.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function a2(t,e,r,n,i){if(r===\"ignore\"||r===\"isolate\")return;let o=(s,a)=>i.push({severity:\"warning\",message:`${a} \"${s}\" from ${Zp(n)} is shadowed by the parent's definition.`,sourcePath:n});rw(t.styles,e.styles,s=>o(s,\"Style\")),rw(t.defaults,e.defaults,s=>o(s,\"Default\")),rw(t.symbols,e.symbols,s=>o(s,\"Symbol\")),e.scale&&!t.scale&&(t.scale=e.scale),e.calendar&&!t.calendar&&(t.calendar=e.calendar)}function c2(t,e,r,n,i,o,s){if(n===\"ignore\")return;if(n===\"isolate\"){e.roadmap&&t.isolatedRegions.push({sourcePath:o,config:r,content:e});return}let a=(c,l)=>s.push({severity:\"warning\",message:`${l} \"${c}\" from ${Zp(i)} is shadowed by the parent's definition.`,sourcePath:i});zn(t.persons,e.persons,c=>a(c,\"Person\")),zn(t.teams,e.teams,c=>a(c,\"Team\")),zn(t.anchors,e.anchors,c=>a(c,\"Anchor\")),zn(t.labels,e.labels,c=>a(c,\"Label\")),zn(t.sizes,e.sizes,c=>a(c,\"Size\")),zn(t.statuses,e.statuses,c=>a(c,\"Status\")),zn(t.swimlanes,e.swimlanes,c=>a(c,\"Swimlane\")),zn(t.milestones,e.milestones,c=>a(c,\"Milestone\")),zn(t.footnotes,e.footnotes,c=>a(c,\"Footnote\")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function rw(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function zn(t,e,r){for(let[n,i]of e){if(!i.name&&i.title){t.set(tS(t,eS(i.title)),i);continue}if(t.has(n)){r(n);continue}t.set(n,i)}}function l2(t,e){for(let r of e.configEntries)u2(t,r)}function u2(t,e){PI(e)?t.scale||(t.scale=e):Kp(e)?t.calendar||(t.calendar=e):_u(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):Eu(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):Bi(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function f2(t){let e={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let r of t){let n=r.name;n&&(Nr(r)?e.swimlanes.add(n):jn(r)?e.persons.add(n):Cr(r)?e.teams.add(n):xu(r)?e.anchors.add(n):wu(r)?e.labels.add(n):Wo(r)?e.sizes.add(n):Ya(r)?e.statuses.add(n):bu(r)?e.milestones.add(n):Tu(r)&&e.footnotes.add(n))}return e}function d2(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);let r=f2(e.roadmapEntries);for(let n of e.roadmapEntries)p2(t,n,r)}function eS(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,\"-\").replace(/^-+|-+$/g,\"\")||\"entity\"}function tS(t,e,r){let n=o=>t.has(o)||(r?.has(o)??!1);if(!n(e))return e;let i=2;for(;n(`${e}-${i}`);)i++;return`${e}-${i}`}function Wn(t,e,r){e.name?t.has(e.name)||t.set(e.name,e):e.title&&t.set(tS(t,eS(e.title),r),e)}function p2(t,e,r){Nr(e)?Wn(t.swimlanes,e,r.swimlanes):jn(e)?Wn(t.persons,e,r.persons):Cr(e)?Wn(t.teams,e,r.teams):xu(e)?Wn(t.anchors,e,r.anchors):wu(e)?Wn(t.labels,e,r.labels):Wo(e)?Wn(t.sizes,e,r.sizes):Ya(e)?Wn(t.statuses,e,r.statuses):bu(e)?Wn(t.milestones,e,r.milestones):Tu(e)&&Wn(t.footnotes,e,r.footnotes)}var rS=\"v1\",iw=new Set([\"planned\",\"in-progress\",\"active\",\"done\",\"completed\",\"at-risk\",\"blocked\"]),Jp=new Set([\"bg\",\"fg\",\"text\",\"border\",\"icon\",\"shadow\",\"font\",\"weight\",\"italic\",\"text-size\",\"padding\",\"spacing\",\"header-height\",\"corner-radius\",\"bracket\",\"header-position\",\"capacity-icon\",\"timeline-position\",\"minor-grid\"]),lw=new Set([\"none\",\"multiplier\",\"person\",\"people\",\"points\",\"time\"]),Qp=new Set([...lw,\"shield\",\"warning\",\"lock\",\"calendar\"]),dS=\"none\",eh={border:new Set([\"solid\",\"dashed\",\"dotted\"]),shadow:new Set([\"none\",\"subtle\",\"soft\",\"hard\"]),font:new Set([\"sans\",\"serif\",\"mono\"]),weight:new Set([\"thin\",\"light\",\"normal\",\"bold\"]),italic:new Set([\"true\",\"false\"]),\"text-size\":new Set([\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\"]),padding:new Set([\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\"]),spacing:new Set([\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\"]),\"header-height\":new Set([\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\"]),\"corner-radius\":new Set([\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\",\"full\"]),bracket:new Set([\"none\",\"solid\",\"dashed\"]),\"header-position\":new Set([\"beside\",\"above\"]),\"timeline-position\":new Set([\"top\",\"bottom\",\"both\"]),\"minor-grid\":new Set([\"true\",\"false\"])},h2=new Set([\"red\",\"blue\",\"yellow\",\"green\",\"orange\",\"purple\",\"violet\",\"gray\",\"grey\",\"navy\",\"white\",\"none\"]),m2=new Set([\"business\",\"full\",\"custom\"]),ow=new Set([\"days-per-week\",\"days-per-month\",\"days-per-quarter\",\"days-per-year\"]),nS=new Set([\"name\",\"label-every\",\"label\"]),iS=new Set([\"item\",\"label\",\"swimlane\",\"roadmap\",\"milestone\",\"footnote\",\"anchor\",\"parallel\",\"group\"]),g2={item:new Set([\"size\",\"duration\",\"after\",\"before\",\"remaining\",\"link\",\"description\",\"owner\"]),milestone:new Set([\"date\",\"after\",\"link\",\"description\"]),anchor:new Set([\"date\",\"link\",\"description\"]),footnote:new Set([\"on\",\"link\",\"description\"]),label:new Set([\"link\",\"description\"]),swimlane:new Set([\"capacity\"]),roadmap:new Set,parallel:new Set,group:new Set},oS=new Set([\"labels\",\"link\",\"style\",\"description\"]),y2={RoadmapDeclaration:new Set([\"author\",\"start\",\"length\",\"scale\",\"calendar\",\"logo\",\"logo-size\"]),AnchorDeclaration:new Set([\"date\"]),SwimlaneDeclaration:new Set([\"owner\",\"capacity\",\"utilization-warn-at\",\"utilization-over-at\",\"status\",\"after\",\"before\"]),ItemDeclaration:new Set([\"size\",\"duration\",\"status\",\"owner\",\"after\",\"before\",\"remaining\",\"capacity\",\"date\",\"start\"]),ParallelBlock:new Set([\"owner\",\"after\",\"before\",\"status\"]),GroupBlock:new Set([\"owner\",\"after\",\"before\",\"status\"]),MilestoneDeclaration:new Set([\"date\",\"after\"]),FootnoteDeclaration:new Set([\"on\"]),PersonDeclaration:new Set,TeamDeclaration:new Set,LabelDeclaration:new Set,SizeDeclaration:new Set([\"effort\"]),StatusDeclaration:new Set};function x2(t,e,r){if(t===e)return 0;let n=t.length,i=e.length;if(Math.abs(n-i)>r)return r+1;if(n===0)return i;if(i===0)return n;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=n;a++){s[0]=a;let c=a;for(let u=1;u<=i;u++){let f=t.charCodeAt(a-1)===e.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<c&&(c=s[u])}if(c>r)return r+1;let l=o;o=s,s=l}return o[i]}function T2(t,e,r=2){let n,i=r+1;for(let o of e){let s=x2(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}function He(t){return t.key.endsWith(\":\")?t.key.slice(0,-1):t.key}var vu=/^\\d+(?:\\.\\d+)?[dwmqy]$/,w2=/^\\d+%$/,Hi=/^\\d{4}-\\d{2}-\\d{2}$/,b2=/^#[0-9a-fA-F]{3,8}$/,_2=/^v\\d+$/,sS=/^\\d+$/,E2=/^[dwmqy]$/,aS=/^\\d+(\\.\\d+)?$/,uw=/^\\d+(\\.\\d+)?%$/,pS=/^\\d+\\.\\d+$/,v2=/^\\d+$/,R2=/^[\\x20-\\x7E]{1,3}$/,A2=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\\d{3})?$/,k2=new Set([\"merge\",\"ignore\",\"isolate\"]),cS=new Set([\"locale\"]);function sw(t){let e=t?.roadmapDecl?.properties.find(i=>He(i)===\"start\");if(!e)return{kind:\"missing\"};let r=e.value;if(!r||!Hi.test(r))return{kind:\"invalid\"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:\"invalid\"}:{kind:\"valid\",iso:r,date:n}}function Vr(t){return t.name??t.title??\"<unnamed>\"}function I2(t){return t.$type.replace(/Declaration$|Block$/,\"\").toLowerCase()}function Me(t,e,r,n,...i){t(e,XI(\"en-US\",n,...i),{...r,data:{code:n,args:i}})}function hS(t){let e=t.validation.ValidationRegistry,r=t.validation.NowlineValidator,n={NowlineFile:[r.checkFileStructure,r.checkUniqueIdentifiers,r.checkSwimlaneRequired,r.checkIndentationConsistency,r.checkRoadmapOnlyKeywordsPosition,r.checkForwardReferences,r.checkReferenceResolution,r.checkInlineDatePins,r.checkCircularDependencies,r.checkDuplicateSizeIds,r.checkCalendarBlockConsistency,r.checkPersonDeclarations,r.checkDuplicateSymbolIds,r.checkSymbolReferences],NowlineDirective:[r.checkDirectiveVersion,r.checkDirectiveProperties],IncludeOption:[r.checkIncludeMode],IncludeDeclaration:[r.checkIncludeDuplicateOptions],EntityProperty:[r.checkPropertyValues],RoadmapDeclaration:[r.checkEntityIdOrTitle,r.checkRoadmapProperties,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],AnchorDeclaration:[r.checkEntityIdOrTitle,r.checkAnchorRequiredDate,r.checkAnchorAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],SwimlaneDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUtilizationOrdering,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ItemDeclaration:[r.checkEntityIdOrTitle,r.checkItemRequiredDuration,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ParallelBlock:[r.checkParallelMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],GroupBlock:[r.checkGroupMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],MilestoneDeclaration:[r.checkEntityIdOrTitle,r.checkMilestoneRequirement,r.checkMilestoneAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],FootnoteDeclaration:[r.checkEntityIdOrTitle,r.checkFootnoteOn,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],PersonDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],TeamDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],StyleDeclaration:[r.checkEntityIdOrTitle],StyleProperty:[r.checkStylePropertyEnum],SymbolDeclaration:[r.checkEntityIdOrTitle,r.checkSymbolDeclaration],LabelDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],SizeDeclaration:[r.checkEntityIdOrTitle,r.checkSizeDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],StatusDeclaration:[r.checkEntityIdOrTitle,r.checkStatusDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],DefaultDeclaration:[r.checkDefaultDeclaration,r.checkUtilizationOrdering],CalendarBlock:[r.checkCalendarBlock],ScaleBlock:[r.checkScaleBlock]};e.register(n,r)}var rh=class{checkFileStructure(e,r){let n=e.hasConfig?_s.findNodeForKeyword(e.$cstNode,\"config\")?.offset:void 0,i=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&i!==void 0&&n>i&&Me(r,\"error\",{node:e,property:\"hasConfig\"},\"NL.E0001\");for(let o of e.includes){let s=o.$cstNode?.offset??0;n!==void 0&&s>n&&Me(r,\"error\",{node:o},\"NL.E0002\"),i!==void 0&&s>i&&Me(r,\"error\",{node:o},\"NL.E0003\")}}checkRoadmapOnlyKeywordsPosition(e,r){}checkDirectiveVersion(e,r){if(!_2.test(e.version)){Me(r,\"error\",{node:e,property:\"version\"},\"NL.E0100\",{version:e.version});return}let n=parseInt(e.version.slice(1),10),i=parseInt(rS.slice(1),10);n>i&&Me(r,\"error\",{node:e,property:\"version\"},\"NL.E0101\",{version:e.version,supported:rS})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=He(i);if(!cS.has(o)){Me(r,\"error\",{node:i,property:\"key\"},\"NL.E0102\",{key:o,allowed:[...cS].join(\", \")});continue}if(n.has(o)&&Me(r,\"error\",{node:i,property:\"key\"},\"NL.E0103\",{key:o}),n.add(o),o===\"locale\"){let s=i.value;A2.test(s)||Me(r,\"error\",{node:i,property:\"value\"},\"NL.E0104\",{value:s})}}}checkEntityIdOrTitle(e,r){!e.name&&!e.title&&Me(r,\"error\",{node:e},\"NL.E0301\",{type:e.$type})}checkUniqueIdentifiers(e,r){let n=new Map,i=(o,s)=>{if(!o)return;let a=n.get(o);a?Me(r,\"error\",{node:s},\"NL.E0300\",{name:o,location:th(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)C2(o,i);for(let o of e.configEntries)_u(o)&&o.name&&i(o.name,o)}checkIndentationConsistency(e,r){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let i=n.split(/\\r?\\n/);for(let o=0;o<i.length;o++){let s=i[o];if(s.length===0)continue;let a=s.match(/^([\\t ]+)/);if(!a)continue;let c=a[1];if(c.includes(\"\t\")&&c.includes(\" \")){Me(r,\"error\",{node:e},\"NL.E0005\",{line:o+1});return}}}checkSwimlaneRequired(e,r){let n=e.roadmapEntries.some(Nr);e.roadmapDecl&&!n&&Me(r,\"error\",{node:e.roadmapDecl},\"NL.E0004\")}checkIncludeMode(e,r){k2.has(e.value)||Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0200\",{value:e.value})}checkIncludeDuplicateOptions(e,r){let n=new Set;for(let i of e.options){let o=i.key.replace(/:$/,\"\");n.has(o)&&Me(r,\"error\",{node:i},\"NL.E0201\",{key:o}),n.add(o)}}checkPropertyValues(e,r){let n=He(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case\"status\":break;case\"duration\":i&&!vu.test(i)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0400\",{value:i});break;case\"size\":i&&!lS(i)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0401\",{value:i});break;case\"effort\":i&&!vu.test(i)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0402\",{value:i});break;case\"remaining\":{if(i)if(w2.test(i)){let a=parseFloat(i);(a<0||a>100)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0404\",{value:i})}else vu.test(i)||Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0403\",{value:i});break}case\"date\":case\"start\":i&&(!Hi.test(i)||Number.isNaN(new Date(i).getTime()))&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0405\",{key:n,value:i});break;case\"scale\":i&&!vu.test(i)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0406\",{value:i});break;case\"calendar\":i&&!m2.has(i)&&Me(r,\"error\",{node:e,property:\"value\"},\"NL.E0407\",{value:i});break;case\"on\":case\"after\":case\"before\":s.length===0&&Me(r,\"error\",{node:e},\"NL.E0408\",{key:n});break;case\"capacity\":{if(!i)break;let a=e.$container,c=S2(a);if(c===\"invalid\")break;c===\"lane\"?(!aS.test(i)||parseFloat(i)<=0)&&r(\"error\",`Invalid swimlane capacity \"${i}\". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:\"value\"}):uw.test(i)?parseFloat(i)<=0&&r(\"error\",`Item capacity \"${i}\" must be positive.`,{node:e,property:\"value\"}):aS.test(i)?parseFloat(i)<=0&&r(\"error\",`Item capacity \"${i}\" must be positive.`,{node:e,property:\"value\"}):r(\"error\",`Invalid item capacity \"${i}\". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:\"value\"});break}case\"overcapacity\":{r(\"error\",'\"overcapacity:\" was removed. Use \"utilization-over-at:none\" (and/or \"utilization-warn-at:none\") to suppress the lane utilization underline.',{node:e});break}case\"utilization-warn-at\":case\"utilization-over-at\":{if(!i)break;if(!N2(e.$container)){r(\"error\",`\"${n}:\" is only valid on \"swimlane\" or \"default swimlane\".`,{node:e});break}if(i===dS)break;if(uw.test(i)){parseFloat(i)<=0&&r(\"error\",`${n} value \"${i}\" must be positive.`,{node:e,property:\"value\"});break}if(pS.test(i)){parseFloat(i)<=0&&r(\"error\",`${n} value \"${i}\" must be positive.`,{node:e,property:\"value\"});break}if(v2.test(i)){r(\"error\",`Ambiguous ${n} value \"${i}\". Use the percent form (\"${i}%\") or the decimal-fraction form (\"0.${i}\") to make the intent explicit.`,{node:e,property:\"value\"});break}r(\"error\",`Invalid ${n} value \"${i}\". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or \"none\" to opt out.`,{node:e,property:\"value\"});break}case\"capacity-icon\":break;case\"icon\":break;default:if(Jp.has(n)){if(n===\"bg\"||n===\"fg\"||n===\"text\")i&&!aw(i)&&r(\"error\",`Invalid color \"${i}\" for \"${n}\". Use a named color, hex value, or \"none\".`,{node:e,property:\"value\"});else if(n in eh){let a=eh[n];i&&!a.has(i)&&!aw(i)&&r(\"error\",`Invalid value \"${i}\" for \"${n}\". Allowed: ${[...a].join(\", \")}.`,{node:e,property:\"value\"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>He(i)===\"date\")||Me(r,\"error\",{node:e},\"NL.E0500\",{name:Vr(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>He(a)===\"date\");if(!n?.value)return;let i=n.value;if(!Hi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=sw(e.$container);switch(s.kind){case\"invalid\":return;case\"missing\":Me(r,\"error\",{node:n,property:\"value\"},\"NL.E0501\",{name:Vr(e)});return;case\"valid\":o<s.date&&Me(r,\"error\",{node:n,property:\"value\"},\"NL.E0502\",{name:Vr(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>He(o)===\"date\"),i=e.properties.some(o=>He(o)===\"after\");!n&&!i&&Me(r,\"error\",{node:e},\"NL.E0503\",{name:Vr(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>He(a)===\"date\");if(!n?.value)return;let i=n.value;if(!Hi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=sw(e.$container);switch(s.kind){case\"invalid\":return;case\"missing\":r(\"error\",`Milestone \"${Vr(e)}\" has a date but the roadmap is missing \"start:\". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:\"value\"});return;case\"valid\":o<s.date&&Me(r,\"error\",{node:n,property:\"value\"},\"NL.E0504\",{name:Vr(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>He(i)===\"on\")||Me(r,\"error\",{node:e},\"NL.E0505\")}checkNoFootnoteProperty(e,r){for(let n of e.properties)He(n)===\"footnote\"&&r(\"error\",`Property \"footnote:\" is not valid on ${cw(e)}. Footnotes attach via \"on:\" on the footnote declaration \\u2014 declare \\`footnote <id> on:<target-id>\\` instead.`,{node:n})}checkItemRequiredDuration(e,r){let n=e.properties.some(o=>He(o)===\"duration\"),i=e.properties.some(o=>He(o)===\"size\");!n&&!i&&Me(r,\"error\",{node:e},\"NL.E0600\",{name:Vr(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=He(n);(i===\"size\"||i===\"duration\"||i===\"remaining\"||i===\"capacity\")&&r(\"error\",`\"${i}\" is not valid on ${e.$type===\"ParallelBlock\"?\"parallel\":\"group\"} (computed from children).`,{node:n})}}checkParallelMinChildren(e,r){let n=e.content.filter(i=>!ew(i));n.length===0?r(\"error\",\"Parallel block must contain at least 2 children.\",{node:e}):n.length===1&&r(\"warning\",\"Parallel block has only 1 child. Use at least 2 for parallel execution.\",{node:e})}checkGroupMinChildren(e,r){e.content.filter(i=>!ew(i)).length===0&&r(\"error\",\"Group must contain at least 1 child.\",{node:e})}checkNoRawStyleProperties(e,r){for(let n of e.properties){let i=He(n);Jp.has(i)&&r(\"error\",`Raw style property \"${i}\" is not allowed on ${cw(e)}. Declare a named style in config and reference it via \"style:id\".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=y2[e.$type];if(!n)return;let i=e.$type===\"ParallelBlock\"||e.$type===\"GroupBlock\"?new Set([\"size\",\"duration\",\"remaining\",\"capacity\"]):null;for(let o of e.properties){let s=He(o);if(n.has(s)||oS.has(s)||Jp.has(s)||s===\"footnote\"||i?.has(s))continue;let a=[...n,...oS],c=T2(s,a)??\"\";Me(r,\"warning\",{node:o,property:\"key\"},\"NL.W0700\",{key:s,entity:cw(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=He(e),i=e.value;if(n===\"bg\"||n===\"fg\"||n===\"text\")aw(i)||r(\"error\",`Invalid color \"${i}\" for \"${n}\". Use a named color, hex value, or \"none\".`,{node:e,property:\"value\"});else if(n in eh){let o=eh[n];o.has(i)||r(\"error\",`Invalid value \"${i}\" for \"${n}\". Allowed: ${[...o].join(\", \")}.`,{node:e,property:\"value\"})}else Jp.has(n)||r(\"error\",`Unknown style property \"${n}\".`,{node:e,property:\"key\"})}checkSizeDeclaration(e,r){e.properties.find(i=>He(i)===\"effort\")||r(\"error\",`Size \"${Vr(e)}\" requires an \"effort:\" property.`,{node:e}),e.name&&(vu.test(e.name)||E2.test(e.name))&&r(\"error\",`Size id \"${e.name}\" collides with the raw duration pattern. Choose a different name (e.g. \"xs\", \"small\", \"quarter\").`,{node:e,property:\"name\"})}checkStatusDeclaration(e,r){e.name&&iw.has(e.name)&&r(\"error\",`Status id \"${e.name}\" collides with the built-in status value. Built-ins: ${[...iw].join(\", \")}.`,{node:e,property:\"name\"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(Wo(i)&&i.name){let o=n.get(i.name);o?r(\"error\",`Duplicate size id \"${i.name}\". First declared at ${th(o)}.`,{node:i,property:\"name\"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if(Bi(e)&&e.entityType!==\"swimlane\")return;let n=e.properties.find(a=>He(a)===\"utilization-warn-at\"),i=e.properties.find(a=>He(a)===\"utilization-over-at\");if(!n||!i)return;let o=uS(n.value),s=uS(i.value);o===null||s===null||o>s&&r(\"error\",`utilization-warn-at (${n.value}) must be \\u2264 utilization-over-at (${i.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:\"value\"})}checkDefaultDeclaration(e,r){if(!iS.has(e.entityType)){r(\"error\",`\"${e.entityType}\" is not a supported entity type for default. Allowed: ${[...iS].join(\", \")}.`,{node:e,property:\"entityType\"});return}let n=e.$container,i=-1;for(let s=0;s<n.configEntries.length;s++){let a=n.configEntries[s];if(Bi(a)&&a.entityType===e.entityType){if(i<0)i=s;else if(a===e){r(\"error\",`Duplicate \"default ${e.entityType}\" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let o=g2[e.entityType];if(o)for(let s of e.properties){let a=He(s);o.has(a)&&r(\"error\",`\"${a}\" cannot be set on \"default ${e.entityType}\". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`,{node:s})}}checkCalendarBlockConsistency(e,r){let n=e.configEntries.filter(Kp),o=e.roadmapDecl?.properties.find(s=>He(s)===\"calendar\")?.value;if(n.length>0&&o!==\"custom\")for(let s of n)r(\"error\",'A \"calendar\" config block is only valid when the roadmap declares calendar:custom.',{node:s});if(o===\"custom\"&&n.length===0&&r(\"error\",'calendar:custom requires a \"calendar\" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:\"properties\"}),o===\"custom\"&&n.length>0)for(let s of n){let a=new Set(s.properties.map(c=>He(c)));for(let c of ow)a.has(c)||r(\"error\",`calendar:custom requires \"${c}\" in the calendar config block.`,{node:s})}}checkCalendarBlock(e,r){let n=new Set;for(let i of e.properties){let o=He(i);if(!ow.has(o)){r(\"error\",`Unknown calendar property \"${o}\". Allowed: ${[...ow].join(\", \")}.`,{node:i,property:\"key\"});continue}n.has(o)&&r(\"error\",`Duplicate calendar property \"${o}\".`,{node:i,property:\"key\"}),n.add(o),(!sS.test(i.value)||parseInt(i.value,10)<=0)&&r(\"error\",`\"${o}\" must be a positive integer, got \"${i.value}\".`,{node:i,property:\"value\"})}}checkScaleBlock(e,r){let n=new Set;for(let i of e.properties){let o=He(i);if(!nS.has(o)){r(\"error\",`Unknown scale property \"${o}\". Allowed: ${[...nS].join(\", \")}.`,{node:i,property:\"key\"});continue}n.has(o)&&r(\"error\",`Duplicate scale property \"${o}\".`,{node:i,property:\"key\"}),n.add(o),o===\"label-every\"&&(!sS.test(i.value)||parseInt(i.value,10)<=0)&&r(\"error\",`\"label-every\" must be a positive integer, got \"${i.value}\".`,{node:i,property:\"value\"})}}checkForwardReferences(e,r){let n=new Map,i=new Map;for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];Wo(s)&&s.name?n.has(s.name)||n.set(s.name,o):Ya(s)&&s.name&&(i.has(s.name)||i.set(s.name,o))}for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];fS(s,a=>{let c=He(a);if(c===\"size\"&&a.value){let l=a.value,u=n.get(l);u===void 0?r(\"error\",`Size \"${l}\" is not declared. Add \"size ${l} effort:<literal>\" earlier in the roadmap section.`,{node:a,property:\"value\"}):u>=o&&r(\"error\",`Size \"${l}\" is referenced before its declaration. Move \"size ${l}\" above this entity.`,{node:a,property:\"value\"})}else if(c===\"status\"&&a.value){let l=a.value;if(iw.has(l))return;let u=i.get(l);u===void 0?r(\"error\",`Status \"${l}\" is not a built-in and has no declaration. Add \"status ${l}\" earlier in the roadmap section.`,{node:a,property:\"value\"}):u>=o&&r(\"error\",`Status \"${l}\" is referenced before its declaration. Move \"status ${l}\" above this entity.`,{node:a,property:\"value\"})}})}}checkReferenceResolution(e,r){let n=P2(e),i=o=>{fS(o,s=>{let a=He(s);if(a!==\"after\"&&a!==\"before\"&&a!==\"on\")return;let c=s.value?[s.value]:s.values;for(let l of c)l&&((a===\"after\"||a===\"before\")&&Hi.test(l)||n.has(l)||r(\"error\",`${a}: reference \"${l}\" does not resolve to any declared entity in this file.`,{node:s}))})};for(let o of e.roadmapEntries)i(o)}checkInlineDatePins(e,r){let n=sw(e),i=o=>{let s=o.properties??[],a=_r(o)||qr(o)||Wr(o);for(let c of s){let l=He(c);if(l!==\"after\"&&l!==\"before\")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Hi.test(d));if(f.length!==0){if(!a){Me(r,\"error\",{node:c},\"NL.E0411\",{key:l,type:I2(o)});continue}f.length>1&&Me(r,\"error\",{node:c},\"NL.E0410\",{key:l});for(let d of f)switch(n.kind){case\"invalid\":continue;case\"missing\":Me(r,\"error\",{node:c},\"NL.E0412\",{key:l,date:d});continue;case\"valid\":{let p=new Date(d);if(Number.isNaN(p.getTime()))continue;p<n.date&&Me(r,\"error\",{node:c},\"NL.E0413\",{key:l,date:d,start:n.iso})}}}}if(Nr(o))for(let c of o.content)i(c);else if(qr(o)||Wr(o))for(let c of o.content)i(c)};for(let o of e.roadmapEntries)i(o)}checkCircularDependencies(e,r){let n=new Map,i=(p,m)=>{n.has(p)||n.set(p,new Set),n.get(p).add(m)},o=(p,m,w)=>{if(p)for(let T of m){let _=He(T);if(_===\"after\"){let E=T.value?[T.value]:T.values;for(let b of E)b&&(Hi.test(b)||i(p,b))}else if(_===\"before\"){let E=T.value?[T.value]:T.values;for(let b of E)b&&(Hi.test(b)||i(b,p))}}},s=p=>{let m=p.name,w=p.properties??[];if(o(m,w,e),Nr(p))for(let T of p.content)s(T);else if(qr(p)||Wr(p))for(let T of p.content)s(T)};for(let p of e.roadmapEntries)s(p);let a=0,c=1,l=2,u=new Map;for(let p of n.keys())u.set(p,a);let f=new Set,d=(p,m)=>{u.set(p,c),m.push(p);for(let w of n.get(p)??[]){let T=u.get(w)??a;if(T===c){let _=m.indexOf(w),E=m.slice(_).concat(w),b=[...E].sort().join(\"\\u2192\");f.has(b)||(f.add(b),r(\"error\",`Circular dependency detected: ${E.join(\" \\u2192 \")}.`,{node:e.roadmapDecl??e}))}else T===a&&d(w,m)}m.pop(),u.set(p,l)};for(let p of n.keys())(u.get(p)??a)===a&&d(p,[])}checkPersonDeclarations(e,r){let n=new Map,i=a=>!!a.title||a.properties.length>0||a.description!==void 0,o=a=>{if(!a.name)return;let c=i(a);n.has(a.name)||n.set(a.name,[]),n.get(a.name).push({node:a,isDeclaration:c}),!c&&a.$container.$type===\"NowlineFile\"&&r(\"warning\",`Bare \"person ${a.name}\" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:a})},s=a=>{for(let c of a.content)jn(c)?o(c):Cr(c)&&s(c)};for(let a of e.roadmapEntries)jn(a)?o(a):Cr(a)&&s(a);for(let[a,c]of n){let l=c.filter(u=>u.isDeclaration);if(l.length>1)for(let u=1;u<l.length;u++)r(\"error\",`Person \"${a}\" is declared more than once. First declaration at ${th(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&Qp.has(e.name)&&r(\"error\",`Symbol id \"${e.name}\" collides with a built-in icon name. Reserved built-ins: ${[...Qp].sort().join(\", \")}.`,{node:e,property:\"name\"});let n=e.properties.find(o=>He(o)===\"unicode\");n?(!n.value||n.value.length===0)&&r(\"error\",`Symbol \"${Vr(e)}\" unicode: must be a non-empty value.`,{node:n,property:\"value\"}):r(\"error\",`Symbol \"${Vr(e)}\" requires a \"unicode:\" property (e.g. unicode:\"\\u{1F4B0}\" or unicode:\"\\\\u{1F464}\").`,{node:e});let i=e.properties.find(o=>He(o)===\"ascii\");if(i){let o=i.value??\"\";R2.test(o)||r(\"error\",`Symbol \"${Vr(e)}\" ascii: must be 1-3 ASCII characters (got ${o.length} character${o.length===1?\"\":\"s\"}).`,{node:i,property:\"value\"})}for(let o of e.properties){let s=He(o);s!==\"unicode\"&&s!==\"ascii\"&&s!==\"link\"&&s!==\"description\"&&r(\"error\",`Unknown symbol property \"${s}\". Allowed: unicode, ascii, link, description.`,{node:o,property:\"key\"})}}checkDuplicateSymbolIds(e,r){let n=new Map;for(let i of e.configEntries)if(Eu(i)&&i.name){let o=n.get(i.name);o?r(\"error\",`Duplicate symbol id \"${i.name}\". First declared at ${th(o)}.`,{node:i,property:\"name\"}):n.set(i.name,i)}}checkSymbolReferences(e,r){let n=new Map;for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];Eu(s)&&s.name&&(n.has(s.name)||n.set(s.name,o))}let i=(o,s,a,c)=>{if(s!==\"icon\"&&s!==\"capacity-icon\"||!a||!lS(a)||s===\"capacity-icon\"&&lw.has(a)||s===\"icon\"&&Qp.has(a))return;let l=n.get(a);if(l===void 0){let u=s===\"capacity-icon\"?[...lw].sort().join(\", \"):[...Qp].sort().join(\", \");r(\"error\",`${s}: \"${a}\" is neither a built-in (${u}) nor a declared symbol. Add \"symbol ${a} unicode:...\" earlier in config or use a quoted Unicode literal.`,{node:c,property:\"value\"})}else l>=o&&r(\"error\",`${s}: symbol \"${a}\" is referenced before its declaration. Move \"symbol ${a}\" above this entry.`,{node:c,property:\"value\"})};for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];if(_u(s))for(let a of s.properties)i(o,He(a),a.value,a);else if(Bi(s))for(let a of s.properties)i(o,He(a),a.value,a)}}};function aw(t){return h2.has(t)||b2.test(t)}function lS(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function S2(t){return t?Nr(t)?\"lane\":_r(t)?\"item\":Bi(t)?t.entityType===\"swimlane\"?\"lane\":\"item\":\"invalid\":\"invalid\"}function N2(t){return t?!!(Nr(t)||Bi(t)&&t.entityType===\"swimlane\"):!1}function uS(t){if(!t||t===dS)return null;if(uw.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(pS.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function th(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:\"unknown location\"}function cw(t){let e=t.$type.replace(/Declaration$|Block$/,\"\").toLowerCase(),r=t.name??t.title;return r?`${e} \"${r}\"`:e}function C2(t,e){if(Nr(t)){e(t.name,t);for(let r of t.content)fw(r,e)}else jn(t)?e(t.name,t):Cr(t)?mS(t,e):(xu(t)||bu(t)||Tu(t)||wu(t)||Wo(t)||Ya(t))&&e(t.name,t)}function mS(t,e){e(t.name,t);for(let r of t.content)Cr(r)&&mS(r,e)}function fw(t,e){if(_r(t))e(t.name,t);else if(qr(t)){e(t.name,t);for(let r of t.content)fw(r,e)}else if(Wr(t)){e(t.name,t);for(let r of t.content)fw(r,e)}}function fS(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(Nr(n))for(let o of n.content)r(o);else if(qr(n)||Wr(n))for(let o of n.content)r(o);else if(Cr(n))for(let o of n.content)(Cr(o)||jn(o))&&r(o)};r(t)}function P2(t){let e=new Set;t.roadmapDecl?.name&&e.add(t.roadmapDecl.name);let r=n=>{let i=n.name;if(i&&e.add(i),Nr(n))for(let o of n.content)r(o);else if(qr(n)||Wr(n))for(let o of n.content)r(o);else if(Cr(n))for(let o of n.content)Cr(o)||jn(o)?r(o):CI(o)};for(let n of t.roadmapEntries)r(n);return e}var dw=class extends Lo{runConverter(e,r,n){return e.name===\"PROPERTY_KEY_WITH_COLON\"||e.name===\"INCLUDE_OPTION_KEY\"?r.endsWith(\":\")?r.slice(0,-1):r:super.runConverter(e,r,n)}},pw=class extends La{isStartOfLine(e,r){if(!super.isStartOfLine(e,r))return!1;let n=r-1;for(;n>=0&&(e[n]===\" \"||e[n]===\"\t\");)n--;for(;n>=0&&(e[n]===\"\\r\"||e[n]===`\n`);)n--;for(;n>=0&&(e[n]===\" \"||e[n]===\"\t\");)n--;return n<0||e[n]!==\"\\\\\"}},gS={parser:{TokenBuilder:()=>new pw({indentTokenName:\"INDENT\",dedentTokenName:\"DEDENT\",whitespaceTokenName:\"WS\",ignoreIndentationDelimiters:[[\"[\",\"]\"]]}),Lexer:t=>new du(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new dw},validation:{NowlineValidator:()=>new rh}};function hw(t={}){let e=t.shared??Go(uu(pu),DI),r=Go(lu({shared:e}),MI,gS);return e.ServiceRegistry.register(r),hS(r),{shared:e,Nowline:r}}function yS(t){return t.endsWith(\":\")?t.slice(0,-1):t}function fe(t,e){return t.find(r=>yS(r.key)===e)?.value}function _t(t,e){let r=t.find(n=>yS(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function kt(t){if(!t)return null;let e=/^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(t);if(!e)return null;let r=new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)));return Number.isNaN(r.getTime())?null:r}var Ka={mode:\"business\",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},O2={mode:\"full\",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function xS(t,e){let n=t.roadmapDecl?.properties.find(i=>mw(i.key)===\"calendar\")?.value??\"business\";if(n===\"business\")return{...Ka};if(n===\"full\")return{...O2};if(e){let i=(o,s)=>{let a=e.properties.find(l=>mw(l.key)===o),c=a?parseInt(a.value,10):NaN;return Number.isFinite(c)&&c>0?c:s};return{mode:\"custom\",daysPerWeek:i(\"days-per-week\",Ka.daysPerWeek),daysPerMonth:i(\"days-per-month\",Ka.daysPerMonth),daysPerQuarter:i(\"days-per-quarter\",Ka.daysPerQuarter),daysPerYear:i(\"days-per-year\",Ka.daysPerYear)}}return{...Ka}}var nh=/^(\\d+(?:\\.\\d+)?)([dwmqy])$/;function ih(t,e){let r=nh.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case\"d\":return n;case\"w\":return n*e.daysPerWeek;case\"m\":return n*e.daysPerMonth;case\"q\":return n*e.daysPerQuarter;case\"y\":return n*e.daysPerYear;default:return 0}}function TS(t,e,r){return t?nh.test(t)?ih(t,r):e.get(t)?.effortDays??0:0}function Xi(t,e,r){let n=fe(t,\"duration\");if(n&&nh.test(n))return ih(n,r);let i=fe(t,\"size\"),o=i?e.get(i):void 0;if(!o)return 0;let s=ri(fe(t,\"capacity\"))??1;return o.effortDays/s}function wS(t,e,r){let n=fe(t,\"size\"),i=n?e.get(n):void 0;if(i)return i.effortDays;let o=fe(t,\"duration\");if(o&&nh.test(o)){let s=ri(fe(t,\"capacity\"))??1;return ih(o,r)*s}return 0}function oh(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>mw(c.key)===\"effort\")?.value;if(!s)continue;let a=ih(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function mw(t){return t.endsWith(\":\")?t.slice(0,-1):t}function Pr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function qo(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var sh=class{constructor(e){xe(this,\"items\");xe(this,\"brackets\");this.items=e.itemBars,this.brackets=e.brackets}hasObstacle(e,r,n){let i=Math.min(r,n),o=Math.max(r,n);for(let s of this.items)if(!(e<=s.x||e>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(e,r,n,i){let o=Math.min(r,n),s=Math.max(r,n),a=[];for(let c of this.brackets)Math.abs(c.x-e)>i||c.yBottom<=o||c.yTop>=s||a.push(c);return a}};function bS(t,e){let r=[],n=[],i=s=>{if(s.kind===\"item\"){r.push(s.box);return}if(s.kind===\"parallel\"){if(s.style.bracket===\"solid\"||s.style.bracket===\"dashed\"){let l=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;n.push({x:f,yTop:l,yBottom:u}),n.push({x:d,yTop:l,yBottom:u}),n.push({x:f+4,yTop:l-1,yBottom:l+1}),n.push({x:f+4,yTop:u-1,yBottom:u+1}),n.push({x:d-4,yTop:l-1,yBottom:l+1}),n.push({x:d-4,yTop:u-1,yBottom:u+1})}for(let a of s.children)i(a);return}if(s.kind===\"group\"){!(s.style.bg!==\"none\"&&s.style.bg!==\"#ffffff\")&&s.style.bracket&&s.style.bracket!==\"none\"&&n.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let c of s.children)i(c);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of t)o(s);for(let s of e)for(let a of s.nestedSwimlanes)o(a);return{itemBars:r,brackets:n}}function L2(t,e){let{from:r,to:n}=t;if(Math.abs(r.y-n.y)<.5)return{x:(r.x+n.x)/2,underBar:!1,range:null};let i=Math.min(r.y,n.y),o=Math.max(r.y,n.y);if(r.x<=n.x){let a=r.x+6,c=n.x-6;if(a>c)return{x:n.x-6,underBar:!0,range:null};let l={minX:a,maxX:c},u=(r.x+n.x)/2,f=Math.max(a,Math.min(c,u));if(!e.hasObstacle(f,i,o))return{x:f,underBar:!1,range:l};let d=c-a;for(let p=1;p<=d;p++){let m=f-p;if(m>=a&&!e.hasObstacle(m,i,o))return{x:m,underBar:!1,range:l};let w=f+p;if(w<=c&&!e.hasObstacle(w,i,o))return{x:w,underBar:!1,range:l}}return{x:f,underBar:!0,range:l}}let s=[r.x+10,n.x-10];for(let a of s)if(a>0&&!e.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:r.x+10,underBar:!0,range:null}}function D2(t,e,r,n){let i=Math.min(r.from.y,r.to.y),o=Math.max(r.from.y,r.to.y),s=n.bracketsNear(t,i,o,4);if(s.length===0)return{x:t,forceUnderBar:!1};let a=s[0],c=Math.abs(s[0].x-t);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-t);p<c&&(a=s[d],c=p)}let l=[a.x+4,a.x-4],u=4-.01;for(let d of l){if(e&&(d<e.minX||d>e.maxX))continue;let p=e?d:Math.max(Math.min(r.from.x,r.to.x)+1,Math.min(Math.max(r.from.x,r.to.x)-1,d));if(n.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:e?Math.min(Math.max(t,e.minX),e.maxX):t,forceUnderBar:!0}}function M2(t){let e=[...t].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),r=new Map,n=0;for(;n<e.length;){let i=n+1;for(;i<e.length&&Math.abs(e[i].channelX-e[n].channelX)<1;)i++;let s=[...e.slice(n,i)].sort((c,l)=>{let u=Math.min(c.req.from.y,c.req.to.y),f=Math.min(l.req.from.y,l.req.to.y);return Math.abs(u-f)>.5?u-f:c.orderIndex-l.orderIndex}),a=[];for(let c of s){let l=Math.min(c.req.from.y,c.req.to.y),u=Math.max(c.req.from.y,c.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=l){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),r.set(c.orderIndex,f)}n=i}return r}function $2(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function F2(t){let e=t.from.x>=t.to.x?{x:t.to.x-1,y:t.from.y}:t.from;return{fromId:t.fromId,toId:t.toId,waypoints:[e,t.to],underBar:!1}}function _S(t,e){let r=new Array(t.length),n=[];for(let o=0;o<t.length;o++){let s=t[o];if(s.isMarkerSource){r[o]=F2(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){r[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:c,range:l}=L2(s,e),{x:u,forceUnderBar:f}=D2(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=M2(n);for(let o of n){let s=$2(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:U2(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function U2(t,e,r){return Math.abs(t.y-e.y)<.5?[t,e]:[t,{x:r,y:t.y},{x:r,y:e.y},e]}var Ru=\"en-US\",B2={\"en-US\":{nowLabel:\"now\",quarterPrefix:\"Q\"},fr:{nowLabel:\"maint.\",quarterPrefix:\"T\"}};function ES(t,e){return e??t??Ru}function ah(t){let e={};for(let r of H2(t)){let n=B2[r];if(n)for(let i of Object.keys(n))e[i]===void 0&&n[i]!==void 0&&(e[i]=n[i])}return e}function H2(t){let e=[],r=X2(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf(\"-\");if(n<=0)break;r=r.slice(0,n)}return e.includes(Ru)||e.push(Ru),e}function X2(t){return t.split(\"-\").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join(\"-\")}function kS(t){let{box:e,afterDate:r,beforeDate:n,hasLinkIcon:i,footnoteCount:o}=t;if(!r&&!n)return[];let s=[],a=12,c=e.y+5,l=e.width<40;if(r){let u=i?e.x+6+14+4:e.x+6,f=l?{x:e.x-6-a,y:c}:{x:u,y:c};s.push({side:\"after\",isoDate:r,glyphTopLeft:f,glyphSize:a,spilled:l})}if(n){let u=e.x+e.width,f;o>0?f=u-22-(o-1)*8-4:f=u-12-5-4;let d=f-a,p=l?{x:u+6,y:c}:{x:d,y:c};s.push({side:\"before\",isoDate:n,glyphTopLeft:p,glyphSize:a,spilled:l})}return s}function lh(t){let{box:e,afterDate:r,beforeDate:n}=t;if(!r&&!n)return[];let i=[],o=12,s=e.y+5;return r&&i.push({side:\"after\",isoDate:r,glyphTopLeft:{x:e.x+6,y:s},glyphSize:o,spilled:!1}),n&&i.push({side:\"before\",isoDate:n,glyphTopLeft:{x:e.x+e.width-6-o,y:s},glyphSize:o,spilled:!1}),i}function qn(t){for(let e of t)if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return e}function uh(t,e){return{x:t,y:e,height:0,maxX:t}}var Qa=class{constructor(e){xe(this,\"rows\");xe(this,\"opts\");this.opts=e,this.rows=[{y:e.originY,height:e.minRowHeight,rightEdge:e.laneLeftX,spillX:e.laneLeftX,placedChildren:[]}]}placeItem(e){for(let n=0;n<this.rows.length;n+=1){let i=this.rows[n];if(!(e.desiredStart<i.rightEdge)&&!(e.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,e))return{rowIndex:n,y:i.y}}let r=this.appendRow(Math.max(this.opts.minRowHeight,e.predictedHeight));return{rowIndex:this.rows.length-1,y:r.y}}placeBlock(){let e=this.rows[this.rows.length-1];if(e.rightEdge>this.opts.laneLeftX){let r=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:r.y}}return{rowIndex:this.rows.length-1,y:e.y}}commitItem(e){let r=this.rows[e.rowIndex],n=Math.max(e.placed.box.height,e.rowHeight??0);this.growRowHeight(e.rowIndex,n),r.rightEdge=e.logicalEnd,r.spillX=e.spillReservation??this.opts.laneLeftX,r.placedChildren.push(e.placed)}commitBlock(e){let r=this.rows[e.rowIndex];this.growRowHeight(e.rowIndex,e.blockHeight),r.rightEdge=e.blockEnd,r.spillX=this.opts.laneLeftX,r.placedChildren.push(e.placed)}usedHeight(){let e=this.rows[this.rows.length-1];return e.y+e.height-this.opts.originY}usedRightX(){let e=this.opts.laneLeftX;for(let r of this.rows)r.rightEdge>e&&(e=r.rightEdge),r.spillX>e&&(e=r.spillX);return e}rowIntersectsCorridor(e,r){return this.opts.slackCorridors.some(n=>n.y>=e.y&&n.y<e.y+e.height&&r.desiredStart<n.xEnd&&r.desiredEnd>n.xStart&&n.slackPredId!==r.childId)}appendRow(e){let r=this.rows[this.rows.length-1],n={y:r.y+r.height,height:e,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(n),n}growRowHeight(e,r){let n=this.rows[e],i=r-n.height;if(!(i<=0)){n.height=r;for(let o=e+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)IS(a,i)}}}};function IS(t,e){if(t.box.y+=e,t.kind===\"item\"){for(let r of t.labelChips)r.box.y+=e;t.overflowBox&&(t.overflowBox.y+=e);return}for(let r of t.children)IS(r,e)}var SS={red:\"#f87171\",blue:\"#60a5fa\",yellow:\"#facc15\",green:\"#34d399\",orange:\"#fb923c\",purple:\"#a78bfa\",gray:\"#94a3b8\",navy:\"#818cf8\",white:\"#e2e8f0\"},Vn={bg:\"none\",fg:\"#e2e8f0\",text:\"#e2e8f0\",border:\"solid\",icon:\"none\",shadow:\"none\",font:\"sans\",weight:\"normal\",italic:!1,textSize:\"md\",padding:\"sm\",spacing:\"sm\",headerHeight:\"sm\",cornerRadius:\"sm\",bracket:\"none\",capacityIcon:\"multiplier\"},NS={name:\"dark\",surface:{page:\"#0b1220\",chart:\"#111827\",headerBox:\"#1e293b\"},entities:{roadmap:{...Vn,headerHeight:\"md\",padding:\"md\"},swimlane:{...Vn,fg:\"#e2e8f0\",text:\"#e2e8f0\",padding:\"sm\",spacing:\"none\",textSize:\"sm\"},item:{...Vn,bg:\"#0f172a\",fg:\"#94a3b8\",text:\"#e2e8f0\",shadow:\"subtle\",cornerRadius:\"sm\"},parallel:{...Vn,bracket:\"none\",padding:\"xs\"},group:{...Vn,bracket:\"solid\",padding:\"xs\",fg:\"#94a3b8\"},anchor:{...Vn,bg:\"#0b1220\",fg:\"#cbd5e1\",text:\"#cbd5e1\",cornerRadius:\"sm\"},milestone:{...Vn,bg:\"#e2e8f0\",fg:\"#e2e8f0\",text:\"#0b1220\",border:\"solid\"},footnote:{...Vn,bg:\"none\",fg:\"#94a3b8\",text:\"#e2e8f0\",textSize:\"sm\"},label:{...Vn,bg:\"#1e293b\",fg:\"#94a3b8\",text:\"#e2e8f0\",textSize:\"xs\",padding:\"xs\",cornerRadius:\"full\"}},swimlane:{bandEven:\"#111827\",bandOdd:\"#0f172a\",separator:\"#1f2937\",frameTabText:\"#e2e8f0\",frameTabMuted:\"#94a3b8\",border:\"#334155\",tabFill:\"#1e293b\",tabStroke:\"#475569\",tabText:\"#e2e8f0\",ownerText:\"#94a3b8\",footnoteIndicator:\"#f87171\",rowTintEven:\"#0f172a\",rowTintOdd:\"#1e293b\",utilizationOk:\"#34d399\",utilizationWarn:\"#fbbf24\",utilizationOver:\"#f87171\"},timeline:{gridLine:\"#475569\",minorGridLine:\"#334155\",tickMark:\"#334155\",labelText:\"#cbd5e1\",panelFill:\"#0f172a\",border:\"#334155\"},header:{cardBorder:\"#475569\",author:\"#94a3b8\"},item:{overflowX:\"#f87171\",linkIconFg:\"#94a3b8\",overflowTailFill:\"#7f1d1d\",overflowTailStroke:\"#f87171\",overflowCaption:\"#fecaca\"},parallel:{bracketStroke:\"#cbd5e1\"},anchorDiamond:{fill:\"#0f172a\",stroke:\"#cbd5e1\",label:\"#cbd5e1\",cutLine:\"#94a3b8\"},milestoneDiamond:{fill:\"#e2e8f0\",label:\"#e2e8f0\",cutLineNormal:\"#a5b4fc\",cutLineOverrun:\"#ef4444\",slack:\"#cbd5e1\"},footnotePanel:{fill:\"#0f172a\",border:\"#334155\",header:\"#e2e8f0\",title:\"#e2e8f0\",description:\"#94a3b8\",number:\"#f87171\"},nowline:{stroke:\"#f87171\",labelText:\"#0b1220\",labelBg:\"#f87171\"},milestone:{dashedInk:\"#a5b4fc\",overrun:\"#ef4444\"},anchor:{predecessorLine:\"#94a3b8\"},dependency:{edgeStroke:\"#cbd5e1\",overflowStroke:\"#ef5350\"},footnote:{indicatorText:\"#f87171\",descriptionMuted:\"#94a3b8\"},includeRegion:{border:\"#475569\",label:\"#cbd5e1\",badge:\"#94a3b8\",fill:\"#0b1220\",tabFill:\"#111827\",tabStroke:\"#475569\",tabText:\"#e2e8f0\",badgeFill:\"#1e293b\",badgeStroke:\"#475569\",badgeText:\"#94a3b8\"},arrowhead:{neutral:\"#94a3b8\",light:\"#64748b\",dark:\"#e2e8f0\"},status:{done:\"#34d399\",inProgress:\"#60a5fa\",atRisk:\"#facc15\",blocked:\"#ef4444\",planned:\"#94a3b8\",neutral:\"#94a3b8\"},statusDot:{onLight:{done:\"#065f46\",inProgress:\"#1e3a8a\",atRisk:\"#92400e\",blocked:\"#991b1b\",planned:\"#334155\",neutral:\"#334155\"},onDark:{done:\"#d1fae5\",inProgress:\"#dbeafe\",atRisk:\"#fef3c7\",blocked:\"#fee2e2\",planned:\"#e2e8f0\",neutral:\"#e2e8f0\"}},attribution:{mark:\"#cbd5e1\",link:\"#f87171\"},diagnostic:{overlayBg:\"#7f1d1d\",errorText:\"#fecaca\"}};var CS={red:\"#4a4a4a\",blue:\"#6b6b6b\",green:\"#8a8a8a\",yellow:\"#c8c8c8\",orange:\"#5c5c5c\",purple:\"#3a3a3a\",gray:\"#9e9e9e\",navy:\"#2a2a2a\",white:\"#ffffff\"},Yn={bg:\"none\",fg:\"#1a1a1a\",text:\"#1a1a1a\",border:\"solid\",icon:\"none\",shadow:\"none\",font:\"sans\",weight:\"normal\",italic:!1,textSize:\"md\",padding:\"sm\",spacing:\"sm\",headerHeight:\"sm\",cornerRadius:\"sm\",bracket:\"none\",capacityIcon:\"multiplier\"},PS={name:\"grayscale\",surface:{page:\"#f5f5f5\",chart:\"#ffffff\",headerBox:\"#ffffff\"},entities:{roadmap:{...Yn,headerHeight:\"md\",padding:\"md\"},swimlane:{...Yn,fg:\"#3a3a3a\",text:\"#3a3a3a\",padding:\"sm\",spacing:\"none\",textSize:\"sm\"},item:{...Yn,bg:\"#ffffff\",fg:\"#9e9e9e\",text:\"#1a1a1a\",shadow:\"subtle\",cornerRadius:\"sm\"},parallel:{...Yn,bracket:\"none\",padding:\"xs\"},group:{...Yn,bracket:\"solid\",padding:\"xs\",fg:\"#595959\"},anchor:{...Yn,bg:\"#1a1a1a\",fg:\"#1a1a1a\",text:\"#1a1a1a\",cornerRadius:\"sm\"},milestone:{...Yn,bg:\"#2a2a2a\",fg:\"#2a2a2a\",text:\"#ffffff\",border:\"solid\"},footnote:{...Yn,bg:\"none\",fg:\"#595959\",text:\"#595959\",textSize:\"sm\"},label:{...Yn,bg:\"#e8e8e8\",fg:\"#595959\",text:\"#595959\",textSize:\"xs\",padding:\"xs\",cornerRadius:\"full\"}},swimlane:{bandEven:\"#ffffff\",bandOdd:\"#f5f5f5\",separator:\"#d4d4d4\",frameTabText:\"#3a3a3a\",frameTabMuted:\"#737373\",border:\"#d4d4d4\",tabFill:\"#e8e8e8\",tabStroke:\"#bdbdbd\",tabText:\"#3a3a3a\",ownerText:\"#737373\",footnoteIndicator:\"#4a4a4a\",rowTintEven:\"#ffffff\",rowTintOdd:\"#f5f5f5\",utilizationOk:\"#8a8a8a\",utilizationWarn:\"#595959\",utilizationOver:\"#1a1a1a\"},timeline:{gridLine:\"#bdbdbd\",minorGridLine:\"#d4d4d4\",tickMark:\"#bdbdbd\",labelText:\"#737373\",panelFill:\"#ffffff\",border:\"#d4d4d4\"},header:{cardBorder:\"#d4d4d4\",author:\"#737373\"},item:{overflowX:\"#1a1a1a\",linkIconFg:\"#1a1a1a\",overflowTailFill:\"#e8e8e8\",overflowTailStroke:\"#4a4a4a\",overflowCaption:\"#3a3a3a\"},parallel:{bracketStroke:\"#3a3a3a\"},anchorDiamond:{fill:\"#ffffff\",stroke:\"#3a3a3a\",label:\"#3a3a3a\",cutLine:\"#737373\"},milestoneDiamond:{fill:\"#1a1a1a\",label:\"#1a1a1a\",cutLineNormal:\"#2a2a2a\",cutLineOverrun:\"#4a4a4a\",slack:\"#1a1a1a\"},footnotePanel:{fill:\"#ffffff\",border:\"#d4d4d4\",header:\"#1a1a1a\",title:\"#1a1a1a\",description:\"#737373\",number:\"#4a4a4a\"},nowline:{stroke:\"#1a1a1a\",labelText:\"#ffffff\",labelBg:\"#1a1a1a\"},milestone:{dashedInk:\"#9e9e9e\",overrun:\"#4a4a4a\"},anchor:{predecessorLine:\"#9e9e9e\"},dependency:{edgeStroke:\"#595959\",overflowStroke:\"#1a1a1a\"},footnote:{indicatorText:\"#4a4a4a\",descriptionMuted:\"#737373\"},includeRegion:{border:\"#9e9e9e\",label:\"#3a3a3a\",badge:\"#737373\",fill:\"#f5f5f5\",tabFill:\"#ffffff\",tabStroke:\"#bdbdbd\",tabText:\"#1a1a1a\",badgeFill:\"#e8e8e8\",badgeStroke:\"#bdbdbd\",badgeText:\"#595959\"},arrowhead:{neutral:\"#595959\",light:\"#9e9e9e\",dark:\"#1a1a1a\"},status:{done:\"#8a8a8a\",inProgress:\"#595959\",atRisk:\"#737373\",blocked:\"#3a3a3a\",planned:\"#bdbdbd\",neutral:\"#bdbdbd\"},statusDot:{onLight:{done:\"#3a3a3a\",inProgress:\"#2a2a2a\",atRisk:\"#4a4a4a\",blocked:\"#1a1a1a\",planned:\"#595959\",neutral:\"#595959\"},onDark:{done:\"#d4d4d4\",inProgress:\"#e8e8e8\",atRisk:\"#c8c8c8\",blocked:\"#f0f0f0\",planned:\"#d4d4d4\",neutral:\"#d4d4d4\"}},attribution:{mark:\"#9e9e9e\",link:\"#1a1a1a\"},diagnostic:{overlayBg:\"#e8e8e8\",errorText:\"#1a1a1a\"}};var OS={red:\"#e53935\",blue:\"#1e88e5\",yellow:\"#fdd835\",green:\"#43a047\",orange:\"#fb8c00\",purple:\"#8e24aa\",gray:\"#9e9e9e\",navy:\"#0d47a1\",white:\"#ffffff\"},Kn={bg:\"none\",fg:\"#0f172a\",text:\"#0f172a\",border:\"solid\",icon:\"none\",shadow:\"none\",font:\"sans\",weight:\"normal\",italic:!1,textSize:\"md\",padding:\"sm\",spacing:\"sm\",headerHeight:\"sm\",cornerRadius:\"sm\",bracket:\"none\",capacityIcon:\"multiplier\"},LS={name:\"light\",surface:{page:\"#f8fafc\",chart:\"#ffffff\",headerBox:\"#ffffff\"},entities:{roadmap:{...Kn,headerHeight:\"md\",padding:\"md\"},swimlane:{...Kn,fg:\"#334155\",text:\"#334155\",padding:\"sm\",spacing:\"none\",textSize:\"sm\"},item:{...Kn,bg:\"#ffffff\",fg:\"#94a3b8\",text:\"#0f172a\",shadow:\"subtle\",cornerRadius:\"sm\"},parallel:{...Kn,bracket:\"none\",padding:\"xs\"},group:{...Kn,bracket:\"solid\",padding:\"xs\",fg:\"#475569\"},anchor:{...Kn,bg:\"#0f172a\",fg:\"#0f172a\",text:\"#0f172a\",cornerRadius:\"sm\"},milestone:{...Kn,bg:\"#312e81\",fg:\"#312e81\",text:\"#ffffff\",border:\"solid\"},footnote:{...Kn,bg:\"none\",fg:\"#475569\",text:\"#475569\",textSize:\"sm\"},label:{...Kn,bg:\"#f1f5f9\",fg:\"#475569\",text:\"#475569\",textSize:\"xs\",padding:\"xs\",cornerRadius:\"full\"}},swimlane:{bandEven:\"#ffffff\",bandOdd:\"#f8fafc\",separator:\"#e2e8f0\",frameTabText:\"#334155\",frameTabMuted:\"#64748b\",border:\"#e2e8f0\",tabFill:\"#f1f5f9\",tabStroke:\"#cbd5e1\",tabText:\"#334155\",ownerText:\"#64748b\",footnoteIndicator:\"#dc2626\",rowTintEven:\"#ffffff\",rowTintOdd:\"#f8fafc\",utilizationOk:\"#10b981\",utilizationWarn:\"#f59e0b\",utilizationOver:\"#ef4444\"},timeline:{gridLine:\"#cbd5e1\",minorGridLine:\"#e2e8f0\",tickMark:\"#cbd5e1\",labelText:\"#64748b\",panelFill:\"#ffffff\",border:\"#e2e8f0\"},header:{cardBorder:\"#e2e8f0\",author:\"#64748b\"},item:{overflowX:\"#dc2626\",linkIconFg:\"#0f172a\",overflowTailFill:\"#fee2e2\",overflowTailStroke:\"#ef4444\",overflowCaption:\"#b91c1c\"},parallel:{bracketStroke:\"#334155\"},anchorDiamond:{fill:\"#ffffff\",stroke:\"#334155\",label:\"#334155\",cutLine:\"#64748b\"},milestoneDiamond:{fill:\"#0f172a\",label:\"#0f172a\",cutLineNormal:\"#1e1b4b\",cutLineOverrun:\"#b91c1c\",slack:\"#0f172a\"},footnotePanel:{fill:\"#ffffff\",border:\"#e2e8f0\",header:\"#0f172a\",title:\"#0f172a\",description:\"#64748b\",number:\"#dc2626\"},nowline:{stroke:\"#e53e3e\",labelText:\"#ffffff\",labelBg:\"#e53e3e\"},milestone:{dashedInk:\"#94a3b8\",overrun:\"#ef4444\"},anchor:{predecessorLine:\"#94a3b8\"},dependency:{edgeStroke:\"#475569\",overflowStroke:\"#d32f2f\"},footnote:{indicatorText:\"#e53e3e\",descriptionMuted:\"#64748b\"},includeRegion:{border:\"#94a3b8\",label:\"#334155\",badge:\"#64748b\",fill:\"#f8fafc\",tabFill:\"#ffffff\",tabStroke:\"#cbd5e1\",tabText:\"#0f172a\",badgeFill:\"#e2e8f0\",badgeStroke:\"#cbd5e1\",badgeText:\"#475569\"},arrowhead:{neutral:\"#475569\",light:\"#94a3b8\",dark:\"#0f172a\"},status:{done:\"#10b981\",inProgress:\"#3b82f6\",atRisk:\"#f59e0b\",blocked:\"#ef4444\",planned:\"#94a3b8\",neutral:\"#94a3b8\"},statusDot:{onLight:{done:\"#065f46\",inProgress:\"#1e3a8a\",atRisk:\"#92400e\",blocked:\"#991b1b\",planned:\"#334155\",neutral:\"#334155\"},onDark:{done:\"#d1fae5\",inProgress:\"#dbeafe\",atRisk:\"#fef3c7\",blocked:\"#fee2e2\",planned:\"#e2e8f0\",neutral:\"#e2e8f0\"}},attribution:{mark:\"#94a3b8\",link:\"#e53e3e\"},diagnostic:{overlayBg:\"#fee2e2\",errorText:\"#991b1b\"}};var DS={light:LS,dark:NS,grayscale:PS};var W2={grey:\"gray\",violet:\"purple\"};function Vo(t,e){if(t===\"none\")return\"none\";if(t.startsWith(\"#\"))return t;let r=e.name===\"dark\"?SS:e.name===\"grayscale\"?CS:OS,n=W2[t]??t,i=r[n];return typeof i==\"string\"?i:t}function ec(t){return t.key.endsWith(\":\")?t.key.slice(0,-1):t.key}function q2(t,e){return{bg:Vo(t.bg,e),fg:Vo(t.fg,e),text:Vo(t.text,e),border:t.border,icon:t.icon,shadow:t.shadow,font:t.font,weight:t.weight,italic:t.italic,textSize:t.textSize,padding:t.padding,spacing:t.spacing,headerHeight:t.headerHeight,cornerRadius:t.cornerRadius,bracket:t.bracket,headerPosition:\"beside\",capacityIcon:t.capacityIcon,timelinePosition:\"top\",minorGrid:!1}}function gw(t,e,r,n){switch(e){case\"bg\":t.bg=Vo(r,n);break;case\"fg\":t.fg=Vo(r,n);break;case\"text\":t.text=Vo(r,n);break;case\"border\":(r===\"solid\"||r===\"dashed\"||r===\"dotted\")&&(t.border=r);break;case\"icon\":t.icon=r;break;case\"shadow\":(r===\"none\"||r===\"subtle\"||r===\"soft\"||r===\"hard\")&&(t.shadow=r);break;case\"font\":(r===\"sans\"||r===\"serif\"||r===\"mono\")&&(t.font=r);break;case\"weight\":(r===\"thin\"||r===\"light\"||r===\"normal\"||r===\"bold\")&&(t.weight=r);break;case\"italic\":t.italic=r===\"true\";break;case\"text-size\":t.textSize=Iu(r,\"xl\");break;case\"padding\":t.padding=Iu(r,\"xl\");break;case\"spacing\":t.spacing=Iu(r,\"xl\");break;case\"header-height\":t.headerHeight=Iu(r,\"xl\");break;case\"corner-radius\":t.cornerRadius=Iu(r,\"full\");break;case\"bracket\":(r===\"none\"||r===\"solid\"||r===\"dashed\")&&(t.bracket=r);break;case\"header-position\":(r===\"beside\"||r===\"above\")&&(t.headerPosition=r);break;case\"capacity-icon\":t.capacityIcon=r;break;case\"timeline-position\":(r===\"top\"||r===\"bottom\"||r===\"both\")&&(t.timelinePosition=r);break;case\"minor-grid\":t.minorGrid=r===\"true\";break;default:break}}function Iu(t,e){let r=[\"none\",\"xs\",\"sm\",\"md\",\"lg\",\"xl\",\"full\"],n=r.indexOf(e),i=r.indexOf(t);return i<0?\"md\":i>n?r[n]:r[i]}function MS(t,e,r){if(e)for(let n of e.properties)gw(t,ec(n),n.value,r)}function V2(t,e,r){for(let n of e){let i=ec(n);n.value!==void 0&&gw(t,i,n.value,r)}}function Y2(t,e,r){let n=e.find(o=>ec(o)===\"labels\");if(!n)return;let i=n.value?[n.value]:n.values;for(let o of i){let s=r.labels.get(o);if(!s)continue;let a=s.properties.find(c=>ec(c)===\"style\");a?.value&&MS(t,r.styles.get(a.value),r.theme)}}function K2(t,e,r){let n=e.find(i=>ec(i)===\"style\");n?.value&&MS(t,r.styles.get(n.value),r.theme)}function Et(t,e,r){let n=r.theme.entities[t],i=q2(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&gw(i,ec(s),s.value,r.theme);return Y2(i,e,r),K2(i,e,r),V2(i,e,r.theme),i}function $S(t,e){return Et(\"label\",t.properties,e)}var FS={none:0,xs:2,sm:4,md:8,lg:16,xl:24},US={none:0,xs:4,sm:8,md:12,lg:20,xl:32};var tc={none:0,xs:10,sm:12,md:14,lg:18,xl:24},fh={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999};var Or=8,Tn=4,Su=24,dh=15,Nu=8,ph=22,hh=15,Cu=16,mh=6,yw=4,xw=11,Tw=9,ww=5.5,bw=4,rc=12,gh=\"6 4\",_w=36,Gi=16,Ew=Gi/2,Pu=10,vw=Gi-4,nc=6,yh=2.25,Yr=6,Kr=2*Yr,BS=5,HS=120,Rw=240,xh=72,Ou=28,Zr=16,Aw=22,Lu=18,Th=\"Powered by\",kw=\"https://nowline.io\",Du=.22,ji=40,wh=32,XS=.58,Z2=Th.length*wh*XS,J2=10,Mu=Z2+J2,Iw=Mu+74,Sw=5,bh=Mu+81,Q2=3*ji*XS,eB=bh+Q2,tB=12+ji,Nw=eB*Du,GS=tB*Du,Cw=4;var Pw={sans:'system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',serif:'Georgia, \"Times New Roman\", serif',mono:\"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\"},jS={days:7,weeks:4,months:3,quarters:4,years:5};var _h=class{constructor(e,r){xe(this,\"node\");xe(this,\"deps\");this.node=e,this.deps=r}get id(){return this.node.name??\"\"}place(e,r){let{node:n}=this,{deps:i}=this,o=Et(\"group\",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.nextGroupId+=1,r.currentFlowKey=`${c}/group:${n.name??`group-${r.nextGroupId}`}`;let l=o.bg!==\"none\"&&o.bg!==\"#ffffff\"&&!!a,u=l?Cu+yw:0,f=l?bw:0,d=!l&&a?rc:0,p=e.y+d,m=r.bandScale.step(),w=s,T=new Qa({laneLeftX:w,originY:p+u,minRowHeight:m,slackCorridors:r.slackCorridors}),_=w,E=[];for(let oe of n.content){if(oe.$type===\"DescriptionDirective\")continue;if(!_r(oe)){let ye=oe.properties??[],nt=i.resolveChildStart(ye,_,w,r),{rowIndex:Le,y:We}=T.placeBlock(),z=i.newCursor(nt,We),ne=i.sequenceOne(oe,z,r);E.push(ne);let ae=ne.box.x+ne.box.width,O=Math.max(m,z.height);T.commitBlock({rowIndex:Le,placed:ne,blockHeight:O,blockEnd:ae}),_=Math.max(_,ae);continue}let Ce=oe.properties,M=i.resolveChildStart(Ce,_,w,r),R=Xi(Ce,r.sizes,r.cal),D=Math.max(Or,R*r.timeline.pixelsPerDay),X=M+D,A=oe.name??\"\",I=i.predictItemChipExtraHeight(oe,r),S=m+I,{rowIndex:G,y:V}=T.placeItem({childId:A,desiredStart:M,desiredEnd:X,predictedHeight:S}),B=i.newCursor(M,V),K=i.sequenceItem(oe,B,r);E.push(K);let Q=K.box.x+K.box.width+Yr;_=Math.max(_,Q);let _e=null;(K.textSpills||K.chipsOutside||K.dotSpills||K.iconSpills||K.footnoteSpills)&&(_e=Math.max(K.decorationsRightX,K.chipsOutside?K.chipsRightX:0)+6),T.commitItem({rowIndex:G,placed:K,logicalEnd:Q,spillReservation:_e,rowHeight:S})}let b=Math.max(m,T.usedHeight()),N=Math.max(_,T.usedRightX()),F={x:s,y:p,width:N-s,height:u+b+f};e.x=_+Nu,e.maxX=Math.max(e.maxX,e.x);let L=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,d+F.height+L);let j=n.name;j&&(r.entityLeftEdges.set(j,F.x),r.entityRightEdges.set(j,F.x+F.width)),r.currentFlowKey=c;let te=lh({box:F,afterDate:qn(_t(n.properties,\"after\")),beforeDate:qn(_t(n.properties,\"before\"))});return{kind:\"group\",id:j,title:a,box:F,children:E,style:o,inlineDatePins:te.length>0?te:void 0}}};var Ow=12,rB=4,nB=13,iB=11;function zS(t,e){return t.length*e*.58}var Eh=class{constructor(e){xe(this,\"input\");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(Or,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(Or,n.width-2*Yr),o=e.x+Yr,s={x:o,y:e.y,width:i,height:n.height},a=this.input.hasLinkIcon?20+oB-Ow:0,c=Ow+Math.max(0,a),l=Math.max(0,i-c-Ow),u=this.input.title,f=u?zS(u,nB):0,d=this.input.metaText?zS(this.input.metaText,iB):0,p=this.input.metaTrailingWidth??0,m=d+p,w=this.input.metaText!==void 0||p>0,T=u.length>0&&f>l||w&&m>l,_=T?o+i+rB:o+c;return{id:this.input.id,box:s,textX:_,textSpills:T}}},oB=4;var vh=class{constructor(e,r){xe(this,\"node\");xe(this,\"deps\");this.node=e,this.deps=r}get id(){return this.node.name??\"\"}place(e,r){let{node:n}=this,{deps:i}=this,o=Et(\"parallel\",n.properties,r.styleCtx),s=e.x,a=e.y,c=[],l=s,u=0,f=r.currentFlowKey;r.nextParallelId+=1;let d=n.name??`parallel-${r.nextParallelId}`,p=0;for(let _ of n.content){if(_.$type===\"DescriptionDirective\")continue;r.currentFlowKey=`${f}/par:${d}#${p}`;let E=i.newCursor(s,a+u),b=i.sequenceOne(_,E,r);c.push(b),u+=Math.max(r.bandScale.step(),E.height),l=Math.max(l,E.maxX),p++}r.currentFlowKey=f;let m={x:s,y:a,width:l-s,height:u};e.x=l+Nu,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,u);let w=n.name;w&&(r.entityLeftEdges.set(w,m.x),r.entityRightEdges.set(w,m.x+m.width));let T=lh({box:m,afterDate:qn(_t(n.properties,\"after\")),beforeDate:qn(_t(n.properties,\"before\"))});return{kind:\"parallel\",id:w,title:n.title??n.name,box:m,children:c,style:o,inlineDatePins:T.length>0?T:void 0}}};function Yo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Lw(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ko(t){let e,r,n;t.length!==2?(e=Yo,r=(a,c)=>Yo(t(a),c),n=(a,c)=>t(a)-c):(e=t===Yo||t===Lw?t:sB,r=t,n=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function sB(){return 0}function Dw(t){return t===null?NaN:+t}var WS=Ko(Yo),qS=WS.right,aB=WS.left,cB=Ko(Dw).center,Mw=qS;var ic=class extends Map{constructor(e,r=fB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(VS(this,e))}has(e){return super.has(VS(this,e))}set(e,r){return super.set(lB(this,e),r)}delete(e){return super.delete(uB(this,e))}};function VS({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function lB({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function uB({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function fB(t){return t!==null&&typeof t==\"object\"?t.valueOf():t}var dB=Math.sqrt(50),pB=Math.sqrt(10),hB=Math.sqrt(2);function YS(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=dB?10:o>=pB?5:o>=hB?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=r&&r<2?YS(t,e,r*2):[a,c,l]}function $w(t,e,r){return e=+e,t=+t,r=+r,YS(t,e,r)[2]}function Rh(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?$w(e,t,r):$w(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Ah(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,o=new Array(i);++n<i;)o[n]=t+n*r;return o}function oc(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var KS=Symbol(\"implicit\");function kh(){var t=new ic,e=[],r=[],n=KS;function i(o){let s=t.get(o);if(s===void 0){if(n!==KS)return n;t.set(o,s=e.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new ic;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return kh(e,r).unknown(n)},oc.apply(i,arguments),i}function $u(){var t=kh().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var d=e().length,p=i<n,m=p?i:n,w=p?n:i;o=(w-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(w-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var T=Ah(d).map(function(_){return m+o*_});return r(p?T.reverse():T)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return $u(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},oc.apply(f(),arguments)}function Ih(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Fw(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Bu(){}var Fu=.7,Ch=1/Fu,sc=\"\\\\s*([+-]?\\\\d+)\\\\s*\",Uu=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",wn=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",mB=/^#([0-9a-f]{3,8})$/,gB=new RegExp(`^rgb\\\\(${sc},${sc},${sc}\\\\)$`),yB=new RegExp(`^rgb\\\\(${wn},${wn},${wn}\\\\)$`),xB=new RegExp(`^rgba\\\\(${sc},${sc},${sc},${Uu}\\\\)$`),TB=new RegExp(`^rgba\\\\(${wn},${wn},${wn},${Uu}\\\\)$`),wB=new RegExp(`^hsl\\\\(${Uu},${wn},${wn}\\\\)$`),bB=new RegExp(`^hsla\\\\(${Uu},${wn},${wn},${Uu}\\\\)$`),ZS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ih(Bu,zi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:JS,formatHex:JS,formatHex8:_B,formatHsl:EB,formatRgb:QS,toString:QS});function JS(){return this.rgb().formatHex()}function _B(){return this.rgb().formatHex8()}function EB(){return oN(this).formatHsl()}function QS(){return this.rgb().formatRgb()}function zi(t){var e,r;return t=(t+\"\").trim().toLowerCase(),(e=mB.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?eN(e):r===3?new pr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Sh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Sh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=gB.exec(t))?new pr(e[1],e[2],e[3],1):(e=yB.exec(t))?new pr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=xB.exec(t))?Sh(e[1],e[2],e[3],e[4]):(e=TB.exec(t))?Sh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=wB.exec(t))?nN(e[1],e[2]/100,e[3]/100,1):(e=bB.exec(t))?nN(e[1],e[2]/100,e[3]/100,e[4]):ZS.hasOwnProperty(t)?eN(ZS[t]):t===\"transparent\"?new pr(NaN,NaN,NaN,0):null}function eN(t){return new pr(t>>16&255,t>>8&255,t&255,1)}function Sh(t,e,r,n){return n<=0&&(t=e=r=NaN),new pr(t,e,r,n)}function vB(t){return t instanceof Bu||(t=zi(t)),t?(t=t.rgb(),new pr(t.r,t.g,t.b,t.opacity)):new pr}function ac(t,e,r,n){return arguments.length===1?vB(t):new pr(t,e,r,n??1)}function pr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Ih(pr,ac,Fw(Bu,{brighter(t){return t=t==null?Ch:Math.pow(Ch,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Fu:Math.pow(Fu,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new pr(Jo(this.r),Jo(this.g),Jo(this.b),Ph(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tN,formatHex:tN,formatHex8:RB,formatRgb:rN,toString:rN}));function tN(){return`#${Zo(this.r)}${Zo(this.g)}${Zo(this.b)}`}function RB(){return`#${Zo(this.r)}${Zo(this.g)}${Zo(this.b)}${Zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function rN(){let t=Ph(this.opacity);return`${t===1?\"rgb(\":\"rgba(\"}${Jo(this.r)}, ${Jo(this.g)}, ${Jo(this.b)}${t===1?\")\":`, ${t})`}`}function Ph(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Zo(t){return t=Jo(t),(t<16?\"0\":\"\")+t.toString(16)}function nN(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Jr(t,e,r,n)}function oN(t){if(t instanceof Jr)return new Jr(t.h,t.s,t.l,t.opacity);if(t instanceof Bu||(t=zi(t)),!t)return new Jr;if(t instanceof Jr)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-e)/a+2:s=(e-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Jr(s,a,c,t.opacity)}function sN(t,e,r,n){return arguments.length===1?oN(t):new Jr(t,e,r,n??1)}function Jr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Ih(Jr,sN,Fw(Bu,{brighter(t){return t=t==null?Ch:Math.pow(Ch,t),new Jr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Fu:Math.pow(Fu,t),new Jr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new pr(Uw(t>=240?t-240:t+120,i,n),Uw(t,i,n),Uw(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Jr(iN(this.h),Nh(this.s),Nh(this.l),Ph(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ph(this.opacity);return`${t===1?\"hsl(\":\"hsla(\"}${iN(this.h)}, ${Nh(this.s)*100}%, ${Nh(this.l)*100}%${t===1?\")\":`, ${t})`}`}}));function iN(t){return t=(t||0)%360,t<0?t+360:t}function Nh(t){return Math.max(0,Math.min(1,t||0))}function Uw(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Bw(t,e,r,n,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*r+(1+3*t+3*o-3*s)*n+s*i)/6}function aN(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],s=n>0?t[n-1]:2*i-o,a=n<e-1?t[n+2]:2*o-i;return Bw((r-n/e)*e,s,i,o,a)}}function cN(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],s=t[(n+1)%e],a=t[(n+2)%e];return Bw((r-n/e)*e,i,o,s,a)}}var Hu=t=>()=>t;function AB(t,e){return function(r){return t+r*e}}function kB(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function lN(t){return(t=+t)==1?Oh:function(e,r){return r-e?kB(e,r,t):Hu(isNaN(e)?r:e)}}function Oh(t,e){var r=e-t;return r?AB(t,r):Hu(isNaN(t)?e:t)}var Hw=(function t(e){var r=lN(e);function n(i,o){var s=r((i=ac(i)).r,(o=ac(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=Oh(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+\"\"}}return n.gamma=t,n})(1);function uN(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=ac(e[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=t(n),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+\"\"}}}var Jte=uN(aN),Qte=uN(cN);function fN(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=t[i]*(1-o)+e[i]*o;return n}}function dN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function pN(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=Qo(t[s],e[s]);for(;s<r;++s)o[s]=e[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function hN(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Wi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function mN(t,e){var r={},n={},i;(t===null||typeof t!=\"object\")&&(t={}),(e===null||typeof e!=\"object\")&&(e={});for(i in e)i in t?r[i]=Qo(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var Gw=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Xw=new RegExp(Gw.source,\"g\");function IB(t){return function(){return t}}function SB(t){return function(e){return t(e)+\"\"}}function gN(t,e){var r=Gw.lastIndex=Xw.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+\"\",e=e+\"\";(n=Gw.exec(t))&&(i=Xw.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Wi(n,i)})),r=Xw.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?SB(c[0].x):IB(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join(\"\")})}function Qo(t,e){var r=typeof e,n;return e==null||r===\"boolean\"?Hu(e):(r===\"number\"?Wi:r===\"string\"?(n=zi(e))?(e=n,Hw):gN:e instanceof zi?Hw:e instanceof Date?hN:dN(e)?fN:Array.isArray(e)?pN:typeof e.valueOf!=\"function\"&&typeof e.toString!=\"function\"||isNaN(e)?mN:Wi)(t,e)}function jw(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function zw(t){return function(){return t}}function Ww(t){return+t}var yN=[0,1];function cc(t){return t}function qw(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:zw(isNaN(e)?NaN:.5)}function NB(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function CB(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=qw(i,n),o=r(s,o)):(n=qw(n,i),o=r(o,s)),function(a){return o(n(a))}}function PB(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=qw(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=Mw(t,a,1,n)-1;return o[c](i[c](a))}}function xN(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function OB(){var t=yN,e=yN,r=Qo,n,i,o,s=cc,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==cc&&(s=NB(t[0],t[d-1])),a=d>2?PB:CB,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(t.map(n),e,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(e,t.map(n),Wi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,Ww),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=jw,u()},f.clamp=function(d){return arguments.length?(s=d?!0:cc,u()):s!==cc},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return n=d,i=p,u()}}function Vw(){return OB()(cc,cc)}function Yw(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],o=t[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),t[r]=e.floor(i),t[n]=e.ceil(o),t}var Kw=new Date,Zw=new Date;function rt(t,e,r,n){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>rt(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),r&&(i.count=(o,s)=>(Kw.setTime(+o),Zw.setTime(+s),t(Kw),t(Zw),Math.floor(r(Kw,Zw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var Xu=rt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Xu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?rt(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Xu);var Dre=Xu.range;var bn=rt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),TN=bn.range;var lc=rt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),LB=lc.range,Lh=rt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),DB=Lh.range;var uc=rt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),MB=uc.range,Dh=rt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),$B=Dh.range;var Zn=rt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),FB=Zn.range,ju=rt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),UB=ju.range,Mh=rt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),BB=Mh.range;function rs(t){return rt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Jn=rs(0),fc=rs(1),bN=rs(2),_N=rs(3),qi=rs(4),EN=rs(5),vN=rs(6),RN=Jn.range,HB=fc.range,XB=bN.range,GB=_N.range,jB=qi.range,zB=EN.range,WB=vN.range;function ns(t){return rt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var is=ns(0),dc=ns(1),AN=ns(2),kN=ns(3),Vi=ns(4),IN=ns(5),SN=ns(6),NN=is.range,qB=dc.range,VB=AN.range,YB=kN.range,KB=Vi.range,ZB=IN.range,JB=SN.range;var pc=rt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),QB=pc.range,$h=rt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),eH=$h.range;var Er=rt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Er.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var tH=Er.range,Qr=rt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Qr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var rH=Qr.range;function PN(t,e,r,n,i,o){let s=[[bn,1,1e3],[bn,5,5*1e3],[bn,15,15*1e3],[bn,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let p=f&&typeof f.range==\"function\"?f:c(l,u,f),m=p?p.range(l,+u+1):[];return d?m.reverse():m}function c(l,u,f){let d=Math.abs(u-l)/f,p=Ko(([,,T])=>T).right(s,d);if(p===s.length)return t.every(Rh(l/31536e6,u/31536e6,f));if(p===0)return Xu.every(Math.max(Rh(l,u,f),1));let[m,w]=s[d/s[p-1][2]<s[p][2]/d?p-1:p];return m.every(w)}return[a,c]}var[iH,oH]=PN(Qr,$h,is,Mh,Dh,Lh),[Jw,Qw]=PN(Er,pc,Jn,Zn,uc,lc);function eb(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function tb(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function zu(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function rb(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=Wu(i),u=qu(i),f=Wu(o),d=qu(o),p=Wu(s),m=qu(s),w=Wu(a),T=qu(a),_=Wu(c),E=qu(c),b={a:S,A:G,b:V,B,c:null,d:FN,e:FN,f:IH,g:FH,G:BH,H:RH,I:AH,j:kH,L:GN,m:SH,M:NH,p:K,q:Q,Q:HN,s:XN,S:CH,u:PH,U:OH,V:LH,w:DH,W:MH,x:null,X:null,y:$H,Y:UH,Z:HH,\"%\":BN},N={a:_e,A:J,b:ye,B:nt,c:null,d:UN,e:UN,f:zH,g:tX,G:nX,H:XH,I:GH,j:jH,L:zN,m:WH,M:qH,p:Le,q:We,Q:HN,s:XN,S:VH,u:YH,U:KH,V:ZH,w:JH,W:QH,x:null,X:null,y:eX,Y:rX,Z:iX,\"%\":BN},F={a:Ce,A:M,b:R,B:D,c:X,d:MN,e:MN,f:bH,g:DN,G:LN,H:$N,I:$N,j:yH,L:wH,m:gH,M:xH,p:oe,q:mH,Q:EH,s:vH,S:TH,u:uH,U:fH,V:dH,w:lH,W:pH,x:A,X:I,y:DN,Y:LN,Z:hH,\"%\":_H};b.x=L(r,b),b.X=L(n,b),b.c=L(e,b),N.x=L(r,N),N.X=L(n,N),N.c=L(e,N);function L(z,ne){return function(ae){var O=[],Fe=-1,ve=0,ke=z.length,Ze,H,Vt;for(ae instanceof Date||(ae=new Date(+ae));++Fe<ke;)z.charCodeAt(Fe)===37&&(O.push(z.slice(ve,Fe)),(H=ON[Ze=z.charAt(++Fe)])!=null?Ze=z.charAt(++Fe):H=Ze===\"e\"?\" \":\"0\",(Vt=ne[Ze])&&(Ze=Vt(ae,H)),O.push(Ze),ve=Fe+1);return O.push(z.slice(ve,Fe)),O.join(\"\")}}function j(z,ne){return function(ae){var O=zu(1900,void 0,1),Fe=te(O,z,ae+=\"\",0),ve,ke;if(Fe!=ae.length)return null;if(\"Q\"in O)return new Date(O.Q);if(\"s\"in O)return new Date(O.s*1e3+(\"L\"in O?O.L:0));if(ne&&!(\"Z\"in O)&&(O.Z=0),\"p\"in O&&(O.H=O.H%12+O.p*12),O.m===void 0&&(O.m=\"q\"in O?O.q:0),\"V\"in O){if(O.V<1||O.V>53)return null;\"w\"in O||(O.w=1),\"Z\"in O?(ve=tb(zu(O.y,0,1)),ke=ve.getUTCDay(),ve=ke>4||ke===0?dc.ceil(ve):dc(ve),ve=ju.offset(ve,(O.V-1)*7),O.y=ve.getUTCFullYear(),O.m=ve.getUTCMonth(),O.d=ve.getUTCDate()+(O.w+6)%7):(ve=eb(zu(O.y,0,1)),ke=ve.getDay(),ve=ke>4||ke===0?fc.ceil(ve):fc(ve),ve=Zn.offset(ve,(O.V-1)*7),O.y=ve.getFullYear(),O.m=ve.getMonth(),O.d=ve.getDate()+(O.w+6)%7)}else(\"W\"in O||\"U\"in O)&&(\"w\"in O||(O.w=\"u\"in O?O.u%7:\"W\"in O?1:0),ke=\"Z\"in O?tb(zu(O.y,0,1)).getUTCDay():eb(zu(O.y,0,1)).getDay(),O.m=0,O.d=\"W\"in O?(O.w+6)%7+O.W*7-(ke+5)%7:O.w+O.U*7-(ke+6)%7);return\"Z\"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,tb(O)):eb(O)}}function te(z,ne,ae,O){for(var Fe=0,ve=ne.length,ke=ae.length,Ze,H;Fe<ve;){if(O>=ke)return-1;if(Ze=ne.charCodeAt(Fe++),Ze===37){if(Ze=ne.charAt(Fe++),H=F[Ze in ON?ne.charAt(Fe++):Ze],!H||(O=H(z,ae,O))<0)return-1}else if(Ze!=ae.charCodeAt(O++))return-1}return O}function oe(z,ne,ae){var O=l.exec(ne.slice(ae));return O?(z.p=u.get(O[0].toLowerCase()),ae+O[0].length):-1}function Ce(z,ne,ae){var O=p.exec(ne.slice(ae));return O?(z.w=m.get(O[0].toLowerCase()),ae+O[0].length):-1}function M(z,ne,ae){var O=f.exec(ne.slice(ae));return O?(z.w=d.get(O[0].toLowerCase()),ae+O[0].length):-1}function R(z,ne,ae){var O=_.exec(ne.slice(ae));return O?(z.m=E.get(O[0].toLowerCase()),ae+O[0].length):-1}function D(z,ne,ae){var O=w.exec(ne.slice(ae));return O?(z.m=T.get(O[0].toLowerCase()),ae+O[0].length):-1}function X(z,ne,ae){return te(z,e,ne,ae)}function A(z,ne,ae){return te(z,r,ne,ae)}function I(z,ne,ae){return te(z,n,ne,ae)}function S(z){return s[z.getDay()]}function G(z){return o[z.getDay()]}function V(z){return c[z.getMonth()]}function B(z){return a[z.getMonth()]}function K(z){return i[+(z.getHours()>=12)]}function Q(z){return 1+~~(z.getMonth()/3)}function _e(z){return s[z.getUTCDay()]}function J(z){return o[z.getUTCDay()]}function ye(z){return c[z.getUTCMonth()]}function nt(z){return a[z.getUTCMonth()]}function Le(z){return i[+(z.getUTCHours()>=12)]}function We(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var ne=L(z+=\"\",b);return ne.toString=function(){return z},ne},parse:function(z){var ne=j(z+=\"\",!1);return ne.toString=function(){return z},ne},utcFormat:function(z){var ne=L(z+=\"\",N);return ne.toString=function(){return z},ne},utcParse:function(z){var ne=j(z+=\"\",!0);return ne.toString=function(){return z},ne}}}var ON={\"-\":\"\",_:\" \",0:\"0\"},$t=/^\\s*\\d+/,sH=/^%/,aH=/[\\\\^$*+?|[\\]().{}]/g;function Ge(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function cH(t){return t.replace(aH,\"\\\\$&\")}function Wu(t){return new RegExp(\"^(?:\"+t.map(cH).join(\"|\")+\")\",\"i\")}function qu(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function lH(t,e,r){var n=$t.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function uH(t,e,r){var n=$t.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function fH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function dH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function pH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function LN(t,e,r){var n=$t.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function DN(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function hH(t,e,r){var n=/^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||\"00\")),r+n[0].length):-1}function mH(t,e,r){var n=$t.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function gH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function MN(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function yH(t,e,r){var n=$t.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function $N(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function xH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function TH(t,e,r){var n=$t.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function wH(t,e,r){var n=$t.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function bH(t,e,r){var n=$t.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function _H(t,e,r){var n=sH.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function EH(t,e,r){var n=$t.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function vH(t,e,r){var n=$t.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function FN(t,e){return Ge(t.getDate(),e,2)}function RH(t,e){return Ge(t.getHours(),e,2)}function AH(t,e){return Ge(t.getHours()%12||12,e,2)}function kH(t,e){return Ge(1+Zn.count(Er(t),t),e,3)}function GN(t,e){return Ge(t.getMilliseconds(),e,3)}function IH(t,e){return GN(t,e)+\"000\"}function SH(t,e){return Ge(t.getMonth()+1,e,2)}function NH(t,e){return Ge(t.getMinutes(),e,2)}function CH(t,e){return Ge(t.getSeconds(),e,2)}function PH(t){var e=t.getDay();return e===0?7:e}function OH(t,e){return Ge(Jn.count(Er(t)-1,t),e,2)}function jN(t){var e=t.getDay();return e>=4||e===0?qi(t):qi.ceil(t)}function LH(t,e){return t=jN(t),Ge(qi.count(Er(t),t)+(Er(t).getDay()===4),e,2)}function DH(t){return t.getDay()}function MH(t,e){return Ge(fc.count(Er(t)-1,t),e,2)}function $H(t,e){return Ge(t.getFullYear()%100,e,2)}function FH(t,e){return t=jN(t),Ge(t.getFullYear()%100,e,2)}function UH(t,e){return Ge(t.getFullYear()%1e4,e,4)}function BH(t,e){var r=t.getDay();return t=r>=4||r===0?qi(t):qi.ceil(t),Ge(t.getFullYear()%1e4,e,4)}function HH(t){var e=t.getTimezoneOffset();return(e>0?\"-\":(e*=-1,\"+\"))+Ge(e/60|0,\"0\",2)+Ge(e%60,\"0\",2)}function UN(t,e){return Ge(t.getUTCDate(),e,2)}function XH(t,e){return Ge(t.getUTCHours(),e,2)}function GH(t,e){return Ge(t.getUTCHours()%12||12,e,2)}function jH(t,e){return Ge(1+ju.count(Qr(t),t),e,3)}function zN(t,e){return Ge(t.getUTCMilliseconds(),e,3)}function zH(t,e){return zN(t,e)+\"000\"}function WH(t,e){return Ge(t.getUTCMonth()+1,e,2)}function qH(t,e){return Ge(t.getUTCMinutes(),e,2)}function VH(t,e){return Ge(t.getUTCSeconds(),e,2)}function YH(t){var e=t.getUTCDay();return e===0?7:e}function KH(t,e){return Ge(is.count(Qr(t)-1,t),e,2)}function WN(t){var e=t.getUTCDay();return e>=4||e===0?Vi(t):Vi.ceil(t)}function ZH(t,e){return t=WN(t),Ge(Vi.count(Qr(t),t)+(Qr(t).getUTCDay()===4),e,2)}function JH(t){return t.getUTCDay()}function QH(t,e){return Ge(dc.count(Qr(t)-1,t),e,2)}function eX(t,e){return Ge(t.getUTCFullYear()%100,e,2)}function tX(t,e){return t=WN(t),Ge(t.getUTCFullYear()%100,e,2)}function rX(t,e){return Ge(t.getUTCFullYear()%1e4,e,4)}function nX(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Vi(t):Vi.ceil(t),Ge(t.getUTCFullYear()%1e4,e,4)}function iX(){return\"+0000\"}function BN(){return\"%\"}function HN(t){return+t}function XN(t){return Math.floor(+t/1e3)}var hc,Fh,qN,VN,YN;nb({dateTime:\"%x, %X\",date:\"%-m/%-d/%Y\",time:\"%-I:%M:%S %p\",periods:[\"AM\",\"PM\"],days:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],shortDays:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],shortMonths:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]});function nb(t){return hc=rb(t),Fh=hc.format,qN=hc.parse,VN=hc.utcFormat,YN=hc.utcParse,hc}function oX(t){return new Date(t)}function sX(t){return t instanceof Date?+t:+new Date(+t)}function KN(t,e,r,n,i,o,s,a,c,l){var u=Vw(),f=u.invert,d=u.domain,p=l(\".%L\"),m=l(\":%S\"),w=l(\"%I:%M\"),T=l(\"%I %p\"),_=l(\"%a %d\"),E=l(\"%b %d\"),b=l(\"%B\"),N=l(\"%Y\");function F(L){return(c(L)<L?p:a(L)<L?m:s(L)<L?w:o(L)<L?T:n(L)<L?i(L)<L?_:E:r(L)<L?b:N)(L)}return u.invert=function(L){return new Date(f(L))},u.domain=function(L){return arguments.length?d(Array.from(L,sX)):d().map(oX)},u.ticks=function(L){var j=d();return t(j[0],j[j.length-1],L??10)},u.tickFormat=function(L,j){return j==null?F:l(j)},u.nice=function(L){var j=d();return(!L||typeof L.range!=\"function\")&&(L=e(j[0],j[j.length-1],L??10)),L?d(Yw(j,L)):u},u.copy=function(){return xN(u,KN(t,e,r,n,i,o,s,a,c,l))},u}function Uh(){return oc.apply(KN(Jw,Qw,Er,pc,Jn,Zn,uc,lc,bn,Fh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var ib=class t{constructor(e,r,n){xe(this,\"bandwidthPx\");xe(this,\"stepPx\");xe(this,\"d3\");this.bandwidthPx=e,this.stepPx=r,this.d3=n}static fixedRow(e){return new t(e.bandwidth,e.step)}static forRows(e){let r=Array.from({length:e.count},(i,o)=>String(o)),n=$u().domain(r).range(e.range).paddingInner(e.paddingInner??0).paddingOuter(e.paddingOuter??0);return new t(n.bandwidth(),n.step(),n)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(e){if(!this.d3)throw new Error(\"BandScale.forward is only available on closed-domain bands (BandScale.forRows)\");let r=this.d3(e);if(r===void 0)throw new Error(`BandScale: unknown band id \"${e}\"`);return r}},aX={bandwidth:56,step:64};function ZN(){return ib.fixedRow(aX)}var Bh=class{constructor(e){xe(this,\"domain\");xe(this,\"range\");xe(this,\"pixelsPerDay\");xe(this,\"calendar\");xe(this,\"d3\");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,Pr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=Uh().domain(e.domain).range(e.range)}forward(e){let r=Pr(this.domain[0],e);return this.range[0]+r*this.pixelsPerDay}forwardWithinDomain(e){return e<this.domain[0]||e>this.domain[1]?null:this.forward(e)}invert(e){return this.d3.invert(e)}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};function Hh(t){return t.endsWith(\":\")?t.slice(0,-1):t}function JN(t,e){let n=t.roadmapDecl?.properties.find(c=>Hh(c.key)===\"scale\")?.value,i=\"weeks\",o,s;if(n)if(n===\"days\"||n===\"weeks\"||n===\"months\"||n===\"quarters\"||n===\"years\")i=n;else{let c=/^(\\d+)([dwmqy])$/.exec(n);if(c){let l=Math.max(1,parseInt(c[1],10));switch(c[2]){case\"d\":i=\"days\";break;case\"w\":i=\"weeks\";break;case\"m\":i=\"months\";break;case\"q\":i=\"quarters\";break;case\"y\":i=\"years\";break}o=Xh(i)*l,s=1}}let a=s??jS[i]??4;if(e){let l=e.properties.find(m=>Hh(m.key)===\"unit\")?.value??i,u=e.properties.find(m=>Hh(m.key)===\"label-every\"),f=e.properties.find(m=>Hh(m.key)===\"pixels-per-unit\"),d=u?Math.max(1,parseInt(u.value,10)||a):a,p=f?Math.max(1,parseInt(f.value,10)||Xh(l)):o??Xh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Xh(i)}}function Xh(t){switch(t){case\"days\":return BS;case\"weeks\":return 40;case\"months\":return 80;case\"quarters\":return 160;case\"years\":return 320}}function QN(t,e,r,n=Ru){let i=r.daysPerUnit(e.unit),o=i*t.pixelsPerDay,s=Math.max(1,Math.round(t.widthPx/t.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=t.originX+u*t.pixelsPerDay,d=l%e.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?cX(e.unit,qo(t.domain[0],u),l,n):void 0})}return c}function cX(t,e,r,n){switch(t){case\"days\":return`${e.getUTCMonth()+1}/${e.getUTCDate()}`;case\"weeks\":{let i=e.toLocaleString(n,{month:\"short\",timeZone:\"UTC\"}),o=e.getUTCDate().toString().padStart(2,\"0\");return`${i} ${o}`}case\"months\":return e.toLocaleString(n,{month:\"short\",timeZone:\"UTC\"});case\"quarters\":{let i=Math.floor(e.getUTCMonth()/3)+1;return`${ah(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case\"years\":return`${e.getUTCFullYear()}`}}function eC(t){return{daysPerUnit:e=>ob(e,t),addUnits:(e,r,n)=>qo(e,r*ob(n,t)),isWorkingDay:()=>!0}}function tC(t,e){return ob(t,e)}function ob(t,e){switch(t){case\"days\":return 1;case\"weeks\":return e.daysPerWeek;case\"months\":return e.daysPerMonth;case\"quarters\":return e.daysPerQuarter;case\"years\":return e.daysPerYear}}var sb=class{constructor(e,r){xe(this,\"id\");xe(this,\"anchor\");this.id=e,this.anchor=r}place(e,r){let n=fe(this.anchor.properties,\"date\"),i=kt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=Et(\"anchor\",this.anchor.properties,e.styleCtx),a=e.markerRowPlacements.get(this.id),c=a?.centerY??e.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??\"right\";return e.entityLeftEdges.set(this.id,o),e.entityRightEdges.set(this.id,o),e.entityMidpoints.set(this.id,l),{id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f}}};function nC(t,e,r){let n=[];for(let[i,o]of t){let s=new sb(i,o).place(e,r);s&&n.push(s)}return n}function ab(t,e,r){let n=[],i=new Map,o=new Map;return[...t.entries()].sort(([c],[l])=>c.localeCompare(l)).forEach(([c,l],u)=>{let f=u+1;i.set(c,f),o.set(c,_t(l.properties,\"on\")),n.push({number:f,title:l.title??c,description:l.description?.text,style:Et(\"footnote\",l.properties,e.styleCtx)})}),{area:{box:{x:Zr,y:r+Zr,width:e.chartRightX-2*Zr,height:n.length===0?0:Ou+n.length*Lu+Zr},entries:n},index:i,hosts:o}}var lX=.8,uX=1;function fX(t){let e=[];return oC(t,e),e}function oC(t,e){for(let r of t)if(r.kind===\"item\"){let n=dX(r);n>0&&r.box.width>0&&e.push({startX:r.box.x,endX:r.box.x+r.box.width,load:n})}else(r.kind===\"parallel\"||r.kind===\"group\")&&oC(r.children,e)}function dX(t){return t.capacity?t.capacity.value:t.size?1:0}function sC(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=fX(t.children);if(e.length===0)return null;let r=new Set;for(let s of e)r.add(s.startX),r.add(s.endX);let n=Array.from(r).sort((s,a)=>s-a);if(n.length<2)return null;let i=[];for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=(a+c)/2,u=0;for(let f of e)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:pX(u,t.capacityValue,t.warnFraction,t.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:t.capacityValue,warnFraction:t.warnFraction,overFraction:t.overFraction}}function pX(t,e,r,n){let i=t/e;return n!==null&&i>=n?\"red\":r!==null&&i>=r?\"yellow\":\"green\"}function aC(t,e){let r=e.get(\"swimlane\"),n=iC(fe(t.properties,\"utilization-warn-at\"),r?fe(r.properties,\"utilization-warn-at\"):void 0,lX),i=iC(fe(t.properties,\"utilization-over-at\"),r?fe(r.properties,\"utilization-over-at\"):void 0,uX);return{warn:n,over:i}}function iC(t,e,r){let i=gX(t??e);return i.kind===\"unset\"?r:i.kind===\"none\"?null:i.value}var hX=/^\\d+(?:\\.\\d+)?%$/,mX=/^\\d+\\.\\d+$/;function gX(t){if(t===void 0)return{kind:\"unset\"};if(t===\"none\")return{kind:\"none\"};if(hX.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:\"number\",value:e}:{kind:\"unset\"}}if(mX.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:\"number\",value:e}:{kind:\"unset\"}}return{kind:\"unset\"}}var cC=10;function yX(t,e,r){let n=fe(t.properties,\"capacity\"),i=ri(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=wc(i),s=bc(e.capacityIcon,r),a=Zi(o,s,cC);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var xX=10,TX=38,wX=8;function bX(t,e,r){let n=t.title??t.name??\"\";if(!n)return 0;let i=fe(t.properties,\"owner\");return _c(0,n,i??void 0,e,r).rightX}function _X(t,e){if(!t.name)return[];let r=[];for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t.name)){let o=e.footnoteIndex.get(n);o!==void 0&&r.push(o)}return r.sort((n,i)=>n-i),r}function EX(t,e,r,n){for(let i of t.content){if(i.$type===\"DescriptionDirective\")continue;let o=_r(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var mc=class{constructor(e,r){xe(this,\"input\");xe(this,\"deps\");this.input=e,this.deps=r}get id(){return this.input.lane.name??\"\"}place(e,r){let{lane:n,bandIndex:i}=this.input,{deps:o}=this,s=Et(\"swimlane\",n.properties,r.styleCtx),a=e.x,c=r.bandScale.step(),l=r.currentFlowKey;r.currentFlowKey=`lane:${n.name??i}`;let{capacity:u,badgeWidthPx:f}=yX(n,s,r.symbols),d=_X(n,r),p=d.length>0?o.estimateTextWidth(d.join(\",\"),cC):0,m=bX(n,f,p),w=EX(n,a,r,o),T=!n.title||w===void 0||w>=m+wX,_=e.y+(T?xX:TX),E=new Qa({laneLeftX:a,originY:_,minRowHeight:c,slackCorridors:r.slackCorridors}),b=a,N=[];for(let R of n.content){if(R.$type===\"DescriptionDirective\")continue;if(!_r(R)){let We=R.properties??[],z=o.resolveChildStart(We,b,a,r),{rowIndex:ne,y:ae}=E.placeBlock(),O=o.newCursor(z,ae),Fe=o.sequenceOne(R,O,r);N.push(Fe);let ve=Fe.box.x+Fe.box.width,ke=Math.max(c,O.height);E.commitBlock({rowIndex:ne,placed:Fe,blockHeight:ke,blockEnd:ve}),b=Math.max(b,ve);continue}let D=R.properties,X=o.resolveChildStart(D,b,a,r),A=Xi(D,r.sizes,r.cal),I=Math.max(Or,A*r.timeline.pixelsPerDay),S=X+I,G=R.name??\"\",V=o.predictItemChipExtraHeight(R,r),B=c+V,{rowIndex:K,y:Q}=E.placeItem({childId:G,desiredStart:X,desiredEnd:S,predictedHeight:B}),_e=o.newCursor(X,Q),J=o.sequenceItem(R,_e,r);N.push(J);let ye=J.box.x+J.box.width+Yr;b=Math.max(b,ye);let nt=null;(J.textSpills||J.chipsOutside||J.dotSpills||J.iconSpills||J.footnoteSpills)&&(nt=Math.max(J.decorationsRightX,J.chipsOutside?J.chipsRightX:0)+6),E.commitItem({rowIndex:K,placed:J,logicalEnd:ye,spillReservation:nt,rowHeight:B})}let F=_-e.y,L=Math.max(c+32,F+E.usedHeight()+16),j=Math.max(E.usedRightX(),m),te={x:0,y:e.y,width:r.chartRightX,height:L},oe=fe(n.properties,\"owner\"),Ce;if(oe){let R=r.teams.get(oe),D=r.persons.get(oe);Ce=R?.title??D?.title??oe}let M=u?(()=>{let{warn:R,over:D}=aC(n,r.styleCtx.defaults);return sC({children:N,capacityValue:u.value,warnFraction:R,overFraction:D})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??\"\",box:te,bandIndex:i,children:N,nested:[],style:s,owner:Ce,footnoteIndicators:d,capacity:u,utilization:M},usedHeight:L,usedRightX:j}}};var vX=18,RX=14,AX=14,kX=16,IX=32;function lC(t,e,r,n){let i=r+vX,o=[],s=!0;for(let a of t){s||(i+=kX),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+RX,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:oh(a.content.sizes,e.cal),labels:a.content.labels,teams:a.content.teams,persons:a.content.persons,symbols:a.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:e.timeline,scale:e.scale,calendar:e.calendar,bandScale:e.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:\"\",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:new Map,chartTopY:l,chartBottomY:l,swimlaneBottomY:l,chartRightX:e.chartRightX,nextParallelId:0,nextGroupId:0},f=[],d=l,p=0,m=u.timeline.originX;for(let L of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:j,usedHeight:te,usedRightX:oe}=new mc({lane:L,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(j),d+=te,p++,oe>m&&(m=oe)}let w=d,T=Math.max(e.bandScale.bandwidth(),w-i+AX),_=0,{chromeRightX:E}=Ec(_,c,a.sourcePath),b=Math.max(E,m)+IX,N=Math.min(e.chartRightX-_,b-_),F={x:_,y:i,width:N,height:T};for(let L of f)L.box.width=N;o.push({sourcePath:a.sourcePath,label:c,box:F,nestedSwimlanes:f,style:Et(\"swimlane\",[],e.styleCtx)}),i+=T}return{regions:o,endY:i}}function zh(t,e){let r=[];for(let n of t){let o=e.entityVisualRightX.get(n)??e.entityRightEdges.get(n);if(o===void 0)continue;let s=e.itemSlackAttachY.get(n)??e.entityMidpoints.get(n)?.y??0,a=e.itemFlowKey.get(n)??`marker:${n}`;r.push({ref:n,x:o,y:s,flowKey:a})}return r}function Wh(t){let e=new Map;for(let r of t){let n=e.get(r.flowKey);(!n||r.x>n.x)&&e.set(r.flowKey,r)}return Array.from(e.values())}function uC(t,e,r,n,i,o,s,a){let c=n.length*i*.58*(o?1.05:1),l=t+r+6,u=t-r-6-c,f=l+c<=a,d=u>=s,p=f?\"right\":d?\"left\":\"right\";return{box:{x:p===\"right\"?l:u,y:e-4,width:c,height:12},side:p}}var cb=class{constructor(e,r){xe(this,\"id\");xe(this,\"milestone\");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=Et(\"milestone\",r.properties,e.styleCtx),i=fe(r.properties,\"date\"),o=_t(r.properties,\"after\"),s=kt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p=\"right\",m=!1,w,T=!1;if(s){let E=e.scale.forwardWithinDomain(s);if(E===null)return null;u=E,m=!0;let b=e.markerRowPlacements.get(this.id);b&&(f=b.centerY,d=b.labelBox,p=b.labelSide);let N=zh(o,e),F=Wh(N),L=null;for(let j of F)(!L||j.x>L.x)&&(L=j);L&&L.x>E&&(T=!0,w=[{x:L.x,y:L.y>0?L.y:f}])}else if(o.length>0){let E=zh(o,e),b=Wh(E);b.sort((j,te)=>te.x-j.x);let N=b[0]?.x??e.timeline.originX;u=N,m=!1;let F=uC(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=F.box,p=F.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let L=[];for(let j=1;j<b.length;j++){let te=b[j];te.x<N&&te.y>0&&L.push({x:te.x,y:te.y})}L.length>0&&(w=L)}if(u===null)return null;if(!d){let E=uC(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=E.box,p=E.side}let _={x:u,y:f};return e.entityLeftEdges.set(this.id,_.x),e.entityRightEdges.set(this.id,_.x),e.entityMidpoints.set(this.id,_),{id:this.id,title:l,center:_,radius:c,fixed:m,slackArrows:w,isOverrun:T,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function fC(t,e){let r=[];for(let[n,i]of t){let o=new cb(n,i).place(e);o&&r.push(o)}return r}var NX=4;function CX(t,e){e>t.chartRightX&&(t.chartRightX=e)}var Vh=class{place(e,r,n,i){let o=n.theme??\"light\",s=DS[o],a=n.width??1280,c=ES(n.locale,LX(e)),l=xS(e,r.config.calendar),u=JN(e,r.config.scale),f=oh(r.content.sizes,l),d={theme:s,styles:r.config.styles,defaults:r.config.defaults,labels:r.content.labels},{startDate:p,endDate:m}=i.computeDateWindow(e,{cal:l,sizes:f},r,n.today,u),w=Et(\"roadmap\",e.roadmapDecl?.properties??[],d),T=w.headerPosition===\"beside\",_=w.timelinePosition!==\"bottom\",E=w.timelinePosition===\"bottom\"||w.timelinePosition===\"both\",b=e.roadmapDecl?.title??e.roadmapDecl?.name??\"\",N=fe(e.roadmapDecl?.properties??[],\"author\"),F=i.sizeBesideHeader(b,N),L=T?{x:0,y:0,width:F.boxWidth,height:0}:{x:0,y:0,width:0,height:xh},j=T?F.boxWidth:0,te=T?8:xh+8,oe=eC(l),Ce=u.pixelsPerUnit/oe.daysPerUnit(u.unit),R=Math.max(1,Pr(p,m))*Ce,D=j+Kr,X=R,A=j+Kr+X+Kr,I=Math.min(a,A),S=n.today!==void 0&&n.today>=p&&n.today<=m,G=r.content.anchors.size+r.content.milestones.size>0,V=S?Gi:0,B=_?Su:0,K=new Bh({domain:[p,m],range:[D,D+R],calendar:oe}),Q=Math.max(I,D+X+Kr),_e=[];for(let[ee,he]of r.content.anchors){let Qe=kt(fe(he.properties,\"date\"));if(!Qe)continue;let Lr=K.forwardWithinDomain(Qe);Lr!==null&&_e.push({id:ee,centerX:Lr,radius:6,title:he.title??ee,fontSize:10,bold:!1,date:Qe,isMilestone:!1})}for(let[ee,he]of r.content.milestones){let Qe=kt(fe(he.properties,\"date\"));if(!Qe)continue;let Lr=K.forwardWithinDomain(Qe);Lr!==null&&_e.push({id:ee,centerX:Lr,radius:6,title:he.title??ee,fontSize:10,bold:!0,date:Qe,isMilestone:!0})}let J=pC(_e,j,Q,i.estimateTextWidth),ye=G?Math.max(1,J.rowCount):0,nt=ye*26,Le=V+B+nt,We=Le+8,z=T?F.cardHeight+NX:0,ne=Math.max(te,z-Le),ae=ne+V,O=ae+B,Fe=O+nt,ve=QN(K,u,oe,c),ke={box:{x:D,y:ne,width:R,height:0},ticks:ve,pixelsPerDay:Ce,originX:D,startDate:p,endDate:m,labelStyle:Et(\"roadmap\",[],d),pillRowHeight:V,tickPanelY:ae,tickPanelHeight:B,markerRow:{y:O+13,height:nt,collisionY:O-8},minorGrid:w.minorGrid},Ze=new Map;for(let[ee,he]of J.placements){let Qe=O+13+he.rowIndex*26;Ze.set(ee,{rowIndex:he.rowIndex,centerY:Qe,labelBox:{...he.labelBox,y:Qe-4},labelSide:he.labelSide})}let H={cal:l,styleCtx:d,sizes:f,labels:r.content.labels,teams:r.content.teams,persons:r.content.persons,symbols:r.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:ke,scale:K,calendar:oe,bandScale:ZN(),entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:\"\",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:Ze,chartTopY:ne+We,chartBottomY:0,swimlaneBottomY:0,chartRightX:Q,nextParallelId:0,nextGroupId:0};for(let ee of _e){let he=Ze.get(ee.id);he&&(H.entityLeftEdges.set(ee.id,ee.centerX),H.entityRightEdges.set(ee.id,ee.centerX),H.entityMidpoints.set(ee.id,{x:ee.centerX,y:he.centerY}))}let Vt=ab(r.content.footnotes,H,0);H.footnoteIndex=Vt.index,H.footnoteHosts=Vt.hosts;let Bt=new Map(H.entityLeftEdges),nr=new Map(H.entityRightEdges),en=new Map(H.entityMidpoints),Re=[...r.content.swimlanes.values()],x=Et(\"swimlane\",[],d),C=FS[x.spacing]??0,U=()=>{H.nextParallelId=0,H.nextGroupId=0;let ee=[],he=H.chartTopY,Qe=0,Lr=H.timeline.originX;for(let Ki of Re){Qe>0&&(he+=C);let{positioned:ei,usedHeight:nm,usedRightX:Qu}=new mc({lane:Ki,bandIndex:Qe},i).place({x:H.timeline.originX,y:he},H);ee.push(ei),he+=nm,Qu>Lr&&(Lr=Qu),Qe++}return{swimlanes:ee,nextY:he,maxRightX:Lr}},Z=U(),re=Z.swimlanes,q=Z.nextY,g=PX(r.content.milestones,H);g.length>0&&(H.entityLeftEdges=new Map(Bt),H.entityRightEdges=new Map(nr),H.entityMidpoints=new Map(en),H.itemSlackAttachY=new Map,H.entityVisualLeftX=new Map,H.entityVisualRightX=new Map,H.itemArrowSource=new Map,H.itemFlowKey=new Map,H.currentFlowKey=\"\",H.slackCorridors=g,Z=U(),re=Z.swimlanes,q=Z.nextY),CX(H,Z.maxRightX+Kr);for(let ee of re)ee.box.width=H.chartRightX;let k=r.content.isolatedRegions,$=[];if(k.length>0){let ee=lC(k,H,q+8,i);$=ee.regions,q=ee.endY}H.chartBottomY=q,H.swimlaneBottomY=q,ke.box.height=H.chartBottomY-ke.box.y;let Y=fC(r.content.milestones,H),Ee=_e.map(ee=>({id:ee.id,centerX:ee.centerX,radius:ee.radius,title:ee.title,fontSize:ee.fontSize,bold:ee.bold}));for(let ee of Y)ee.fixed||Ee.push({id:ee.id??\"\",centerX:ee.center.x,radius:ee.radius,title:ee.title,fontSize:10,bold:!0});let Ie=pC(Ee,j,H.chartRightX,i.estimateTextWidth);H.markerRowPlacements.clear();for(let[ee,he]of Ie.placements){let Qe=O+13+he.rowIndex*26;H.markerRowPlacements.set(ee,{rowIndex:he.rowIndex,centerY:Qe,labelBox:{...he.labelBox,y:Qe-4},labelSide:he.labelSide})}for(let ee of Y){let he=H.markerRowPlacements.get(ee.id??\"\");he&&(ee.center={x:ee.center.x,y:he.centerY},ee.labelBox=he.labelBox,ee.labelSide=he.labelSide)}for(let ee of _e){let he=H.markerRowPlacements.get(ee.id);he&&H.entityMidpoints.set(ee.id,{x:ee.centerX,y:he.centerY})}for(let ee of Y)ee.fixed||H.entityMidpoints.set(ee.id??\"\",{x:ee.center.x,y:ee.center.y});let Pe=G?Math.max(1,Ie.rowCount):0;if(Pe>ye){let ee=(Pe-ye)*26;H.timeline.markerRow.height=Pe*26,H.timeline.box.height+=ee,H.chartTopY+=ee,H.chartBottomY+=ee,H.swimlaneBottomY+=ee;for(let he of re)lb(he,ee);for(let he of $)OX(he,ee);for(let[he,Qe]of H.entityMidpoints)H.markerRowPlacements.has(he)||H.entityMidpoints.set(he,{x:Qe.x,y:Qe.y+ee});for(let[he,Qe]of H.itemSlackAttachY)H.itemSlackAttachY.set(he,Qe+ee);for(let he of Y)if(he.cutTopY=H.chartTopY,he.cutBottomY=H.swimlaneBottomY,he.slackArrows)for(let Qe of he.slackArrows)Qe.y+=ee}E&&(H.timeline.bottomTickPanelY=H.chartBottomY+8,H.timeline.bottomTickPanelHeight=Su,H.chartBottomY+=8+Su);let qe=new Set(Y.map(ee=>ee.center.x)),Te=nC(r.content.anchors,H,qe),pe=i.collectItems(Re),we=i.buildDependencies(pe,re,$,H),Ue=i.buildNowline(n.today,H,c),it=ab(r.content.footnotes,H,H.chartBottomY);H.footnoteIndex=it.index,H.footnoteHosts=it.hosts,L.height=L.height||H.chartBottomY,T||(L.width=H.chartRightX);let ir=T?{x:6,y:Fe-F.cardHeight,width:F.cardWidth,height:F.cardHeight}:{x:0,y:0,width:H.chartRightX,height:xh},ss=it.area.entries.length>0?it.area.box.y+it.area.box.height:H.chartBottomY,Zu={x:H.chartRightX-Kr-Nw,y:ss+Kr,width:Nw,height:GS},or=Zu.y+Zu.height+Kr,tn={box:L,position:w.headerPosition,title:b,author:N,titleLines:F.titleLines,authorLines:F.authorLines,cardBox:ir,logo:void 0,style:w,attributionBox:Zu};return{width:H.chartRightX,height:or,theme:o,palette:s,backgroundColor:s.surface.page,header:tn,timeline:ke,nowline:Ue,swimlanes:re,anchors:Te,milestones:Y,edges:we,footnotes:it.area,includes:$,chartBox:{x:j,y:H.chartTopY,width:H.chartRightX-j,height:H.chartBottomY-H.chartTopY}}}};function PX(t,e){let r=[];for(let[n,i]of t){let o=fe(i.properties,\"date\"),s=_t(i.properties,\"after\"),a=kt(o),c=zh(s,e),l=Wh(c);if(a){let f=e.scale.forwardWithinDomain(a);if(f===null)continue;let d=null;for(let p of l)(!d||p.x>d.x)&&(d=p);d&&d.x>f&&d.y>0&&r.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:n});continue}if(l.length===0)continue;l.sort((f,d)=>d.x-f.x);let u=l[0].x;for(let f=1;f<l.length;f++){let d=l[f];d.x<u&&d.y>0&&r.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:n})}}return r}function lb(t,e){t.box.y+=e;for(let r of t.children)hC(r,e);for(let r of t.nested)lb(r,e)}function hC(t,e){if(t.box.y+=e,t.kind===\"item\"){t.overflowBox&&(t.overflowBox.y+=e);for(let r of t.labelChips)r.box.y+=e;return}for(let r of t.children)hC(r,e)}function OX(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)lb(r,e)}function pC(t,e,r,n){let i=[...t].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=n(a.title,a.fontSize)*(a.bold?1.05:1),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=r,d=u>=e,p=a.centerX-a.radius,m=a.centerX+a.radius,w=j=>j===\"right\"?l:u,T=j=>j===\"right\"?f:d,_=(j,te)=>{let oe=Math.min(p,j),Ce=Math.max(m,j+c);return s[te].some(M=>M.left<Ce&&M.right>oe)},E=-1,b=\"right\",N=l;e:for(let j=s.length-1;j>=0;j--)for(let te of[\"right\",\"left\"]){if(!T(te))continue;let oe=w(te);if(!_(oe,j)){E=j,b=te,N=oe;break e}}if(E===-1){for(let[j,te]of o)o.set(j,{...te,rowIndex:te.rowIndex+1});s=[[],...s],E=0,b=f?\"right\":\"left\",N=w(b)}let F=Math.min(p,N),L=Math.max(m,N+c);s[E].push({left:F,right:L}),o.set(a.id,{rowIndex:E,labelBox:{x:N,y:0,width:c,height:12},labelSide:b})}return{placements:o,rowCount:s.length}}function LX(t){return t.directive?.properties.find(r=>DX(r.key)===\"locale\")?.value}function DX(t){return t.endsWith(\":\")?t.slice(0,-1):t}function UX(t){switch(t){case\"done\":case\"completed\":return\"done\";case\"in-progress\":case\"active\":return\"in-progress\";case\"at-risk\":case\"blocked\":case\"planned\":return t;case void 0:return\"planned\";default:return\"neutral\"}}function BX(t){if(!t)return 0;let e=/^(\\d{1,3})%$/.exec(t);return e?Math.max(0,Math.min(100,parseInt(e[1],10)))/100:0}function HX(t,e){if(t)return/^\\d+(?:\\.\\d+)?[dwmqy]$/.test(t)||/^\\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function XX(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function GX(t){if(!t)return{icon:\"none\"};let e=t.toLowerCase();return e.includes(\"linear.app\")?{icon:\"linear\",href:t}:e.includes(\"github.com\")?{icon:\"github\",href:t}:e.includes(\"atlassian.net\")||e.includes(\"jira.\")?{icon:\"jira\",href:t}:{icon:\"generic\",href:t}}function Yh(t,e,r,n,i){let o=$S(t,e),s=t.name??t.title??\"\",a=o.padding===\"none\"?\"xs\":o.padding,c=US[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:r,y:n,width:l,height:13}}}function mb(t,e,r,n){let i=t.properties,o=Et(\"item\",i,r.styleCtx),s=fe(i,\"size\"),a=s?r.sizes.get(s)??null:null,c=Xi(i,r.sizes,r.cal),l=wS(i,r.sizes,r.cal),u=_t(i,\"after\"),f=_t(i,\"before\"),d=fe(i,\"date\"),p=TS(fe(i,\"remaining\"),r.sizes,r.cal),m=e.x,w=kt(d);if(w){let me=r.scale.forwardWithinDomain(w);me!==null&&(m=me)}else if(u.length>0){let me=e.x;for(let lt of u){let Rt=kt(lt);if(Rt){let ti=r.scale.forwardWithinDomain(Rt);ti!==null&&(me=Math.max(me,ti));continue}let vn=r.entityRightEdges.get(lt);vn!==void 0&&(me=Math.max(me,vn))}m=Math.max(e.x,me)}let T=Math.max(Or,c*r.timeline.pixelsPerDay),_=m,E=m+T,b=fe(i,\"link\"),N=GX(b),F=N.icon!==\"none\",L=Math.max(Or,T-2*Yr),j=_t(i,\"labels\"),te=[];for(let me of j){let lt=r.labels.get(me);if(!lt)continue;let Rt=Yh(lt,r.styleCtx,0,0);te.push({id:lt,width:Rt.box.width})}let oe=0;for(let me=0;me<te.length;me+=1)me>0&&(oe+=4),oe+=te[me].width;let Ce=Math.max(0,L-24),M=te.length>0&&oe>Ce,R=!1,D,X;if(f.length>0){let me,lt;for(let Rt of f){let vn=kt(Rt),ti=vn?r.scale.forwardWithinDomain(vn)??void 0:r.entityLeftEdges.get(Rt);ti!==void 0&&(me===void 0||ti<me)&&(me=ti,lt=Rt)}me!==void 0&&E>me&&(R=!0,D={x:me,y:e.y,width:E-me,height:r.bandScale.bandwidth()},X=lt)}let A=fe(i,\"status\"),I=UX(A),S=BX(A);S===0&&I===\"done\"&&(S=1);let G=/^(\\d{1,3})%$/.exec(fe(i,\"remaining\")??\"\");S===0&&I===\"in-progress\"&&G&&(S=1-Math.max(0,Math.min(100,parseInt(G[1],10)))/100),S===0&&I===\"in-progress\"&&p>0&&l>0&&(S=Math.max(0,Math.min(1,1-p/l)));let V={done:\"#ecfdf5\",\"in-progress\":\"#eff6ff\",\"at-risk\":\"#fffbeb\",blocked:\"#fee2e2\",planned:\"#f8fafc\",neutral:\"#f8fafc\"},B={done:\"#052e16\",\"in-progress\":\"#172554\",\"at-risk\":\"#422006\",blocked:\"#7f1d1d\",planned:\"#1e293b\",neutral:\"#1e293b\"},K={done:\"#ebebeb\",\"in-progress\":\"#e4e4e4\",\"at-risk\":\"#eeeeee\",blocked:\"#dcdcdc\",planned:\"#f5f5f5\",neutral:\"#f5f5f5\"},Q={done:r.styleCtx.theme.status.done,\"in-progress\":r.styleCtx.theme.status.inProgress,\"at-risk\":r.styleCtx.theme.status.atRisk,blocked:r.styleCtx.theme.status.blocked,planned:r.styleCtx.theme.status.planned,neutral:r.styleCtx.theme.status.neutral},_e=r.styleCtx.theme.name,J=_e===\"dark\",ye=J?\"#0f172a\":\"#ffffff\",nt=_e===\"grayscale\"?\"#9e9e9e\":\"#94a3b8\";o.bg===ye&&(o.bg=_e===\"grayscale\"?K[I]:J?B[I]:V[I]),o.fg===nt&&(o.fg=Q[I]);let Le=fe(i,\"duration\"),We=!!Le&&/^\\d+(?:\\.\\d+)?[dwmqy]$/.test(Le),z=a?a.title??a.name:\"\",ne=We?Le:z||void 0,ae=fe(i,\"remaining\"),O=HX(ae,r),Fe=XX(n??fe(i,\"owner\"),r),ve=()=>[ne,Fe].filter(Boolean).join(\" \"),ke;if(I===\"in-progress\"&&O){let me=ve();ke=me?`${me} \\u2014 ${O} remaining`:`${O} remaining`}else if(I===\"in-progress\"&&S>0&&S<1){let me=Math.round((1-S)*100),lt=ve();ke=lt?`${lt} \\u2014 ${me}% remaining`:`${me}% remaining`}else(Fe||ne)&&(ke=ve()||void 0);let Ze=fe(i,\"capacity\"),H=ri(Ze),Vt=null,Bt=0;if(H!==null){let me=wc(H),lt=bc(o.capacityIcon,r.symbols);Vt={value:H,text:me,icon:lt};let Rt=11;Bt=(ke?En(\" \",Rt):0)+Zi(me,lt,Rt)}let nr=t.title??t.name??\"\",en=new Eh({id:t.name??\"\",title:nr,logicalLeftX:_,logicalRightX:E,metaText:ke,metaTrailingWidth:Bt,hasLinkIcon:F}).place({x:_,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),Re=en.box,x=r.bandScale.bandwidth(),C=Re.width<17,U=F&&Re.width<41,Z=Re.width<23,re=en.textSpills||U,q=null;M&&(q=sm(te,Re.width));let g=q?q.rows.length:te.length>0?1:0,k=ke!==void 0||Vt!==null,$=wC(M,re,g,x,k);$>0&&(Re.height=x+$);let Y=[],Ee=Re.y+x-Tn-13-3,Ie=Re.y+38+3,qe=M&&re||!M&&k&&te.length>0?Math.max(Ee,Ie):Ee,Te=M?Re.x+Re.width+6:Re.x+12,pe=Te;if(q)for(let me=0;me<q.rows.length;me+=1){let lt=qe+me*17,Rt=Te;for(let ti of q.rows[me]){let Cb=Yh(ti.id,r.styleCtx,Rt,lt);Y.push(Cb),Rt+=Cb.box.width+4}let vn=Rt-4;vn>pe&&(pe=vn)}else{let me=Te;for(let lt of te){let Rt=Yh(lt.id,r.styleCtx,me,qe);Y.push(Rt),me+=Rt.box.width+4}pe=te.length>0?me-4:Te}let we=new Set;if(t.name){for(let[me,lt]of r.footnoteHosts.entries())if(lt.includes(t.name)){let Rt=r.footnoteIndex.get(me);Rt!==void 0&&we.add(Rt)}}let Ue=[...we].sort((me,lt)=>me-lt),it=Fe??n??fe(i,\"owner\"),ir=t.description?.text,ss=Ue.length>0&&Z,or=Re.x+Re.width+6,tn=!1,Ju=null;U&&(tn&&(or+=4),Ju=or,or=Ju+14,tn=!0);let ee=0;if(re){tn&&(or+=4);let me=En(nr,13),lt=(ke?En(ke,11):0)+Bt;ee=Math.max(me,lt),or+=ee,tn=!0}let he=null;ss&&(tn&&(or+=4),he=or,or+=Ue.length*8,tn=!0);let Qe=null;C&&(tn&&(or+=4),Qe=or+5,or=Qe+5,tn=!0);let Lr=Math.max(Re.x+Re.width,or),Ki=t.name;Ki&&(r.entityLeftEdges.set(Ki,_),r.entityRightEdges.set(Ki,E));let ei=Ki??TC(t);r.entityMidpoints.set(ei,{x:(_+E)/2,y:Re.y+Re.height/2}),r.entityVisualLeftX.set(ei,Re.x),r.entityVisualRightX.set(ei,Re.x+Re.width);let nm=re?{x:Re.x+Re.width,y:Re.y+Re.height-Tn/2}:{x:Re.x+Re.width,y:Re.y+Re.height/2};r.itemArrowSource.set(ei,nm),r.itemFlowKey.set(ei,r.currentFlowKey);let Qu=re?Re.y+Re.height-Tn/2:Re.y+Re.height/2;r.itemSlackAttachY.set(ei,Qu),e.x=E,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+$);let Nb=kS({box:Re,afterDate:qn(u),beforeDate:qn(f),hasLinkIcon:F,footnoteCount:Ue.length});return{kind:\"item\",id:Ki,title:nr,box:Re,status:I,progressFraction:S,footnoteIndicators:Ue,labelChips:Y,chipsOutside:M,chipsRightX:pe,linkIcon:N.icon,linkHref:N.href,hasOverflow:R,overflowBox:D,overflowAnchorId:X,owner:it,description:ir,metaText:ke,textSpills:re,dotSpills:C,iconSpills:U,footnoteSpills:ss,dotSpillCx:Qe,iconSpillX:Ju,footnoteSpillStartX:he,decorationsRightX:Lr,capacity:Vt,size:a,style:o,inlineDatePins:Nb.length>0?Nb:void 0}}function jX(t,e,r){return new vh(t,{sequenceOne:gb,newCursor:uh}).place(e,r)}function zX(t,e,r){return new _h(t,{sequenceItem:mb,sequenceOne:gb,resolveChildStart:_C,newCursor:uh,estimateTextWidth:En,predictItemChipExtraHeight:bC}).place(e,r)}function gb(t,e,r){if(_r(t))return mb(t,e,r);if(qr(t))return jX(t,e,r);if(Wr(t))return zX(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??\"unknown\"}`)}function En(t,e){return t.length*e*.58}function TC(t){let e=t.$cstNode?.range.start;return`#item@${e?e.line+1:0}:${e?e.character+1:0}`}function wC(t,e,r,n,i){if(r===0)return 0;let o=n-Tn-13-3,s=41,a;t&&e?a=s:!t&&i?a=Math.max(o,s):a=o;let l=a+(r-1)*17+13+3+Tn;return Math.max(0,l-n)}function bC(t,e){let r=t.properties,n=_t(r,\"labels\");if(n.length===0)return 0;let i=Xi(r,e.sizes,e.cal),o=Math.max(Or,i*e.timeline.pixelsPerDay),s=Math.max(Or,o-2*Yr),a=[];for(let _ of n){let E=e.labels.get(_);if(!E)continue;let b=Yh(E,e.styleCtx,0,0);a.push({id:E,width:b.box.width})}if(a.length===0)return 0;let c=0;for(let _=0;_<a.length;_+=1)_>0&&(c+=4),c+=a[_].width;let l=Math.max(0,s-24),u=c>l,f=fe(r,\"duration\")!==void 0||fe(r,\"size\")!==void 0||fe(r,\"owner\")!==void 0||fe(r,\"remaining\")!==void 0||fe(r,\"capacity\")!==void 0,d=t.title??t.name??\"\",m=(d?En(d,13):0)>l,w=u?sm(a,s):null,T=w?w.rows.length:a.length>0?1:0;return wC(u,m,T,e.bandScale.bandwidth(),f)}function _C(t,e,r,n){let i=kt(fe(t,\"date\"))??kt(fe(t,\"start\"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=_t(t,\"after\");if(o.length>0){let s=r;for(let a of o){let c=kt(a);if(c){let u=n.scale.forwardWithinDomain(c);u!==null&&(s=Math.max(s,u));continue}let l=n.entityRightEdges.get(a);l!==void 0&&(s=Math.max(s,l))}return Math.max(r,s)}return e}var ub=6;function mC(t,e,r){if(!t)return[];let n=t.split(/\\s+/).filter(s=>s.length>0);if(n.length===0)return[];let i=[],o=\"\";for(let s of n){let a=o?`${o} ${s}`:s;o&&En(a,r)>e?(i.push(o),o=s):o=a}return o&&i.push(o),i}function WX(t,e){let r=Rw-32,n=mC(t,r,16),i=mC(e??\"\",r,11),o=0;for(let d of n)o=Math.max(o,En(d,16));for(let d of i)o=Math.max(o,En(d,11));let s=o+32,a=Math.max(HS-ub,Math.min(Rw-ub,s)),c=n.length>0?(n.length-1)*20:0,l=i.length>0?18+(i.length-1)*14:0,u=26+c+l+14,f=a+ub;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function qX(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=fe(s,\"start\"),c=kt(a)??VX(n),l=fe(s,\"length\");if(l){let p=YX(l,e.cal);if(p>0)return{startDate:c,endDate:qo(c,p)}}let u=EC(r,e,c,n),f=tC(i.unit,e.cal),d=u>0?Math.ceil(u/f)*f:4*e.cal.daysPerWeek;return{startDate:c,endDate:qo(c,Math.max(1,d))}}function VX(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function YX(t,e){let r=/^(\\d+(?:\\.\\d+)?)([dwmqy])$/.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case\"d\":return n;case\"w\":return n*e.daysPerWeek;case\"m\":return n*e.daysPerMonth;case\"q\":return n*e.daysPerQuarter;case\"y\":return n*e.daysPerYear;default:return 0}}function EC(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=kt(f);return d?Pr(r,d):i.has(f)?i.get(f):o.has(f)?o.get(f):s.has(f)?s.get(f):0};for(let f of t.content.anchors.values()){let d=kt(fe(f.properties,\"date\"));if(d&&f.name){let p=Pr(r,d);o.set(f.name,p),a=Math.max(a,p)}}let l=(f,d)=>{let p=d;for(let m of f)m.$type!==\"DescriptionDirective\"&&(p=u(m,p),a=Math.max(a,p));return p},u=(f,d)=>{if(_r(f)){let p=Xi(f.properties,e.sizes,e.cal),m=kt(fe(f.properties,\"date\")),w=kt(fe(f.properties,\"start\")),T=_t(f.properties,\"after\"),_=d;m?_=Pr(r,m):w?_=Pr(r,w):T.length>0&&(_=Math.max(d,...T.map(c)));let E=_+p;return f.name&&i.set(f.name,E),E}if(qr(f)){let p=_t(f.properties,\"after\"),m=p.length>0?Math.max(d,...p.map(c)):d,w=m;for(let T of f.content){if(T.$type===\"DescriptionDirective\")continue;let _=u(T,m);w=Math.max(w,_)}return w}if(Wr(f)){let p=_t(f.properties,\"after\"),m=p.length>0?Math.max(d,...p.map(c)):d;return l(f.content,m)}return d};for(let f of t.content.swimlanes.values())l(f.content,0);for(let f of t.content.milestones.values()){let d=kt(fe(f.properties,\"date\"));if(d){let m=Pr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=_t(f.properties,\"after\");if(p.length>0){let m=Math.max(0,...p.map(c));f.name&&s.set(f.name,m),a=Math.max(a,m)}}for(let f of t.content.isolatedRegions){let d=EC({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=Pr(r,n);f>0&&(a=Math.max(a,f))}return a}function KX(t,e,r,n){let i=new sh(bS(e,r)),o=[],s=[];for(let[l,u]of t){let f=_t(u.properties,\"after\"),d=n.entityMidpoints.get(l),p=n.entityVisualLeftX.get(l);if(!d||p===void 0)continue;let m={x:p,y:d.y};for(let w of f){let T=n.itemArrowSource.get(w),_,E=T===void 0;if(T)_=T;else{let b=n.entityMidpoints.get(w);if(!b)continue;_={x:b.x,y:d.y}}!E&&Math.abs(_.y-m.y)<.5&&m.x-_.x<20||(o.push({fromId:w,toId:l,from:_,to:m,isMarkerSource:E}),s.push({fromId:w,toId:l}))}}let a=_S(o,i),c=[];for(let l=0;l<a.length;l++){let u=a[l];c.push({fromId:s[l].fromId,toId:s[l].toId,waypoints:u.waypoints,kind:u.underBar?\"underBar\":\"normal\",style:Et(\"item\",[],n.styleCtx)})}return c}function ZX(t,e,r){if(!t)return null;let n=e.scale.forwardWithinDomain(t);if(n===null)return null;let i=e.timeline.box.y,o=e.timeline.tickPanelY,s=ah(r).nowLabel,a=En(s,Pu),c=Math.max(_w,Math.ceil(a+2*nc)),l=e.timeline.originX-Kr,u=c/2,f;n-u<l?f=\"flag-right\":n+u>e.chartRightX?f=\"flag-left\":f=\"center\";let d=e.timeline.bottomTickPanelY,p=e.timeline.bottomTickPanelHeight??0,m=d!==void 0&&p>0?d+p:e.swimlaneBottomY;return{x:n,topY:o,bottomY:m,pillTopY:i,pillMode:f,label:s,pillWidth:c,style:Et(\"item\",[],e.styleCtx)}}function JX(t){let e=new Map,r=n=>{if(_r(n)){e.set(n.name??TC(n),n);return}if(qr(n)){for(let i of n.content)i.$type!==\"DescriptionDirective\"&&r(i);return}if(Wr(n)){for(let i of n.content)i.$type!==\"DescriptionDirective\"&&r(i);return}};for(let n of t)for(let i of n.content)i.$type!==\"DescriptionDirective\"&&r(i);return e}function yb(t,e,r={}){return new Vh().place(t,e,r,{sequenceItem:mb,sequenceOne:gb,resolveChildStart:_C,newCursor:uh,estimateTextWidth:En,predictItemChipExtraHeight:bC,computeDateWindow:qX,sizeBesideHeader:WX,collectItems:JX,buildDependencies:KX,buildNowline:ZX})}var os=class extends Error{constructor(e){super(e),this.name=\"TimezoneError\"}};function xb(t){if(!t||t.toLowerCase()===\"local\")return{kind:\"local\"};if(t.toUpperCase()===\"UTC\")return{kind:\"utc\"};if(t===\"Z\")return{kind:\"offset\",ms:0};let e=/^([+-])(\\d{2})(?::?(\\d{2}))?$/.exec(t);if(e){let r=e[1]===\"+\"?1:-1,n=parseInt(e[2],10),i=e[3]!==void 0?parseInt(e[3],10):0;if(n>23||i>59)throw new os(`nowline: invalid timezone offset \"${t}\". Hours must be 0\\u201323 and minutes 0\\u201359.`);return{kind:\"offset\",ms:r*(n*60+i)*6e4}}try{return{kind:\"iana\",name:Intl.DateTimeFormat(void 0,{timeZone:t}).resolvedOptions().timeZone}}catch{throw new os(`nowline: unrecognised timezone \"${t}\". Use \"local\", \"UTC\", an ISO 8601 offset (e.g. \"+05:30\", \"-07:00\", \"Z\"), or an IANA timezone name (e.g. \"America/Los_Angeles\", \"Asia/Kolkata\").`)}}function em(t,e){switch(e.kind){case\"local\":return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));case\"utc\":return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));case\"offset\":{let r=new Date(t.getTime()+e.ms);return new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))}case\"iana\":{let r=new Intl.DateTimeFormat(\"en-CA\",{timeZone:e.name,year:\"numeric\",month:\"2-digit\",day:\"2-digit\"}).formatToParts(t),n=0,i=0,o=0;for(let s of r)s.type===\"year\"?n=parseInt(s.value,10):s.type===\"month\"?i=parseInt(s.value,10)-1:s.type===\"day\"&&(o=parseInt(s.value,10));return new Date(Date.UTC(n,i,o))}}}var QX=/^(\\d{4})-(\\d{2})-(\\d{2})$/,eG=/^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?)(Z|([+-])(\\d{2})(?::?(\\d{2}))?)$/,tG=/^(\\d{4})-(\\d{2})-(\\d{2})T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?$/;function Tb(t={}){let e=t.zone??{kind:\"local\"},r=t.clock??(()=>new Date),n=t.now;if(!(n===\"-\"||n===null)){if(n instanceof Date)return n;if(n!==void 0){let i=QX.exec(n);if(i)return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10)));let o=eG.exec(n);if(o){let a=new Date(n);if(!Number.isNaN(a.getTime())){if(o[2]===\"Z\")return em(a,{kind:\"utc\"});let l=o[3]===\"+\"?1:-1,u=parseInt(o[4],10),f=o[5]!==void 0?parseInt(o[5],10):0,d=l*(u*60+f)*6e4;return em(a,{kind:\"offset\",ms:d})}}let s=tG.exec(n);return s?new Date(Date.UTC(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))):void 0}return em(r(),e)}}function vC(t,e){return{severity:t.severity===2?\"warning\":\"error\",code:lm(t),message:t.message,suggestion:cm(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function RC(t,e){return{severity:\"error\",code:\"parse-error\",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function AC(t,e){return{severity:\"error\",code:\"lex-error\",message:t.message,file:e,line:t.line??1,column:t.column??1}}function kC(t){return{severity:t.severity,code:\"include\",message:t.message,file:t.sourcePath,line:t.line!==void 0?t.line+1:1,column:1}}function IC(t,e,r=\"warning\"){return{severity:r,code:\"render.warning\",message:t,file:e,line:1,column:1}}var SC=\"__nowline_browser_noop_include__\";async function NC(t){throw new Error(`${SC}: include \"${t}\" was skipped \\u2014 running in single-file mode.`)}function CC(t){return t.includes(SC)}var Yi={person:{viewBox:\"0 0 24 24\",body:'<circle cx=\"12\" cy=\"8\" r=\"4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M4 21a8 8 0 0 1 16 0\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>',ascii:\"p\"},people:{viewBox:\"0 0 24 24\",body:'<path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle cx=\"9\" cy=\"7\" r=\"4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M16 3.13a4 4 0 0 1 0 7.75\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>',ascii:\"P\"},points:{viewBox:\"0 0 24 24\",body:'<polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linejoin=\"round\"/>',ascii:\"*\"},time:{viewBox:\"0 0 24 24\",body:'<line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle cx=\"12\" cy=\"14\" r=\"8\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>',ascii:\"t\"}},rG={calendar:{viewBox:\"0 0 24 24\",body:'<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><line x1=\"16\" x2=\"16\" y1=\"2\" y2=\"6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><line x1=\"3\" x2=\"21\" y1=\"10\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>',ascii:\"d\"}},PC={...Yi,...rG};var Noe={none:\"\",multiplier:\"x\",person:Yi.person.ascii,people:Yi.people.ascii,points:Yi.points.ascii,time:Yi.time.ascii};var tm=class{constructor(e=\"nl\"){xe(this,\"prefix\");xe(this,\"counter\",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var nG=new Set([\"svg\",\"g\",\"defs\",\"symbol\",\"use\",\"path\",\"rect\",\"circle\",\"ellipse\",\"line\",\"polyline\",\"polygon\",\"text\",\"tspan\",\"title\",\"desc\",\"linearGradient\",\"radialGradient\",\"stop\",\"clipPath\",\"mask\",\"pattern\",\"filter\",\"feGaussianBlur\",\"feColorMatrix\",\"feOffset\",\"feMerge\",\"feMergeNode\",\"feFlood\",\"feComposite\",\"feBlend\",\"feDropShadow\",\"image\"]),iG=new Set([\"d\",\"x\",\"y\",\"x1\",\"y1\",\"x2\",\"y2\",\"cx\",\"cy\",\"r\",\"rx\",\"ry\",\"width\",\"height\",\"viewBox\",\"preserveAspectRatio\",\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-opacity\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-dasharray\",\"stroke-dashoffset\",\"opacity\",\"transform\",\"points\",\"id\",\"class\",\"clip-path\",\"mask\",\"filter\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"text-anchor\",\"dx\",\"dy\",\"rotate\",\"letter-spacing\",\"word-spacing\",\"style\",\"xmlns\",\"href\",\"xlink:href\",\"offset\",\"stop-color\",\"stop-opacity\",\"gradientUnits\",\"gradientTransform\",\"spreadMethod\",\"maskUnits\",\"maskContentUnits\",\"stdDeviation\",\"values\",\"in\",\"in2\",\"mode\",\"type\",\"result\",\"flood-color\",\"flood-opacity\",\"patternUnits\",\"patternContentUnits\",\"role\",\"aria-label\"]);function oG(t){let e=[],r=0,n=t.length;for(;r<n;){if(t[r]!==\"<\"){let u=r;for(;r<n&&t[r]!==\"<\";)r++;let f=t.slice(u,r);f.trim().length>0?e.push({kind:\"text\",text:f}):f.length>0&&e.push({kind:\"text\",text:f});continue}if(t.startsWith(\"<!--\",r)){let u=t.indexOf(\"-->\",r+4);if(u<0)break;e.push({kind:\"comment\",text:t.slice(r+4,u)}),r=u+3;continue}if(t.startsWith(\"<![CDATA[\",r)){let u=t.indexOf(\"]]>\",r+9);if(u<0)break;e.push({kind:\"cdata\",text:t.slice(r+9,u)}),r=u+3;continue}if(t.startsWith(\"<?\",r)){let u=t.indexOf(\"?>\",r+2);if(u<0)break;e.push({kind:\"decl\",text:t.slice(r+2,u)}),r=u+2;continue}if(t.startsWith(\"<!\",r)){let u=t.indexOf(\">\",r+2);if(u<0)break;e.push({kind:\"decl\",text:t.slice(r+2,u)}),r=u+1;continue}if(t[r+1]===\"/\"){let u=t.indexOf(\">\",r+2);if(u<0)break;let f=t.slice(r+2,u).trim();e.push({kind:\"close\",name:f}),r=u+1;continue}let i=sG(t,r);if(i<0)break;let o=t.slice(r+1,i).trim(),s=o.endsWith(\"/\"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=aG(a);e.push({kind:s?\"self\":\"open\",name:c,attrs:l}),r=i+1}return e}function sG(t,e){let r=e+1,n=null;for(;r<t.length;){let i=t[r];if(n)i===n&&(n=null);else if(i==='\"'||i===\"'\")n=i;else if(i===\">\")return r;r++}return-1}function aG(t){let e=0;for(;e<t.length&&/\\s/.test(t[e]);)e++;let r=e;for(;e<t.length&&!/\\s/.test(t[e]);)e++;let n=t.slice(r,e),i={};for(;e<t.length;){for(;e<t.length&&/\\s/.test(t[e]);)e++;if(e>=t.length)break;let o=e;for(;e<t.length&&t[e]!==\"=\"&&!/\\s/.test(t[e]);)e++;let s=t.slice(o,e);if(e>=t.length||t[e]!==\"=\"){s&&(i[s]=\"\");continue}if(e++,e>=t.length)break;let a=t[e];if(a!=='\"'&&a!==\"'\"){let l=e;for(;e<t.length&&!/\\s/.test(t[e]);)e++;i[s]=t.slice(l,e);continue}e++;let c=e;for(;e<t.length&&t[e]!==a;)e++;i[s]=t.slice(c,e),e<t.length&&e++}return{name:n,attrs:i}}function Ku(t){return t.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\")}function cG(t,e){if(t.startsWith(\"#\")){let r=e.get(t.slice(1));return r?`#${r}`:null}if(/^url\\(#[^)]+\\)$/.test(t)){let r=t.slice(5,-1),n=e.get(r);return n?`url(#${n})`:null}return null}function OC(t,e={}){let r=e.idPrefix??\"nl-logo\",n=e.onWarn??(()=>{}),i=oG(t),o=new Map,s=0;for(let l of i)if((l.kind===\"open\"||l.kind===\"self\")&&l.attrs&&\"id\"in l.attrs){let u=l.attrs.id;u&&!o.has(u)&&o.set(u,`${r}-${s++}`)}let a=[],c=[];for(let l of i)if(l.kind!==\"comment\"&&l.kind!==\"decl\"){if(l.kind===\"cdata\"){c[c.length-1]&&a.push(Ku(l.text??\"\"));continue}if(l.kind===\"text\"){if(c.length===0||c[c.length-1]){let u=(l.text??\"\").replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\");a.push(u)}continue}if(l.kind===\"open\"||l.kind===\"self\"){let u=l.name??\"\";if(u===\"script\"||u===\"foreignObject\"||u===\"animate\"||u===\"animateTransform\"||u===\"animateMotion\"||u===\"set\"){n(`sanitizer: dropping <${u}>`),l.kind===\"open\"&&c.push(!1);continue}if(!nG.has(u)){n(`sanitizer: dropping unknown element <${u}>`),l.kind===\"open\"&&c.push(!1);continue}let f=[`<${u}`],d=Object.keys(l.attrs??{}).sort();for(let p of d){let m=l.attrs[p];if(/^on/i.test(p)){n(`sanitizer: dropping event handler ${p}`);continue}if(!iG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p===\"href\"||p===\"xlink:href\"){let w=cG(m,o);if(w===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}=\"${Ku(w)}\"`);continue}if(p===\"style\"){n(\"sanitizer: dropping inline style\");continue}if(p===\"id\"){let w=o.get(m);w&&f.push(` id=\"${Ku(w)}\"`);continue}if(/\\burl\\(#/i.test(m)){let w=m.replace(/url\\(#([^)]+)\\)/gi,(T,_)=>{let E=o.get(_);return E?`url(#${E})`:\"none\"});f.push(` ${p}=\"${Ku(w)}\"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}=\"${Ku(m)}\"`)}f.push(l.kind===\"self\"?\"/>\":\">\"),a.push(f.join(\"\")),l.kind===\"open\"&&c.push(!0);continue}l.kind===\"close\"&&c.pop()&&a.push(`</${l.name}>`)}return a.join(\"\")}var LC=/&/g,DC=/</g,MC=/>/g,lG=/\"/g,uG=/'/g;function hr(t){return t.replace(LC,\"&\").replace(DC,\"<\").replace(MC,\">\")}function Qn(t){return t.replace(LC,\"&\").replace(DC,\"<\").replace(MC,\">\").replace(lG,\""\").replace(uG,\"'\")}function xc(t){let e=Object.keys(t).sort(),r=[];for(let n of e){let i=t[n];i==null||i===!1||(i===!0?r.push(n):r.push(`${n}=\"${Qn(String(i))}\"`))}return r.length?` ${r.join(\" \")}`:\"\"}function ie(t,e,r){return r===void 0||r===\"\"?`<${t}${xc(e)}/>`:`<${t}${xc(e)}>${r}</${t}>`}function je(t,e){return`<text${xc(t)}>${hr(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():\"0\"}var fG={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function dG(t,e){let r=`${t}-shadow-${e}`,n=fG[e],i=`<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"${n.stdDeviation}\"/><feOffset dx=\"${n.dx}\" dy=\"${n.dy}\" result=\"offsetblur\"/><feComponentTransfer><feFuncA type=\"linear\" slope=\"${n.opacity}\"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge>`;return ie(\"filter\",{id:r,x:\"-50%\",y:\"-50%\",width:\"200%\",height:\"200%\"},i)}function $C(t,e){return e===\"none\"?null:`url(#${t}-shadow-${e})`}function FC(t){return[\"subtle\",\"soft\",\"hard\"].map(e=>dG(t,e)).join(\"\")}var yG={thin:100,light:300,normal:400,bold:700};function xG(t){return tc[t]??14}function bb(t,e,r){return{\"font-family\":e[t.font],\"font-size\":r??xG(t.textSize),\"font-weight\":yG[t.weight]??400,\"font-style\":t.italic?\"italic\":\"normal\",fill:t.text}}function TG(t){if(t.border===\"dashed\")return\"4 3\";if(t.border===\"dotted\")return\"1 3\"}function wG(t){if(!t||t===\"none\"||t===\"transparent\")return 1;let e=t.startsWith(\"#\")?t.slice(1):t;if(e.length===3&&(e=e.split(\"\").map(s=>s+s).join(\"\")),e.length!==6)return 1;let r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(r)+.7152*o(n)+.0722*o(i)}function bG(t,e){return wG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function wb(t,e){return t.length*e*.58}function XC(t,e,r,n,i,o,s){let a=i*.58,c=e?wb(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=wb(f,i),m={\"font-family\":o,\"font-size\":i,fill:s};if(!d)return je({x:h(u),y:h(n),...m},f);if(d.kind===\"builtin\"&&d.name===\"multiplier\")return je({x:h(u),y:h(n),...m},`${f}\\xD7`);if(d.kind===\"builtin\"){let T=Yi[d.name],_=je({x:h(u),y:h(n),...m},f),E=i*.1,b=i,N=u+p+E,F=n-i*.85,L=`<svg x=\"${h(N)}\" y=\"${h(F)}\" width=\"${h(b)}\" height=\"${h(b)}\" viewBox=\"${T.viewBox}\" style=\"color:${Qn(s)}\" aria-hidden=\"true\">${T.body}</svg>`;return _+L}let w=h(i*.1);return`<text x=\"${h(u)}\" y=\"${h(n)}\" font-family=\"${Qn(o)}\" font-size=\"${i}\" fill=\"${Qn(s)}\">${hr(f)}<tspan dx=\"${w}\">${hr(d.text)}</tspan></text>`}var UC=.6,_G=.5;function EG(t){let{metaText:e,capacity:r,x:n,baselineY:i,fontSize:o,fontFamily:s,color:a}=t;if(!e&&!r)return\"\";let c={\"font-family\":s,\"font-size\":o,fill:a};if(!r)return je({x:h(n),y:h(i),...c},e);if(!e)return XC(r,void 0,n,i,o,s,a);let l=h(o*UC),u=`<text x=\"${h(n)}\" y=\"${h(i)}\" font-family=\"${Qn(s)}\" font-size=\"${o}\" fill=\"${Qn(a)}\">`,{text:f,icon:d}=r;if(!d)return u+hr(e)+`<tspan dx=\"${l}\">${hr(f)}</tspan></text>`;if(d.kind===\"builtin\"&&d.name===\"multiplier\")return u+hr(e)+`<tspan dx=\"${l}\">${hr(f)}\\xD7</tspan></text>`;if(d.kind===\"literal\"){let L=h(o*.1);return u+hr(e)+`<tspan dx=\"${l}\">${hr(f)}</tspan><tspan dx=\"${L}\">${hr(d.text)}</tspan></text>`}let p=Yi[d.name],m=L=>L.length*o*_G,w=n+m(e)+o*UC,T=o*.1,_=o,E=w+m(f)+T,b=i-o*.85,N=u+hr(e)+`<tspan dx=\"${l}\">${hr(f)}</tspan></text>`,F=`<svg x=\"${h(E)}\" y=\"${h(b)}\" width=\"${h(_)}\" height=\"${h(_)}\" viewBox=\"${p.viewBox}\" style=\"color:${Qn(a)}\" aria-hidden=\"true\">${p.body}</svg>`;return N+F}function vG(t,e){let r=PC.calendar,n=`<svg x=\"${h(t.glyphTopLeft.x)}\" y=\"${h(t.glyphTopLeft.y)}\" width=\"${h(t.glyphSize)}\" height=\"${h(t.glyphSize)}\" viewBox=\"${r.viewBox}\" style=\"color:${Qn(e)}\" aria-hidden=\"true\">${r.body}</svg>`,i=`<title>${hr(t.isoDate)}</title>`;return ie(\"g\",{\"data-layer\":\"inline-date-pin\",\"data-side\":t.side,\"data-date\":t.isoDate,\"data-spilled\":t.spilled?\"true\":null},i+n)}function _b(t,e){return!t||t.length===0?\"\":t.map(r=>vG(r,e)).join(\"\")}function RG(t,e,r,n,i,o={}){let s=Math.min(fh[i.cornerRadius]??4,n/2);return ie(\"rect\",{x:h(t),y:h(e),width:h(r),height:h(n),rx:h(s),ry:h(s),fill:i.bg===\"none\"?\"transparent\":i.bg,stroke:i.fg,\"stroke-width\":1,\"stroke-dasharray\":TG(i)??null,...o})}function AG(t,e,r,n){let i=t.box.x+t.cardBox.x,o=t.box.y+t.cardBox.y,s=t.cardBox.width,a=t.cardBox.height,c=t.style.bg===\"none\"?r.surface.headerBox:t.style.bg,l=r.header.cardBorder,u=ie(\"rect\",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,\"stroke-width\":1,filter:`url(#${e}-shadow-subtle)`}),f=[];t.titleLines.forEach((_,E)=>{f.push(je({x:h(i+16),y:h(o+26+E*20),\"font-family\":n[t.style.font],\"font-size\":16,\"font-weight\":600,fill:t.style.text},_))});let d=f.join(\"\"),p=o+26+Math.max(0,t.titleLines.length-1)*20,m=r.header.author,w=[];t.authorLines.forEach((_,E)=>{w.push(je({x:h(i+16),y:h(p+18+E*14),\"font-family\":n[t.style.font],\"font-size\":11,fill:m},_))});let T=w.join(\"\");return ie(\"g\",{\"data-layer\":\"header\",\"data-id\":`${e}-header`},u+d+T)}function kG(t,e,r){let n=r.timeline.gridLine,i=r.timeline.minorGridLine,o=t.bottomTickPanelHeight??0,s=t.bottomTickPanelY!==void 0&&o>0,a=t.tickPanelY,c=s?t.bottomTickPanelY+o:t.box.y+t.box.height,l=e,u=t.box.y+t.box.height,f=[];for(let d of t.ticks)if(d.major)f.push(ie(\"line\",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:n,\"stroke-width\":1}));else if(t.minorGrid){if(d.labelX===void 0)continue;f.push(ie(\"line\",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,\"stroke-width\":1}))}return ie(\"g\",{\"data-layer\":\"grid\"},f.join(\"\"))}function IG(t,e,r){let n=e.timeline.panelFill,i=e.timeline.border,o=e.timeline.labelText,s=[],a=t.tickPanelY,c=t.tickPanelHeight,l=c>0,u=t.markerRow.height>0,f=a+c,d=t.markerRow.height,p=t.bottomTickPanelY,m=t.bottomTickPanelHeight??0,w=p!==void 0&&m>0;l&&s.push(ie(\"rect\",{x:h(t.box.x),y:h(a),width:h(t.box.width),height:h(c),rx:4,ry:4,fill:n,stroke:i,\"stroke-width\":1})),u&&s.push(ie(\"rect\",{x:h(t.box.x),y:h(f),width:h(t.box.width),height:h(d),rx:4,ry:4,fill:n,stroke:i,\"stroke-width\":1})),w&&s.push(ie(\"rect\",{x:h(t.box.x),y:h(p),width:h(t.box.width),height:h(m),rx:4,ry:4,fill:n,stroke:i,\"stroke-width\":1}));for(let T of t.ticks)T.major&&(!T.label||T.labelX===void 0||(l&&s.push(je({x:h(T.labelX),y:h(a+dh),\"font-family\":r.sans,\"font-size\":10,fill:o,\"text-anchor\":\"middle\"},T.label)),w&&s.push(je({x:h(T.labelX),y:h(p+dh),\"font-family\":r.sans,\"font-size\":10,fill:o,\"text-anchor\":\"middle\"},T.label))));return ie(\"g\",{\"data-layer\":\"timeline\"},s.join(\"\"))}function SG(t,e,r){if(!t)return\"\";let n=e.nowline.stroke,i=e.nowline.labelText,o=ie(\"line\",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:n,\"stroke-width\":yh}),s=NG(t,n),a=CG(t,i,r);return ie(\"g\",{\"data-layer\":\"nowline\"},o+s+a)}function GC(t){let e=yh/2;return t.pillMode===\"flag-right\"?t.x-e:t.pillMode===\"flag-left\"?t.x+e:t.x}function NG(t,e){let r=t.pillTopY,n=t.pillTopY+Gi,i=Ew,o=t.pillWidth;if(t.pillMode===\"center\")return ie(\"rect\",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Gi),rx:i,ry:i,fill:e});let s=GC(t);if(t.pillMode===\"flag-right\"){let l=s+o,u=[`M ${h(s)} ${h(r)}`,`L ${h(l-i)} ${h(r)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(r+i)}`,`L ${h(l)} ${h(n-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,\"Z\"].join(\" \");return ie(\"path\",{d:u,fill:e})}let a=s-o,c=[`M ${h(s)} ${h(r)}`,`L ${h(a+i)} ${h(r)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(r+i)}`,`L ${h(a)} ${h(n-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,\"Z\"].join(\" \");return ie(\"path\",{d:c,fill:e})}function CG(t,e,r){let n=t.pillTopY+vw,i=GC(t),o,s;return t.pillMode===\"center\"?(o=t.x,s=\"middle\"):t.pillMode===\"flag-right\"?(o=i+nc,s=\"start\"):(o=i-nc,s=\"end\"),je({x:h(o),y:h(n),\"font-family\":r.sans,\"font-size\":Pu,\"font-weight\":700,fill:e,\"text-anchor\":s},t.label)}function PG(t,e,r,n,i){let o=[],s=$C(r,t.style.shadow);o.push(RG(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:s??null}));let a=bG(t.style.bg,n),c={done:a.done,\"in-progress\":a.inProgress,\"at-risk\":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},l=c[t.status]??c.neutral;if(t.progressFraction>0){let T=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));o.push(ie(\"rect\",{x:h(t.box.x),y:h(t.box.y+t.box.height-Tn),width:h(T),height:Tn,fill:t.style.fg,opacity:.55}))}let u=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-12;o.push(ie(\"circle\",{cx:h(u),cy:h(t.box.y+12),r:5,fill:l})),o.push(_b(t.inlineDatePins,t.style.fg));let f;t.textSpills?(f=t.box.x+t.box.width+6,t.iconSpills&&(f+=18)):f=t.box.x+12;let d=t.style.text,p=n.entities.item.text,m=t.textSpills?p:d,w=t.textSpills?p:t.style.fg;if(t.title&&o.push(je({x:h(f),y:h(t.box.y+20),\"font-family\":i[t.style.font],\"font-size\":13,\"font-weight\":600,fill:m},t.title)),(t.metaText||t.capacity)&&o.push(EG({metaText:t.metaText,capacity:t.capacity,x:f,baselineY:t.box.y+38,fontSize:11,fontFamily:i[t.style.font],color:w})),t.footnoteIndicators.length>0){let T=t.box.y+14;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let _=t.footnoteSpillStartX;for(let E=0;E<t.footnoteIndicators.length;E++){let b=t.footnoteIndicators[E];o.push(je({x:h(_),y:h(T),\"font-family\":i.sans,\"font-size\":10,\"font-weight\":700,fill:p},String(b))),_+=8}}else{let _=t.box.x+t.box.width-22;for(let E=t.footnoteIndicators.length-1;E>=0;E--){let b=t.footnoteIndicators[E];o.push(je({x:h(_),y:h(T),\"font-family\":i.sans,\"font-size\":10,\"font-weight\":700,fill:t.style.text,\"text-anchor\":\"end\"},String(b))),_-=8}}}if(!e.noLinks&&t.linkIcon&&t.linkIcon!==\"none\"){let T={linear:\"#5e6ad2\",github:\"#0f172a\",jira:\"#0052cc\",generic:n.item.linkIconFg},_=T[t.linkIcon]??T.generic,E=14,b=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+6,N=t.box.y+6,F=ie(\"rect\",{x:h(b),y:h(N),width:E,height:E,rx:2,ry:2,fill:_}),L=b,j=N,te=ie(\"path\",{d:`M${h(L+4)} ${h(j+10)} L${h(L+10)} ${h(j+4)} M${h(L+6)} ${h(j+4)} H${h(L+10)} V${h(j+8)}`,stroke:\"#ffffff\",fill:\"none\",\"stroke-width\":1.1,\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),oe=F+te,Ce=t.linkHref?ie(\"a\",{href:t.linkHref,target:\"_blank\",rel:\"noopener\"},oe):oe;o.push(Ce)}if(t.hasOverflow&&t.overflowBox){let T=n.item.overflowTailFill,_=n.item.overflowTailStroke,E=n.item.overflowCaption;o.push(ie(\"rect\",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:T,stroke:_,\"stroke-width\":1})),t.overflowAnchorId&&t.overflowBox.width>60&&o.push(je({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),\"font-family\":i.sans,\"font-size\":9,\"font-weight\":700,fill:E,\"text-anchor\":\"middle\"},`past ${t.overflowAnchorId}`))}for(let T of t.labelChips){let _=Math.min(fh[T.style.cornerRadius]??8,T.box.height/2);o.push(ie(\"rect\",{x:h(T.box.x),y:h(T.box.y),width:h(T.box.width),height:h(T.box.height),rx:h(_),ry:h(_),fill:T.style.bg===\"none\"?\"transparent\":T.style.bg,stroke:T.style.fg,\"stroke-width\":.5})),o.push(je({x:h(T.box.x+T.box.width/2),y:h(T.box.y+T.box.height/2+3),...bb(T.style,i,tc.xs),\"text-anchor\":\"middle\"},T.text))}return ie(\"g\",{\"data-layer\":\"item\",\"data-id\":t.id??null},o.join(\"\"))}function OG(t,e,r,n,i){let o=[];if(t.style.bg!==\"none\"&&t.style.bg!==\"#ffffff\"){if(o.push(ie(\"rect\",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:t.style.bg,stroke:t.style.fg,\"stroke-width\":1,\"fill-opacity\":.18,filter:`url(#${r}-shadow-subtle)`})),t.title){let a=t.title.length*ww+2*mh,c=t.box.x,l=t.box.y,u=Cu,f=6,d=`M${h(c+f)} ${h(l)}H${h(c+a)}V${h(l+u-f)}A${f} ${f} 0 0 1 ${h(c+a-f)} ${h(l+u)}H${h(c)}V${h(l+f)}A${f} ${f} 0 0 1 ${h(c+f)} ${h(l)}Z`;o.push(ie(\"path\",{d,fill:t.style.fg})),o.push(je({x:h(c+mh),y:h(l+xw),\"font-family\":i[t.style.font],\"font-size\":Tw,\"font-weight\":600,fill:\"#ffffff\"},t.title))}}else{let a=t.style.fg;if(t.style.bracket!==\"none\"){let l=t.box.y+t.box.height,u=t.style.bracket===\"dashed\"?\"3 2\":null,f=t.title?`M${h(t.box.x+4)} ${h(t.box.y-rc)} L${h(t.box.x)} ${h(t.box.y-rc)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`;o.push(ie(\"path\",{d:f,fill:\"none\",stroke:a,\"stroke-width\":1,\"stroke-dasharray\":u}))}t.title&&o.push(je({x:h(t.box.x+6),y:h(t.box.y-2),...bb(t.style,i,tc.xs),\"fill-opacity\":.7},t.title))}o.push(_b(t.inlineDatePins,t.style.fg));for(let a of t.children)o.push(Eb(a,e,r,n,i));return ie(\"g\",{\"data-layer\":\"group\",\"data-id\":t.id??null},o.join(\"\"))}function LG(t,e,r,n,i){let o=[];if(t.style.bracket===\"solid\"||t.style.bracket===\"dashed\"){let c=t.box.y-12,l=t.box.y+t.box.height+12,u=t.box.x,f=t.box.x+t.box.width,d=n.parallel.bracketStroke;o.push(ie(\"path\",{d:`M${h(u+4)} ${h(c)} H${h(u)} V${h(l)} H${h(u+4)}`,fill:\"none\",stroke:d,\"stroke-width\":1.25,\"stroke-dasharray\":t.style.bracket===\"dashed\"?\"3 3\":null,\"stroke-linejoin\":\"round\"})),o.push(ie(\"path\",{d:`M${h(f-4)} ${h(c)} H${h(f)} V${h(l)} H${h(f-4)}`,fill:\"none\",stroke:d,\"stroke-width\":1.25,\"stroke-dasharray\":t.style.bracket===\"dashed\"?\"3 3\":null,\"stroke-linejoin\":\"round\"}))}t.title&&o.push(je({x:h(t.box.x+4),y:h(t.box.y-2),...bb(t.style,i,tc.xs),\"fill-opacity\":.7},t.title)),o.push(_b(t.inlineDatePins,t.style.fg));for(let s of t.children)o.push(Eb(s,e,r,n,i));return ie(\"g\",{\"data-layer\":\"parallel\",\"data-id\":t.id??null},o.join(\"\"))}function Eb(t,e,r,n,i){return t.kind===\"item\"?PG(t,e,r,n,i):t.kind===\"group\"?OG(t,e,r,n,i):LG(t,e,r,n,i)}var BC=2;function DG(t,e){switch(t){case\"green\":return e.swimlane.utilizationOk;case\"yellow\":return e.swimlane.utilizationWarn;case\"red\":return e.swimlane.utilizationOver}}function MG(t,e){if(!t.utilization||t.utilization.segments.length===0)return\"\";let r=t.box.y+t.box.height-BC,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?\"\":ie(\"rect\",{x:h(i.startX),y:h(r),width:h(o),height:BC,fill:DG(i.classification,e),\"data-utilization\":i.classification,\"data-load\":h(i.load)})});return ie(\"g\",{\"data-layer\":\"lane-utilization\",\"data-id\":t.id??null},n.join(\"\"))}function $G(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return ie(\"g\",{\"data-layer\":\"swimlane-bg\",\"data-id\":t.id??null},ie(\"rect\",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),fill:r,stroke:n,\"stroke-width\":1}))}function jC(t,e,r,n,i){let o=n.swimlane.tabFill,s=n.swimlane.tabStroke,a=n.swimlane.tabText,c=n.swimlane.ownerText,l=n.swimlane.footnoteIndicator,u=[];if(t.title){let d=t.capacity?Zi(t.capacity.text,t.capacity.icon,10):0,p=t.footnoteIndicators.length>0?t.footnoteIndicators.join(\",\"):\"\",m=p?wb(p,10):0,w=_c(t.box.x,t.title,t.owner,d,m),T=ph,_=t.box.y+10,E=_+hh;u.push(ie(\"rect\",{x:h(w.tabX),y:h(_),width:h(w.tabW),height:h(T),rx:4,ry:4,fill:o,stroke:s,\"stroke-width\":1})),u.push(je({x:h(w.titleX),y:h(E),\"font-family\":i[t.style.font],\"font-size\":12,\"font-weight\":600,fill:a},t.title)),t.owner&&u.push(je({x:h(w.ownerX),y:h(E),\"font-family\":i[t.style.font],\"font-size\":10,fill:c},`owner: ${t.owner}`)),t.capacity&&u.push(XC(t.capacity,void 0,w.badgeX,E,10,i[t.style.font],c)),p&&u.push(je({x:h(w.footnoteRightX),y:h(_+14),\"font-family\":i.sans,\"font-size\":10,\"font-weight\":700,fill:l,\"text-anchor\":\"end\"},p))}for(let f of t.children)u.push(Eb(f,e,r,n,i));return u.push(MG(t,n)),ie(\"g\",{\"data-layer\":\"swimlane\",\"data-id\":t.id??null},u.join(\"\"))}function FG(t,e,r){let n=t.radius,i=t.center.x,o=t.center.y,s=e.anchorDiamond.fill,a=e.anchorDiamond.stroke,c=ie(\"path\",{d:`M${h(i)} ${h(o-n)} L${h(i+n)} ${h(o)} L${h(i)} ${h(o+n)} L${h(i-n)} ${h(o)} Z`,fill:s,stroke:a,\"stroke-width\":1.25}),l=e.anchorDiamond.label,u=t.labelSide===\"left\"?t.labelBox.x+t.labelBox.width:t.labelBox.x,f={x:h(u),y:h(o+4),\"font-family\":r.sans,\"font-size\":10,fill:l};t.labelSide===\"left\"&&(f[\"text-anchor\"]=\"end\");let d=t.title?je(f,t.title):\"\";return ie(\"g\",{\"data-layer\":\"anchor\",\"data-id\":t.id??null},c+d)}function UG(t,e){let r=e.anchorDiamond.cutLine;return ie(\"line\",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,\"stroke-width\":1,\"stroke-dasharray\":\"1 3\"})}function BG(t,e,r){let n=t.center.x,i=t.center.y,o=t.radius,s=e.milestoneDiamond.fill,a=ie(\"path\",{d:`M${h(n)} ${h(i-o)} L${h(n+o)} ${h(i)} L${h(n)} ${h(i+o)} L${h(n-o)} ${h(i)} Z`,fill:s,stroke:s,\"stroke-width\":1}),c=e.milestoneDiamond.label,l=t.labelSide===\"left\"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),\"font-family\":r.sans,\"font-size\":10,\"font-weight\":600,fill:c};t.labelSide===\"left\"&&(u[\"text-anchor\"]=\"end\");let f=t.title?je(u,t.title):\"\";return ie(\"g\",{\"data-layer\":\"milestone\",\"data-id\":t.id??null},a+f)}function HG(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(ie(\"line\",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,\"stroke-width\":2,\"stroke-dasharray\":gh,\"stroke-linecap\":\"round\"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(ie(\"path\",{d:`M${h(o.x)} ${h(o.y)} H${h(t.center.x-6)}`,fill:\"none\",stroke:i,\"stroke-width\":1.1,\"stroke-dasharray\":\"3 3\",\"stroke-linecap\":\"round\",\"marker-end\":\"url(#nl-arrow-dark)\"}))}return n.join(\"\")}function HC(t,e){let r=t.kind===\"overflow\"?e.dependency.overflowStroke:e.dependency.edgeStroke,n=t.waypoints;if(n.length<2)return\"\";let i=t.kind===\"underBar\"?.8:1.1;return ie(\"path\",{d:XG(n,Cw),fill:\"none\",stroke:r,\"stroke-width\":i,\"stroke-dasharray\":t.kind===\"overflow\"?\"4 2\":null,\"stroke-linejoin\":\"round\",\"marker-end\":\"url(#nl-arrow)\"})}function XG(t,e){if(t.length<2)return\"\";let r=[`M${h(t[0].x)} ${h(t[0].y)}`];for(let n=1;n<t.length;n++){let i=t[n-1],o=t[n];if(n===t.length-1){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=t[n+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(e,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},w={x:o.x+l*p,y:o.y+u*p};r.push(`L${h(m.x)} ${h(m.y)}`),r.push(`Q${h(o.x)} ${h(o.y)} ${h(w.x)} ${h(w.y)}`)}return r.join(\" \")}function GG(t,e,r,n){if(t.entries.length===0)return\"\";let i=r.footnotePanel.fill,o=r.footnotePanel.border,s=r.footnotePanel.header,a=r.footnotePanel.title,c=r.footnotePanel.description,l=r.footnotePanel.number,u=[];u.push(ie(\"rect\",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:i,stroke:o,\"stroke-width\":1,filter:`url(#${e}-shadow-subtle)`})),u.push(je({x:h(t.box.x+Zr),y:h(t.box.y+Aw),\"font-family\":n.sans,\"font-size\":12,\"font-weight\":700,fill:s},\"Footnotes\"));let f=t.box.y+Ou+Zr,d=t.box.x+Zr,p=d+Zr;return t.entries.forEach((m,w)=>{let T=f+w*Lu;u.push(je({x:h(d),y:h(T),\"font-family\":n.sans,\"font-size\":10,\"font-weight\":700,fill:l},String(m.number))),u.push(je({x:h(p),y:h(T),\"font-family\":n.sans,\"font-size\":11,\"font-weight\":600,fill:a},m.title)),m.description&&u.push(je({x:h(p+Math.max(120,m.title.length*6)),y:h(T),\"font-family\":n.sans,\"font-size\":11,fill:c},`\\u2014 ${m.description}`))}),ie(\"g\",{\"data-layer\":\"footnotes\"},u.join(\"\"))}function jG(t,e,r,n,i){let o=n.includeRegion.border,s=n.includeRegion.fill,a=n.includeRegion.tabFill,c=n.includeRegion.tabStroke,l=n.includeRegion.tabText,u=n.includeRegion.badgeFill,f=n.includeRegion.badgeStroke,d=n.includeRegion.badgeText,p=t.box.x+8,m=t.box.y,w=t.box.width-16,T=t.box.height,_=ie(\"rect\",{x:h(p),y:h(m),width:h(w),height:h(T),rx:8,ry:8,fill:s,stroke:o,\"stroke-width\":1,\"stroke-dasharray\":gh}),E=ph,b=Ec(t.box.x,t.label,t.sourcePath),N=m-E/2,F=ie(\"rect\",{x:h(b.tabX),y:h(N),width:h(b.tabWidth),height:E,rx:4,ry:4,fill:a,stroke:c,\"stroke-width\":1}),L=je({x:h(b.tabLabelX),y:h(N+hh),\"font-family\":i.sans,\"font-size\":11,\"font-weight\":600,fill:l},t.label),j=b.badgeX,te=b.badgeSize,oe=m-te/2,Ce=ie(\"rect\",{x:h(j),y:h(oe),width:te,height:te,rx:4,ry:4,fill:u,stroke:f,\"stroke-width\":1}),M=ie(\"path\",{d:`M${h(j+7)} ${h(oe+4)} H${h(j+14)} V${h(oe+11)} M${h(j+4)} ${h(oe+7)} H${h(j+11)} V${h(oe+14)} H${h(j+4)} Z`,stroke:d,\"stroke-width\":1.4,fill:\"none\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),R=9,D=m+4,X=ie(\"rect\",{x:h(b.sourceHaloX),y:h(D-R),width:h(b.sourceHaloWidth),height:R+6,fill:s}),A=je({x:h(b.sourceTextX),y:h(D),\"font-family\":i.mono,\"font-size\":R,fill:d},t.sourcePath),I=t.nestedSwimlanes.map(S=>jC(S,e,r,n,i)).join(\"\");return ie(\"g\",{\"data-layer\":\"include\"},_+I+F+L+Ce+M+X+A)}function zG(t,e){let r=t.palette.attribution.mark,n=t.palette.attribution.link;if(t.swimlanes.length===0)return\"\";let i=t.header.attributionBox.x,o=t.header.attributionBox.y,s=ji,a=je({x:\"0\",y:s,\"font-family\":e.sans,\"font-size\":wh,\"font-weight\":400,fill:r},Th)+je({x:Mu,y:s,\"font-family\":e.sans,\"font-size\":ji,\"font-weight\":700,fill:r},\"now\")+ie(\"rect\",{x:Iw,y:12,width:Sw,height:ji,fill:n})+je({x:bh,y:s,\"font-family\":e.sans,\"font-size\":ji,\"font-weight\":400,fill:r},\"ine\"),c=ie(\"g\",{transform:`translate(${h(i)} ${h(o)}) scale(${h(Du)})`},a);return ie(\"a\",{href:kw,target:\"_blank\",rel:\"noopener\",\"aria-label\":\"Powered by nowline\"},ie(\"g\",{\"data-layer\":\"attribution\"},c))}async function WG(t,e,r,n,i,o,s){if(!e)return\"\";let a;try{a=await e(t)}catch(u){let f=`logo: failed to load ${t}: ${u instanceof Error?u.message:String(u)}`;if(n.strict)throw u;return n.warn?.(f),\"\"}let c=(a.mime??\"\").toLowerCase();if(c===\"image/svg+xml\"){let u=new TextDecoder().decode(a.bytes),f=OC(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return ie(\"g\",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c===\"image/png\"||c===\"image/jpeg\"||c===\"image/jpg\"||c===\"image/webp\"){let u=qG(a.bytes);return ie(\"image\",{href:`data:${c};base64,${u}`,x:h(i),y:h(o),width:h(s),height:h(s),preserveAspectRatio:\"xMidYMid meet\"})}let l=`logo: unsupported mime ${c} for ${t}`;if(n.strict)throw new Error(l);return n.warn?.(l),\"\"}function qG(t){if(typeof btoa<\"u\"){let r=\"\";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}let e=globalThis;if(e.Buffer)return e.Buffer.from(t).toString(\"base64\");throw new Error(\"renderer: no base64 encoder available\")}async function vb(t,e={}){let n=new tm(e.idPrefix??\"nl\").next(\"root\"),i=t.palette,o=e.fontFamilies??Pw,s=[],a=i.arrowhead.neutral,c=i.arrowhead.light,l=i.arrowhead.dark,u=(p,m)=>`<marker id=\"${p}\" viewBox=\"0 0 10 10\" refX=\"9\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto\"><path d=\"M 0 0 L 10 5 L 0 10 z\" fill=\"${m}\"/></marker>`,f=`<defs>${FC(n)}`+u(\"nl-arrow\",a)+u(\"nl-arrow-light\",c)+u(\"nl-arrow-dark\",l)+\"</defs>\";s.push(f),s.push(ie(\"rect\",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),s.push(IG(t.timeline,i,o));for(let p of t.swimlanes)s.push($G(p,i));s.push(kG(t.timeline,t.chartBox.y,i));for(let p of t.edges)p.kind===\"underBar\"&&s.push(HC(p,i));for(let p of t.swimlanes)s.push(jC(p,e,n,i,o));for(let p of t.includes)s.push(jG(p,e,n,i,o));for(let p of t.edges)p.kind!==\"underBar\"&&s.push(HC(p,i));for(let p of t.anchors)s.push(UG(p,i));for(let p of t.milestones)s.push(HG(p,i));for(let p of t.anchors)s.push(FG(p,i,o));for(let p of t.milestones)s.push(BG(p,i,o));if(s.push(SG(t.nowline,i,o)),s.push(GG(t.footnotes,n,i,o)),s.push(AG(t.header,n,i,o)),s.push(zG(t,o)),t.header.logo&&e.assetResolver){let p=await WG(t.header.logo.assetRef??\"\",e.assetResolver,n,e,t.header.logo.box.x,t.header.logo.box.y,Math.max(t.header.logo.box.width,t.header.logo.box.height));p&&s.push(p)}return`<svg${xc({xmlns:\"http://www.w3.org/2000/svg\",viewBox:`0 0 ${h(t.width)} ${h(t.height)}`,width:h(t.width),height:h(t.height),\"data-theme\":t.theme,\"data-generator\":\"nowline\"})}>${s.join(\"\")}</svg>`}var Ab=\"/browser-source.nowline\",Rb,VG=0;function zC(){return Rb||(Rb=hw()),Rb}function YG(){return wt.parse(`memory:///nowline-browser-${++VG}.nowline`)}async function WC(t,e={}){let r=e.filePath??Ab,n=zC(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,YG());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of am(o))a.origin===\"lexer\"?s.push(AC(a.error,r)):a.origin===\"parser\"?s.push(RC(a.error,r)):s.push(vC(a.diagnostic,r));return{ast:o.parseResult.value,diagnostics:s}}async function kb(t,e={}){let r=e.filePath??Ab,n=await WC(t,{filePath:r});if(n.diagnostics.some(T=>T.severity===\"error\"))return{kind:\"diagnostics\",diagnostics:n.diagnostics};let i=zC(),o=e.readFile??NC,s=await nw(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let T of s.diagnostics){if(T.severity===\"error\"&&CC(T.message)){e.onSkippedInclude?.({sourcePath:T.sourcePath,message:T.message});continue}a.push(kC(T))}if(a.some(T=>T.severity===\"error\"))return{kind:\"diagnostics\",diagnostics:a};let c;if(e.timezone)try{c=xb(e.timezone)}catch(T){if(T instanceof os)return{kind:\"diagnostics\",diagnostics:[{severity:\"error\",code:\"invalid-timezone\",message:T.message,file:r,line:1,column:1}]};throw T}let l=Tb({now:e.today,zone:c}),u=yb(n.ast,s,{theme:e.theme,today:l,locale:e.locale,width:e.width}),f=e.showLinks!==!1,d=e.strict===!0,p=[],m=await vb(u,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!f,strict:d,warn:T=>p.push(T),fontFamilies:e.fontFamilies}),w=p.map(T=>IC(T,r,d?\"error\":\"warning\"));return d&&w.length>0?{kind:\"diagnostics\",diagnostics:[...a,...w]}:{kind:\"svg\",svg:m,warnings:w}}var KG='<svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8\" rx=\"1.5\"></rect><path d=\"M10.5 5.5V4A1.5 1.5 0 0 0 9 2.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5\"></path></svg>',ZG='<svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M8 2.5v7.5\"></path><path d=\"M4.75 7 8 10.25 11.25 7\"></path><path d=\"M3 13.25h10\"></path></svg>',JG=`\n<div class=\"viewport\"><div class=\"canvas\"></div></div>\n<div class=\"empty\">Rendering preview\\u2026</div>\n<div class=\"chrome\">\n <div class=\"toolbar\">\n <span class=\"toolbar-handle\" aria-hidden=\"true\" title=\"Drag to reposition toolbar\">\\u2838</span>\n <button class=\"btn glyph restore-btn\" title=\"Expand toolbar\" aria-label=\"Expand toolbar\">\\xBB</button>\n <button class=\"btn zoom-out\" title=\"Zoom out\" aria-label=\"Zoom out\">\\u2212</button>\n <button class=\"btn zoom-label zoom-reset\" title=\"Reset to 100%\">100%</button>\n <button class=\"btn zoom-in\" title=\"Zoom in\" aria-label=\"Zoom in\">+</button>\n <span class=\"sep\"></span>\n <button class=\"btn glyph fit-width\" title=\"Fit width (3)\" aria-label=\"Fit width\">\\u2194</button>\n <button class=\"btn glyph fit-page\" title=\"Fit page (1)\" aria-label=\"Fit page\">\\u2922</button>\n <span class=\"sep\"></span>\n <div class=\"dropdown\">\n <button class=\"btn more-toggle\" title=\"More options\">\\u25BE more</button>\n <div class=\"more-menu\" hidden>\n <div class=\"more-row\">\n <span class=\"more-label\">Format:</span>\n <div class=\"dropdown\">\n <button class=\"btn more-sub-toggle format-toggle\">SVG \\u25BE</button>\n <ul class=\"more-sub-menu format-menu\" hidden>\n <li><button class=\"btn format-opt\" data-value=\"svg\"><code class=\"code-chip\">svg</code></button></li>\n <li><button class=\"btn format-opt\" data-value=\"png\"><code class=\"code-chip\">png</code></button></li>\n </ul>\n </div>\n </div>\n <div class=\"more-row action-row\">\n <button class=\"btn copy-action\" title=\"Copy to clipboard\"><span>Copy</span><span class=\"action-ico\" aria-hidden=\"true\">${KG}</span></button>\n <button class=\"btn export-action\" title=\"Export file\"><span>Export</span><span class=\"action-ico\" aria-hidden=\"true\">${ZG}</span></button>\n </div>\n <div class=\"more-divider\"></div>\n <div class=\"more-row theme-control-row\">\n <span class=\"more-label\">Theme:</span>\n <div class=\"dropdown\">\n <button class=\"btn more-sub-toggle theme-toggle\">Auto \\u25BE</button>\n <ul class=\"more-sub-menu theme-menu\" hidden></ul>\n </div>\n </div>\n <div class=\"more-row\">\n <span class=\"more-label\">Now:</span>\n <div class=\"dropdown\">\n <button class=\"btn more-sub-toggle now-toggle\"><span class=\"now-label\">Today</span> \\u25BE</button>\n <div class=\"now-picker\" hidden></div>\n </div>\n </div>\n <div class=\"more-row\">\n <span class=\"more-label\">Show links:</span>\n <div class=\"dropdown\">\n <button class=\"btn more-sub-toggle links-toggle\">Yes \\u25BE</button>\n <ul class=\"more-sub-menu links-menu\" hidden>\n <li><button class=\"btn links-opt\" data-value=\"true\">Yes</button></li>\n <li><button class=\"btn links-opt\" data-value=\"false\">No</button></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n <button class=\"btn glyph collapse-btn\" title=\"Collapse toolbar\" aria-label=\"Collapse toolbar\">\\xAB</button>\n </div>\n</div>\n<div class=\"minimap hidden\">\n <div class=\"minimap-canvas\"></div>\n <div class=\"minimap-rect\"></div>\n</div>\n<div class=\"diagnostics\">\n <div class=\"diag-header\">\n <span class=\"diag-summary\"></span>\n <a class=\"open-problems\" href=\"#\">Open Problems panel</a>\n </div>\n <table class=\"diag-table\"><tbody></tbody></table>\n</div>\n`;function ze(t,e){let r=t.querySelector(e);if(!r)throw new Error(`preview-shell: required element \"${e}\" missing from template`);return r}function qC(t){return t.classList.add(\"nl-preview-root\"),t.innerHTML=JG,{root:t,viewport:ze(t,\".viewport\"),canvas:ze(t,\".canvas\"),empty:ze(t,\".empty\"),chrome:ze(t,\".chrome\"),toolbarHandle:ze(t,\".toolbar-handle\"),restoreBtn:ze(t,\".restore-btn\"),zoomReset:ze(t,\".zoom-reset\"),zoomIn:ze(t,\".zoom-in\"),zoomOut:ze(t,\".zoom-out\"),fitWidth:ze(t,\".fit-width\"),fitPage:ze(t,\".fit-page\"),moreToggle:ze(t,\".more-toggle\"),moreMenu:ze(t,\".more-menu\"),formatToggle:ze(t,\".format-toggle\"),formatMenu:ze(t,\".format-menu\"),copyAction:ze(t,\".copy-action\"),exportAction:ze(t,\".export-action\"),themeToggle:ze(t,\".theme-toggle\"),themeMenu:ze(t,\".theme-menu\"),nowToggle:ze(t,\".now-toggle\"),nowLabel:ze(t,\".now-label\"),nowPicker:ze(t,\".now-picker\"),linksToggle:ze(t,\".links-toggle\"),linksMenu:ze(t,\".links-menu\"),collapseBtn:ze(t,\".collapse-btn\"),minimap:ze(t,\".minimap\"),minimapCanvas:ze(t,\".minimap-canvas\"),minimapRect:ze(t,\".minimap-rect\"),diagnostics:ze(t,\".diagnostics\"),diagSummary:ze(t,\".diag-summary\"),diagTbody:ze(t,\".diag-table tbody\"),openProblems:ze(t,\".open-problems\")}}var VC=`\n:root {\n color-scheme: light dark;\n --nl-preview-bg: #1e1e1e;\n --nl-preview-fg: #d4d4d4;\n --nl-preview-font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --nl-preview-font-size: 13px;\n --nl-preview-widget-bg: rgba(40,40,40,0.9);\n --nl-preview-widget-border: rgba(255,255,255,0.1);\n --nl-preview-description: #999;\n --nl-preview-error: #f48771;\n --nl-preview-warning: #cca700;\n --nl-preview-link: #3794ff;\n --nl-preview-focus: #007acc;\n --nl-preview-code-bg: rgba(255,255,255,0.05);\n --nl-preview-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n.nl-preview-root {\n position: relative;\n width: 100%; height: 100%;\n background: var(--nl-preview-bg);\n color: var(--nl-preview-fg);\n font-family: var(--nl-preview-font-family);\n font-size: var(--nl-preview-font-size);\n overflow: hidden;\n /* Shared positioning gutter for all floating elements */\n --nl-preview-gutter: 8px;\n /* Chrome palette \\u2014 dark default */\n --nl-chrome-bg: rgba(30, 30, 30, 0.93);\n --nl-chrome-border: rgba(255, 255, 255, 0.11);\n --nl-chrome-fg: #d4d4d4;\n --nl-chrome-hover: rgba(255, 255, 255, 0.08);\n --nl-chrome-active: rgba(255, 255, 255, 0.13);\n --nl-chrome-muted: #888;\n --nl-chrome-chip-bg: rgba(255, 255, 255, 0.07);\n --nl-chrome-shadow: rgba(0, 0, 0, 0.32);\n}\n/* Chrome palette \\u2014 light mode override (driven by data-nl-mode, never by workbench) */\n.nl-preview-root[data-nl-mode=\"light\"] {\n --nl-chrome-bg: rgba(248, 248, 248, 0.96);\n --nl-chrome-border: rgba(0, 0, 0, 0.13);\n --nl-chrome-fg: #3c3c3c;\n --nl-chrome-hover: rgba(0, 0, 0, 0.06);\n --nl-chrome-active: rgba(0, 0, 0, 0.10);\n --nl-chrome-muted: #717171;\n --nl-chrome-chip-bg: rgba(0, 0, 0, 0.06);\n --nl-chrome-shadow: rgba(0, 0, 0, 0.14);\n}\n.nl-preview-root .viewport {\n position: absolute; inset: 0;\n overflow: auto;\n display: flex;\n}\n.nl-preview-root .canvas {\n /* flex-shrink:0 + margin:auto: centers the diagram when it fits,\n allows overflow scroll when it's larger than the viewport */\n flex-shrink: 0;\n margin: auto;\n transform-origin: 0 0;\n will-change: transform;\n}\n.nl-preview-root .canvas svg { display: block; max-width: none; height: auto; }\n.nl-preview-root .canvas.dimmed { opacity: 0.25; pointer-events: none; }\n\n/* === Toolbar (floating, repositionable) === */\n.nl-preview-root .chrome {\n position: absolute;\n top: var(--nl-preview-gutter);\n right: var(--nl-preview-gutter);\n display: flex; gap: 4px;\n /* Keep the toolbar at its natural width so a narrowing viewport\n shifts it left (handled in JS) instead of squishing the row. */\n width: max-content;\n transition: opacity 200ms ease;\n z-index: 10;\n}\n.nl-preview-root .chrome.faded { opacity: 0.2; pointer-events: none; }\n.nl-preview-root .chrome:hover { opacity: 1; pointer-events: auto; }\n.nl-preview-root .toolbar {\n display: flex; align-items: center; gap: 2px;\n flex-wrap: nowrap;\n white-space: nowrap;\n padding: 2px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 6px;\n box-shadow: 0 2px 8px var(--nl-chrome-shadow);\n color: var(--nl-chrome-fg);\n user-select: none;\n}\n\n/* Collapsed puck: hide everything but the drag grip + restore arrow,\n and dim it so it stays out of the way until hovered. */\n.nl-preview-root .restore-btn { display: none; }\n.nl-preview-root .chrome.collapsed .toolbar > :not(.toolbar-handle):not(.restore-btn) {\n display: none;\n}\n.nl-preview-root .chrome.collapsed .restore-btn { display: inline-flex; }\n.nl-preview-root .chrome.collapsed .toolbar { opacity: 0.55; }\n.nl-preview-root .chrome.collapsed:hover .toolbar { opacity: 1; }\n.nl-preview-root .toolbar .sep {\n width: 1px; height: 18px;\n background: var(--nl-chrome-border);\n margin: 0 3px;\n flex-shrink: 0;\n}\n.nl-preview-root .toolbar-handle {\n display: flex; align-items: center; justify-content: center;\n padding: 4px 5px;\n cursor: grab;\n color: var(--nl-chrome-muted);\n font-size: 13px;\n line-height: 1;\n opacity: 0.7;\n flex-shrink: 0;\n touch-action: none;\n}\n.nl-preview-root .toolbar-handle:hover { opacity: 1; }\n.nl-preview-root .chrome.dragging .toolbar-handle { cursor: grabbing; }\n.nl-preview-root .btn {\n appearance: none;\n background: transparent;\n color: inherit;\n border: 0;\n padding: 3px 7px;\n border-radius: 4px;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n line-height: 1;\n min-width: 20px;\n flex-shrink: 0;\n /* Suppress the sticky focus ring left behind after a mouse click;\n keyboard focus is restored via :focus-visible below. */\n outline: none;\n}\n.nl-preview-root .btn:hover { background: var(--nl-chrome-hover); }\n.nl-preview-root .btn:active { background: var(--nl-chrome-active); }\n.nl-preview-root .btn:focus-visible {\n outline: 1px solid var(--nl-preview-focus);\n outline-offset: -1px;\n}\n.nl-preview-root .btn.zoom-label {\n min-width: 44px;\n font-variant-numeric: tabular-nums;\n}\n.nl-preview-root .btn.glyph { font-size: 15px; line-height: 1; padding: 3px 5px; }\n.nl-preview-root .dropdown { position: relative; }\n\n/* === More-menu panel === */\n.nl-preview-root .more-menu {\n position: absolute; top: calc(100% + 4px); right: 0;\n padding: 5px;\n min-width: 210px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 6px;\n box-shadow: 0 4px 14px var(--nl-chrome-shadow);\n z-index: 20;\n color: var(--nl-chrome-fg);\n}\n/* Opens right-aligned by default; flipped to left-aligned in JS when the\n toolbar sits near the left edge and the menu would clip the gutter. */\n.nl-preview-root .more-menu.flip { right: auto; left: 0; }\n.nl-preview-root .more-row {\n display: flex; align-items: center; justify-content: space-between;\n padding: 2px 4px;\n gap: 8px;\n}\n.nl-preview-root .more-row.action-row {\n gap: 6px;\n justify-content: stretch;\n padding-top: 6px;\n padding-bottom: 2px;\n}\n/* Copy / Export each take half the row and center their label+icon. */\n.nl-preview-root .action-row .btn {\n flex: 1 1 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n}\n.nl-preview-root .action-ico { display: inline-flex; line-height: 0; }\n.nl-preview-root .action-ico svg { display: block; }\n.nl-preview-root .more-label {\n font-size: 0.88em;\n color: var(--nl-chrome-muted);\n white-space: nowrap;\n flex-shrink: 0;\n}\n.nl-preview-root .more-divider {\n height: 1px;\n margin: 4px 0;\n background: var(--nl-chrome-border);\n}\n\n/* === Sub-menus inside more-menu === */\n.nl-preview-root .more-sub-toggle {\n font-size: 0.88em;\n padding: 3px 6px;\n}\n.nl-preview-root .more-sub-menu {\n position: absolute; top: calc(100% + 2px); left: 0;\n list-style: none; padding: 4px;\n /* Size to the widest option (plus the checkmark gutter) rather than\n a fixed min-width, so there's no dead whitespace to the right. */\n width: max-content; min-width: 0; max-width: 280px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 6px;\n box-shadow: 0 4px 12px var(--nl-chrome-shadow);\n z-index: 25;\n color: var(--nl-chrome-fg);\n}\n/* Flyout flipped to open toward the left (set in JS when the default\n right-ward opening would overflow the viewport gutter). */\n.nl-preview-root .more-sub-menu.flip { left: auto; right: 0; }\n.nl-preview-root .more-sub-menu li { padding: 0; }\n.nl-preview-root .more-sub-menu .btn {\n display: block; width: 100%; text-align: left;\n /* Generous left gutter keeps the checkmark off the label text. */\n padding: 5px 12px 5px 26px;\n position: relative;\n font-size: 0.88em;\n}\n.nl-preview-root .more-sub-menu .btn[data-active=\"true\"]::before {\n content: '\\\\2713';\n position: absolute;\n left: 9px;\n}\n\n/* === Code-style chip for real theme/format tokens === */\n.nl-preview-root .code-chip {\n font-family: var(--nl-preview-mono);\n font-size: 0.9em;\n background: var(--nl-chrome-chip-bg);\n border-radius: 3px;\n padding: 1px 4px;\n font-style: normal;\n}\n\n/* === Diagnostic overlay menu (for old .menu usage in diagnostics) === */\n.nl-preview-root .menu {\n position: absolute; top: 100%; right: 0; margin-top: 4px;\n list-style: none; padding: 4px; min-width: 140px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 6px;\n box-shadow: 0 4px 12px var(--nl-chrome-shadow);\n z-index: 20;\n color: var(--nl-chrome-fg);\n}\n.nl-preview-root .menu li { padding: 0; }\n.nl-preview-root .menu .btn {\n display: block; width: 100%; text-align: left;\n padding: 6px 10px;\n}\n.nl-preview-root .menu li.menu-section {\n padding: 4px 10px 2px;\n font-size: 0.85em;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--nl-chrome-muted);\n}\n.nl-preview-root .menu li.menu-divider {\n height: 1px;\n margin: 4px 6px;\n background: var(--nl-chrome-border);\n}\n\n/* === Minimap (subordinate floating widget) === */\n.nl-preview-root .minimap {\n position: absolute;\n bottom: var(--nl-preview-gutter);\n right: var(--nl-preview-gutter);\n width: 120px; max-height: 90px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 5px;\n overflow: hidden;\n box-shadow: 0 2px 6px var(--nl-chrome-shadow);\n z-index: 8;\n transition: opacity 200ms ease;\n}\n.nl-preview-root .minimap.hidden { display: none; }\n.nl-preview-root .minimap.faded { opacity: 0.2; pointer-events: none; }\n.nl-preview-root .minimap-canvas {\n display: block;\n cursor: pointer;\n user-select: none;\n}\n.nl-preview-root .minimap-canvas svg {\n display: block;\n width: 100%;\n height: auto;\n pointer-events: none;\n}\n.nl-preview-root .minimap-rect {\n position: absolute;\n border: 2px solid var(--nl-preview-focus);\n background-color: color-mix(in srgb, var(--nl-preview-focus) 18%, transparent);\n pointer-events: none;\n box-sizing: border-box;\n}\n\n/* === Calendar picker === */\n.nl-preview-root .now-picker {\n position: absolute; top: calc(100% + 2px); left: 0;\n padding: 8px;\n min-width: 200px;\n background: var(--nl-chrome-bg);\n border: 1px solid var(--nl-chrome-border);\n border-radius: 6px;\n box-shadow: 0 4px 14px var(--nl-chrome-shadow);\n z-index: 26;\n color: var(--nl-chrome-fg);\n}\n/* Calendar flips to open toward the left when opening rightward would\n push it past the viewport's right gutter (see placeFlyout). */\n.nl-preview-root .now-picker.flip { left: auto; right: 0; }\n.nl-preview-root .cal-nav {\n display: flex; align-items: center; justify-content: space-between;\n margin-bottom: 6px;\n}\n.nl-preview-root .cal-heading {\n font-size: 0.85em;\n font-weight: 600;\n}\n.nl-preview-root .cal-nav-btn {\n padding: 2px 6px;\n min-width: unset;\n font-size: 14px;\n}\n.nl-preview-root .cal-grid {\n display: grid; grid-template-columns: repeat(7, 1fr);\n gap: 1px;\n margin-bottom: 6px;\n}\n.nl-preview-root .cal-dow {\n text-align: center;\n font-size: 0.75em;\n color: var(--nl-chrome-muted);\n padding: 2px 0;\n}\n.nl-preview-root .cal-empty {\n /* placeholder for days before the 1st of the month */\n}\n.nl-preview-root .cal-day {\n padding: 3px 2px;\n min-width: unset;\n font-size: 0.8em;\n text-align: center;\n border-radius: 3px;\n}\n.nl-preview-root .cal-day.is-today { font-weight: 700; }\n.nl-preview-root .cal-day.is-selected {\n background: var(--nl-chrome-hover);\n outline: 1px solid var(--nl-chrome-border);\n}\n.nl-preview-root .cal-footer {\n display: flex; gap: 4px;\n border-top: 1px solid var(--nl-chrome-border);\n padding-top: 6px;\n margin-top: 2px;\n}\n.nl-preview-root .cal-footer-btn {\n flex: 1;\n text-align: center;\n font-size: 0.82em;\n padding: 4px 6px;\n min-width: unset;\n}\n\n/* === Diagnostics overlay === */\n.nl-preview-root .diagnostics {\n position: absolute; left: 0; right: 0; bottom: 0;\n max-height: 60%;\n background: var(--nl-preview-widget-bg);\n border-top: 1px solid var(--nl-preview-widget-border);\n overflow: auto;\n z-index: 12;\n padding: 0;\n display: none;\n}\n.nl-preview-root .diagnostics.show { display: block; }\n.nl-preview-root .diag-header {\n position: sticky; top: 0;\n display: flex; align-items: center; justify-content: space-between;\n padding: 6px 12px;\n background: inherit;\n border-bottom: 1px solid var(--nl-preview-widget-border);\n font-weight: 600;\n}\n.nl-preview-root .diag-summary {\n color: var(--nl-preview-error);\n}\n.nl-preview-root .diag-summary.warn-only {\n color: var(--nl-preview-warning);\n}\n.nl-preview-root .diag-summary.clean {\n color: var(--nl-preview-description);\n font-weight: normal;\n}\n.nl-preview-root .open-problems {\n color: var(--nl-preview-link);\n cursor: pointer;\n text-decoration: none;\n font-weight: normal;\n}\n.nl-preview-root .open-problems:hover { text-decoration: underline; }\n.nl-preview-root .diag-table {\n width: 100%;\n border-collapse: collapse;\n}\n.nl-preview-root .diag-table tr {\n cursor: pointer;\n border-bottom: 1px solid var(--nl-preview-widget-border);\n}\n.nl-preview-root .diag-table tr:hover {\n background: rgba(255,255,255,0.04);\n}\n.nl-preview-root .diag-table td {\n padding: 6px 8px;\n vertical-align: top;\n}\n.nl-preview-root .sev-cell {\n width: 24px; text-align: center;\n font-weight: bold;\n}\n.nl-preview-root .sev-error { color: var(--nl-preview-error); }\n.nl-preview-root .sev-warning { color: var(--nl-preview-warning); }\n.nl-preview-root .loc-cell {\n white-space: nowrap;\n color: var(--nl-preview-description);\n font-variant-numeric: tabular-nums;\n width: 90px;\n}\n.nl-preview-root .code-cell {\n white-space: nowrap;\n width: 1%;\n}\n.nl-preview-root .code-pill {\n display: inline-block;\n padding: 1px 6px;\n border-radius: 3px;\n background: var(--nl-preview-code-bg);\n color: var(--nl-preview-description);\n font-family: var(--nl-preview-mono);\n font-size: 0.9em;\n}\n.nl-preview-root .msg-cell { word-break: break-word; }\n.nl-preview-root .suggestion {\n display: block; margin-top: 2px;\n color: var(--nl-preview-description);\n font-style: italic;\n font-size: 0.95em;\n}\n\n/* === Empty state === */\n.nl-preview-root .empty {\n position: absolute; inset: 0;\n display: flex; align-items: center; justify-content: center;\n color: var(--nl-preview-description);\n pointer-events: none;\n}\n.nl-preview-root .empty.hidden { display: none; }\n`;var Ib=!1,rm=null;function QG(t){if(Ib)return;if(t.querySelector(\"style[data-nl-preview-shell]\")){Ib=!0;return}let e=t.createElement(\"style\");e.setAttribute(\"data-nl-preview-shell\",\"\"),e.textContent=VC,t.head?.appendChild(e),Ib=!0}function Sb(t,e={}){QG(t.ownerDocument);let r=qC(t),n=t.ownerDocument,i=n.defaultView??globalThis,o={svgString:null,scale:1,naturalWidth:0,naturalHeight:0,defaultFit:e.initialFit??\"fitPage\",activeFit:e.initialFit===\"fitWidth\"?\"fitWidth\":\"fitPage\",isDirty:!1,lastViewportWidth:0,lastViewportHeight:0,showMinimap:e.showMinimap!==!1,firstRender:!0,mode:\"dark\",locale:e.locale??(typeof navigator<\"u\"?navigator.language:\"en\"),export:{format:\"svg\"},view:{theme:\"auto\",now:\"today\",showLinks:!0,overridden:{theme:!1,now:!1,showLinks:!1}}},s=[];function a(x,C,U,Z){x.addEventListener(C,U,Z),s.push(()=>x.removeEventListener(C,U,Z))}function c(){let x=n.body;if(x){if(x.classList.contains(\"vscode-dark\")||x.classList.contains(\"vscode-high-contrast-dark\"))return\"dark\";if(x.classList.contains(\"vscode-light\")||x.classList.contains(\"vscode-high-contrast-light\")||x.classList.contains(\"vscode-high-contrast\"))return\"light\"}return typeof i.matchMedia==\"function\"?i.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\":\"dark\"}function l(x){o.mode=x,t.setAttribute(\"data-nl-mode\",x)}let u=e.mode??\"system\";if(l(u===\"system\"?c():u),u===\"system\"){if(typeof MutationObserver<\"u\"&&n.body){let C=new MutationObserver(()=>l(c()));C.observe(n.body,{attributes:!0,attributeFilter:[\"class\"]}),s.push(()=>C.disconnect())}let x=typeof i.matchMedia==\"function\"?i.matchMedia(\"(prefers-color-scheme: dark)\"):null;if(x){let C=()=>{let U=n.body;U&&(U.classList.contains(\"vscode-dark\")||U.classList.contains(\"vscode-light\")||U.classList.contains(\"vscode-high-contrast\")||U.classList.contains(\"vscode-high-contrast-dark\")||U.classList.contains(\"vscode-high-contrast-light\"))||l(x.matches?\"dark\":\"light\")};x.addEventListener(\"change\",C),s.push(()=>x.removeEventListener(\"change\",C))}}let f=null;function d(){r.chrome.classList.remove(\"faded\"),r.minimap.classList.remove(\"faded\"),f&&clearTimeout(f),f=setTimeout(()=>{r.chrome.classList.add(\"faded\"),r.minimap.classList.add(\"faded\")},2e3)}a(n,\"mousemove\",d),d(),a(r.collapseBtn,\"click\",x=>{x.stopPropagation(),We(),r.chrome.classList.add(\"collapsed\"),T()}),a(r.restoreBtn,\"click\",x=>{x.stopPropagation(),r.chrome.classList.remove(\"collapsed\"),T()});let p=rm===null,m=null;function w(){let x=getComputedStyle(t).getPropertyValue(\"--nl-preview-gutter\").trim();return parseInt(x,10)||8}function T(){let x=w(),C=r.chrome.offsetWidth,U=r.chrome.offsetHeight,Z=Math.max(x,t.clientWidth-C-x),re=Math.max(x,t.clientHeight-U-x),q,g;p?(q=t.clientWidth-C-x,g=x):(q=parseInt(r.chrome.style.left,10),g=parseInt(r.chrome.style.top,10),Number.isNaN(q)&&(q=rm?.left??x),Number.isNaN(g)&&(g=rm?.top??x)),r.chrome.style.right=\"auto\",r.chrome.style.left=`${Math.max(x,Math.min(q,Z))}px`,r.chrome.style.top=`${Math.max(x,Math.min(g,re))}px`}function _(){r.chrome.style.left===\"\"&&(r.chrome.style.right=\"auto\",r.chrome.style.left=`${r.chrome.offsetLeft}px`,r.chrome.style.top=`${r.chrome.offsetTop}px`)}a(r.toolbarHandle,\"pointerdown\",x=>{x.preventDefault(),p=!1,_(),m={pointerX:x.clientX,pointerY:x.clientY,chromeLeft:parseInt(r.chrome.style.left,10)||0,chromeTop:parseInt(r.chrome.style.top,10)||0},r.chrome.classList.add(\"dragging\"),r.toolbarHandle.setPointerCapture(x.pointerId)}),a(r.toolbarHandle,\"pointermove\",x=>{if(!m)return;let C=x.clientX-m.pointerX,U=x.clientY-m.pointerY,Z=m.chromeLeft+C,re=m.chromeTop+U,q=w(),g=Math.max(q,t.clientWidth-r.chrome.offsetWidth-q),k=Math.max(q,t.clientHeight-r.chrome.offsetHeight-q);r.chrome.style.left=`${Math.max(q,Math.min(Z,g))}px`,r.chrome.style.top=`${Math.max(q,Math.min(re,k))}px`});function E(){m&&(m=null,r.chrome.classList.remove(\"dragging\"),rm={left:parseInt(r.chrome.style.left,10)||0,top:parseInt(r.chrome.style.top,10)||0})}a(r.toolbarHandle,\"pointerup\",E),a(r.toolbarHandle,\"pointercancel\",()=>{m=null,r.chrome.classList.remove(\"dragging\")});function b(){let x=Math.max(1,Math.round(o.naturalWidth*o.scale)),C=Math.max(1,Math.round(o.naturalHeight*o.scale));r.canvas.style.width=`${x}px`,r.canvas.style.height=`${C}px`,r.zoomReset.textContent=`${Math.round(o.scale*100)}%`,G(),V()}function N(x){return x<.05?.05:x>20?20:x}function F(x,C,U){let Z=N(x);if(C===void 0||U===void 0||o.scale===0){o.scale=Z,b();return}let re=Z/o.scale,q=(r.viewport.scrollLeft+C)*re-C,g=(r.viewport.scrollTop+U)*re-U;o.scale=Z,b(),r.viewport.scrollLeft=q,r.viewport.scrollTop=g}function L(){if(!o.naturalWidth||!o.naturalHeight)return;o.activeFit=\"fitPage\",o.isDirty=!1;let x=r.viewport.clientWidth/o.naturalWidth,C=r.viewport.clientHeight/o.naturalHeight;F(Math.min(x,C)),r.viewport.scrollLeft=0,r.viewport.scrollTop=0}function j(){o.naturalWidth&&(o.activeFit=\"fitWidth\",o.isDirty=!1,F(r.viewport.clientWidth/o.naturalWidth),r.viewport.scrollLeft=0,r.viewport.scrollTop=0)}function te(){o.activeFit=\"manual\",o.isDirty=!0,F(1)}function oe(){o.defaultFit===\"fitWidth\"?j():o.defaultFit===\"actual\"?te():L()}function Ce(){let x=r.viewport.clientWidth,C=r.viewport.clientHeight;if(o.isDirty){let U=o.lastViewportWidth||x,Z=o.lastViewportHeight||C;if(o.scale>0&&(U!==x||Z!==C)){let re=(r.viewport.scrollLeft+U/2)/o.scale,q=(r.viewport.scrollTop+Z/2)/o.scale;r.viewport.scrollLeft=Math.max(0,re*o.scale-x/2),r.viewport.scrollTop=Math.max(0,q*o.scale-C/2)}}else o.activeFit===\"fitPage\"?L():o.activeFit===\"fitWidth\"&&j();o.lastViewportWidth=x,o.lastViewportHeight=C}function M(x){let C=0,U=0;x.viewBox?.baseVal?.width&&(C=x.viewBox.baseVal.width,U=x.viewBox.baseVal.height),!C&&x.width?.baseVal?.value&&(C=x.width.baseVal.value),!U&&x.height?.baseVal?.value&&(U=x.height.baseVal.value),x.removeAttribute(\"width\"),x.removeAttribute(\"height\"),!x.getAttribute(\"viewBox\")&&C&&U&&x.setAttribute(\"viewBox\",`0 0 ${C} ${U}`),x.style.width=\"100%\",x.style.height=\"100%\",o.naturalWidth=C||800,o.naturalHeight=U||600}function R(x){o.svgString=x,r.canvas.innerHTML=x;let C=r.canvas.querySelector(\"svg\");C&&(M(C),S(x),o.firstRender?(oe(),o.firstRender=!1):b(),D())}function D(){r.empty.classList.add(\"hidden\"),r.canvas.classList.remove(\"dimmed\"),r.diagnostics.classList.remove(\"show\")}function X(x){r.empty.classList.add(\"hidden\"),o.svgString&&r.canvas.classList.add(\"dimmed\"),I(x),r.diagnostics.classList.add(\"show\")}function A(x){X([{severity:\"error\",code:\"preview-error\",message:x,file:\"\",line:1,column:1}])}function I(x){let C=0,U=0;for(let q of x)q.severity===\"warning\"?U++:C++;let Z=\"\";C&&(Z+=`${C}${C===1?\" error\":\" errors\"}`),C&&U&&(Z+=\", \"),U&&(Z+=`${U}${U===1?\" warning\":\" warnings\"}`),Z||(Z=\"No problems\"),r.diagSummary.textContent=Z,r.diagSummary.className=\"diag-summary\",!C&&U&&r.diagSummary.classList.add(\"warn-only\"),!C&&!U&&r.diagSummary.classList.add(\"clean\"),r.openProblems.hidden=C+U===0;let re=r.diagTbody;for(;re.firstChild;)re.removeChild(re.firstChild);for(let q of x){let g=n.createElement(\"tr\");g.dataset.file=q.file||\"\",g.dataset.line=String(q.line),g.dataset.column=String(q.column);let k=n.createElement(\"td\");k.className=`sev-cell ${q.severity===\"warning\"?\"sev-warning\":\"sev-error\"}`,k.textContent=q.severity===\"warning\"?\"\\u26A0\":\"!\",g.appendChild(k);let $=n.createElement(\"td\");$.className=\"loc-cell\",$.textContent=`Ln ${q.line}, ${q.column}`,g.appendChild($);let Y=n.createElement(\"td\");Y.className=\"code-cell\";let Ee=n.createElement(\"span\");Ee.className=\"code-pill\",Ee.textContent=q.code,Y.appendChild(Ee),g.appendChild(Y);let Ie=n.createElement(\"td\");if(Ie.className=\"msg-cell\",Ie.textContent=q.message,q.suggestion){let Pe=n.createElement(\"span\");Pe.className=\"suggestion\",Pe.textContent=`Did you mean '${q.suggestion}'?`,Ie.appendChild(Pe)}g.appendChild(Ie),re.appendChild(g)}}a(r.diagTbody,\"click\",x=>{let U=x.target?.closest(\"tr\");U&&e.onGoto?.({file:U.dataset.file??\"\",line:Number.parseInt(U.dataset.line??\"1\",10)||1,column:Number.parseInt(U.dataset.column??\"1\",10)||1})}),a(r.openProblems,\"click\",x=>{x.preventDefault(),e.onOpenProblems?.()});function S(x){if(!r.minimapCanvas)return;r.minimapCanvas.innerHTML=x;let C=r.minimapCanvas.querySelector(\"svg\");C&&(C.removeAttribute(\"width\"),C.removeAttribute(\"height\"),o.naturalWidth&&o.naturalHeight&&!C.getAttribute(\"viewBox\")&&C.setAttribute(\"viewBox\",`0 0 ${o.naturalWidth} ${o.naturalHeight}`),C.setAttribute(\"preserveAspectRatio\",\"xMidYMid meet\"));let U=120,Z=90;if(o.naturalWidth&&o.naturalHeight){let re=o.naturalWidth/o.naturalHeight,q=U,g=U/re;g>Z&&(g=Z,q=Z*re),r.minimap.style.width=`${Math.round(q)}px`,r.minimapCanvas.style.height=`${Math.round(g)}px`}}function G(){if(r.minimap.classList.contains(\"hidden\"))return;let x=o.naturalWidth*o.scale,C=o.naturalHeight*o.scale;if(!x||!C)return;let U=r.minimapCanvas.clientWidth,Z=r.minimapCanvas.clientHeight,re=Math.min(1,r.viewport.clientWidth/x)*U,q=Math.min(1,r.viewport.clientHeight/C)*Z,g=r.viewport.scrollLeft/x*U,k=r.viewport.scrollTop/C*Z;r.minimapRect.style.left=`${r.minimapCanvas.offsetLeft+g}px`,r.minimapRect.style.top=`${r.minimapCanvas.offsetTop+k}px`,r.minimapRect.style.width=`${re}px`,r.minimapRect.style.height=`${q}px`}function V(){if(!o.showMinimap){r.minimap.classList.add(\"hidden\");return}let x=o.naturalWidth*o.scale,C=o.naturalHeight*o.scale;x<=r.viewport.clientWidth+1&&C<=r.viewport.clientHeight+1?r.minimap.classList.add(\"hidden\"):r.minimap.classList.remove(\"hidden\")}function B(x,C){let U=r.minimapCanvas.getBoundingClientRect(),Z=(x-U.left)/U.width,re=(C-U.top)/U.height,q=o.naturalWidth*o.scale,g=o.naturalHeight*o.scale;r.viewport.scrollLeft=Math.max(0,Z*q-r.viewport.clientWidth/2),r.viewport.scrollTop=Math.max(0,re*g-r.viewport.clientHeight/2)}let K=!1;a(r.minimapCanvas,\"mousedown\",x=>{K=!0,B(x.clientX,x.clientY),x.preventDefault()}),a(n,\"mousemove\",x=>{K&&B(x.clientX,x.clientY)}),a(n,\"mouseup\",()=>{K=!1}),a(r.viewport,\"scroll\",G);let Q=null;function _e(){Q&&clearTimeout(Q),Q=setTimeout(()=>{Q=null,Ce(),G(),V(),T()},50)}if(a(i,\"resize\",_e),typeof ResizeObserver<\"u\"){let x=new ResizeObserver(_e);x.observe(r.viewport),s.push(()=>x.disconnect())}a(r.viewport,\"wheel\",x=>{if(!(x.ctrlKey||x.metaKey))return;x.preventDefault(),o.activeFit=\"manual\",o.isDirty=!0;let C=r.viewport.getBoundingClientRect(),U=x.clientX-C.left,Z=x.clientY-C.top,re=Math.exp(-x.deltaY*.01);F(o.scale*re,U,Z)},{passive:!1});let J=!1,ye=null;function nt(x){if(!x)return!1;let C=x;if(!C.tagName)return!1;let U=C.tagName.toUpperCase();return U===\"INPUT\"||U===\"TEXTAREA\"||C.isContentEditable}a(n,\"keydown\",x=>{nt(x.target)||(x.key===\" \"&&!J?(J=!0,r.viewport.style.cursor=\"grab\",x.preventDefault()):x.key===\"1\"?L():x.key===\"2\"?te():x.key===\"3\"?j():x.key===\"0\"&&L())}),a(n,\"keyup\",x=>{x.key===\" \"&&(J=!1,r.viewport.style.cursor=\"\")}),a(r.viewport,\"mousedown\",x=>{J&&(o.isDirty=!0,ye={x:x.clientX,y:x.clientY,sx:r.viewport.scrollLeft,sy:r.viewport.scrollTop},r.viewport.style.cursor=\"grabbing\",x.preventDefault())}),a(n,\"mousemove\",x=>{ye&&(r.viewport.scrollLeft=ye.sx-(x.clientX-ye.x),r.viewport.scrollTop=ye.sy-(x.clientY-ye.y))}),a(n,\"mouseup\",()=>{ye&&(ye=null,r.viewport.style.cursor=J?\"grab\":\"\")}),a(r.zoomOut,\"click\",()=>{o.activeFit=\"manual\",o.isDirty=!0,F(o.scale/1.1)}),a(r.zoomIn,\"click\",()=>{o.activeFit=\"manual\",o.isDirty=!0,F(o.scale*1.1)}),a(r.zoomReset,\"click\",te),a(r.fitWidth,\"click\",j),a(r.fitPage,\"click\",L);function Le(){r.formatMenu.hidden=!0,r.themeMenu.hidden=!0,r.nowPicker.hidden=!0,r.linksMenu.hidden=!0}function We(){r.moreMenu.hidden=!0,Le()}function z(x,C,U=!0){x.classList.remove(\"flip\"),x.style.maxHeight=\"\",x.style.overflowY=\"\",x.style.transform=\"\";let Z=t.getBoundingClientRect();if(Z.width===0&&Z.height===0)return;let re=w(),q=x.getBoundingClientRect(),g=q.width<=Z.width-2*re;(g&&C===\"left\"&&q.right>Z.right-re||g&&C===\"right\"&&q.left<Z.left+re)&&x.classList.add(\"flip\"),q=x.getBoundingClientRect();let k=0;if(q.right>Z.right-re&&(k=Z.right-re-q.right),q.left+k<Z.left+re&&(k=Z.left+re-q.left),k!==0&&(x.style.transform=`translateX(${Math.round(k)}px)`),U){q=x.getBoundingClientRect();let $=Z.bottom-re-q.top;q.height>$&&$>80&&(x.style.maxHeight=`${Math.round($)}px`,x.style.overflowY=\"auto\")}}a(n,\"click\",We),a(r.moreMenu,\"click\",x=>x.stopPropagation()),a(r.moreToggle,\"click\",x=>{x.stopPropagation();let C=r.moreMenu.hidden;We(),C&&(r.moreMenu.hidden=!1,z(r.moreMenu,\"right\",!1))}),a(r.formatToggle,\"click\",x=>{x.stopPropagation();let C=r.formatMenu.hidden;Le(),C&&(r.formatMenu.hidden=!1,z(r.formatMenu,\"left\"))}),a(r.formatMenu,\"click\",x=>{x.stopPropagation();let C=x.target.closest(\".format-opt\");if(!C)return;let U=C.getAttribute(\"data-value\");U&&(o.export.format=U,ne(),r.formatMenu.hidden=!0)});function ne(){r.formatToggle.textContent=`${o.export.format.toUpperCase()} \\u25BE`;for(let x of Array.from(r.formatMenu.querySelectorAll(\".format-opt\")))x.setAttribute(\"data-active\",(x.getAttribute(\"data-value\")===o.export.format).toString())}a(r.copyAction,\"click\",()=>{We(),ae(`copy-${o.export.format}`)}),a(r.exportAction,\"click\",()=>{We(),ae(`save-${o.export.format}`)});async function ae(x){if(o.svgString)try{if(x===\"save-svg\")e.onSave?.({format:\"svg\",body:o.svgString});else if(x===\"copy-svg\")try{await i.navigator.clipboard.writeText(o.svgString)}catch(C){e.onFatal?.(`Copy SVG failed: ${C.message}`)}else if(x===\"save-png\"){let U=await(await O()).arrayBuffer();e.onSave?.({format:\"png\",body:new Uint8Array(U)})}else if(x===\"copy-png\"){let C=i.ClipboardItem;if(typeof C>\"u\"||!i.navigator.clipboard?.write){let re=await(await O()).arrayBuffer();e.onCopyPngFallback?.(new Uint8Array(re));return}let U=e.onCopyPng?e.onCopyPng():O();try{await i.navigator.clipboard.write([new C({\"image/png\":U})])}catch{let re=await(await U).arrayBuffer();e.onCopyPngFallback?.(new Uint8Array(re))}}}catch(C){e.onFatal?.(`PNG render failed: ${C.message}`)}}function O(){return new Promise((x,C)=>{if(!o.svgString){C(new Error(\"No diagram to rasterize.\"));return}let U=new Blob([o.svgString],{type:\"image/svg+xml;charset=utf-8\"}),Z=i.URL.createObjectURL(U),re=new i.Image;re.onload=()=>{try{let q=i.devicePixelRatio||1,g=o.naturalWidth||re.naturalWidth||800,k=o.naturalHeight||re.naturalHeight||600,$=n.createElement(\"canvas\");$.width=Math.max(1,Math.round(g*q)),$.height=Math.max(1,Math.round(k*q));let Y=$.getContext(\"2d\");if(!Y)throw new Error(\"2D canvas context unavailable.\");Y.scale(q,q),Y.drawImage(re,0,0,g,k),i.URL.revokeObjectURL(Z),$.toBlob(Ee=>{Ee?x(Ee):C(new Error(\"canvas.toBlob returned null.\"))},\"image/png\")}catch(q){i.URL.revokeObjectURL(Z),C(q)}},re.onerror=()=>{i.URL.revokeObjectURL(Z),C(new Error(\"Failed to load SVG into <img> for rasterization.\"))},re.src=Z})}function Fe(x){r.themeMenu.innerHTML=\"\";let C=n.createElement(\"li\"),U=n.createElement(\"button\");U.className=\"btn theme-opt\",U.setAttribute(\"data-value\",\"auto\"),U.textContent=\"Auto\",C.appendChild(U),r.themeMenu.appendChild(C);for(let Z of x){let re=n.createElement(\"li\"),q=n.createElement(\"button\");q.className=\"btn theme-opt\",q.setAttribute(\"data-value\",Z);let g=n.createElement(\"code\");g.className=\"code-chip\",g.textContent=Z,q.appendChild(g),re.appendChild(q),r.themeMenu.appendChild(re)}ve()}a(r.themeToggle,\"click\",x=>{x.stopPropagation();let C=r.themeMenu.hidden;Le(),C&&(r.themeMenu.hidden=!1,z(r.themeMenu,\"left\"))}),a(r.themeMenu,\"click\",x=>{x.stopPropagation();let C=x.target.closest(\".theme-opt\");if(!C)return;let U=C.getAttribute(\"data-value\");U&&(o.view.theme=U,o.view.overridden.theme=!0,ve(),r.themeMenu.hidden=!0,en())});function ve(){if(o.view.theme===\"auto\")r.themeToggle.textContent=\"Auto \\u25BE\";else{r.themeToggle.innerHTML=\"\";let x=n.createElement(\"code\");x.className=\"code-chip\",x.textContent=o.view.theme,r.themeToggle.appendChild(x),r.themeToggle.appendChild(n.createTextNode(\" \\u25BE\"))}for(let x of Array.from(r.themeMenu.querySelectorAll(\".theme-opt\")))x.setAttribute(\"data-active\",(x.getAttribute(\"data-value\")===o.view.theme).toString())}let ke=new Date().getFullYear(),Ze=new Date().getMonth();function H(){let x=r.nowPicker;x.innerHTML=\"\";let C=ke,U=Ze,Z=n.createElement(\"div\");Z.className=\"cal-nav\";let re=n.createElement(\"button\");re.className=\"btn cal-nav-btn\",re.textContent=\"\\u2039\",re.addEventListener(\"click\",pe=>{pe.stopPropagation(),Ze--,Ze<0&&(Ze=11,ke--),H()});let q=n.createElement(\"span\");q.className=\"cal-heading\",q.textContent=new Intl.DateTimeFormat(o.locale,{month:\"long\",year:\"numeric\"}).format(new Date(C,U,1));let g=n.createElement(\"button\");g.className=\"btn cal-nav-btn\",g.textContent=\"\\u203A\",g.addEventListener(\"click\",pe=>{pe.stopPropagation(),Ze++,Ze>11&&(Ze=0,ke++),H()}),Z.appendChild(re),Z.appendChild(q),Z.appendChild(g),x.appendChild(Z);let k=n.createElement(\"div\");k.className=\"cal-grid\";for(let pe of[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"]){let we=n.createElement(\"span\");we.className=\"cal-dow\",we.textContent=pe,k.appendChild(we)}let $=new Date(C,U,1).getDay(),Y=new Date(C,U+1,0).getDate();for(let pe=0;pe<$;pe++){let we=n.createElement(\"span\");we.className=\"cal-empty\",k.appendChild(we)}let Ee=new Date,Ie=`${Ee.getFullYear()}-${String(Ee.getMonth()+1).padStart(2,\"0\")}-${String(Ee.getDate()).padStart(2,\"0\")}`;for(let pe=1;pe<=Y;pe++){let we=`${C}-${String(U+1).padStart(2,\"0\")}-${String(pe).padStart(2,\"0\")}`,Ue=n.createElement(\"button\");Ue.className=\"btn cal-day\",Ue.textContent=String(pe),we===Ie&&Ue.classList.add(\"is-today\"),o.view.now===we&&Ue.classList.add(\"is-selected\"),Ue.addEventListener(\"click\",it=>{it.stopPropagation(),Vt(we)}),k.appendChild(Ue)}x.appendChild(k);let Pe=n.createElement(\"div\");Pe.className=\"cal-footer\";let qe=n.createElement(\"button\");qe.className=\"btn cal-footer-btn\",qe.textContent=\"Today\",qe.addEventListener(\"click\",pe=>{pe.stopPropagation(),Vt(\"today\")});let Te=n.createElement(\"button\");Te.className=\"btn cal-footer-btn\",Te.textContent=\"None\",Te.addEventListener(\"click\",pe=>{pe.stopPropagation(),Vt(\"hide\")}),Pe.appendChild(qe),Pe.appendChild(Te),x.appendChild(Pe)}function Vt(x){o.view.now=x,o.view.overridden.now=!0,Bt(),r.nowPicker.hidden=!0,en()}a(r.nowToggle,\"click\",x=>{x.stopPropagation();let C=r.nowPicker.hidden;Le(),C&&(H(),r.nowPicker.hidden=!1,z(r.nowPicker,\"left\"))});function Bt(){let x;if(o.view.now===\"today\")x=\"Today\";else if(o.view.now===\"hide\")x=\"None\";else try{x=new Intl.DateTimeFormat(o.locale,{dateStyle:\"medium\"}).format(new Date(`${o.view.now}T00:00:00`))}catch{x=o.view.now}r.nowLabel.textContent=x}a(r.linksToggle,\"click\",x=>{x.stopPropagation();let C=r.linksMenu.hidden;Le(),C&&(r.linksMenu.hidden=!1,z(r.linksMenu,\"left\"))}),a(r.linksMenu,\"click\",x=>{x.stopPropagation();let C=x.target.closest(\".links-opt\");if(!C)return;let U=C.getAttribute(\"data-value\");U!==null&&(o.view.showLinks=U===\"true\",o.view.overridden.showLinks=!0,nr(),r.linksMenu.hidden=!0,en())});function nr(){r.linksToggle.textContent=`${o.view.showLinks?\"Yes\":\"No\"} \\u25BE`;for(let x of Array.from(r.linksMenu.querySelectorAll(\".links-opt\")))x.setAttribute(\"data-active\",(x.getAttribute(\"data-value\")===(o.view.showLinks?\"true\":\"false\")).toString())}function en(){let x={};o.view.overridden.theme&&(x.theme=o.view.theme),o.view.overridden.now&&(x.now=o.view.now),o.view.overridden.showLinks&&(x.showLinks=o.view.showLinks),e.onViewOptions?.(x)}function Re(){ve(),Bt(),nr(),ne()}if(e.themeControl===\"hide\"){let x=r.themeMenu.closest(\".theme-control-row\");x&&(x.style.display=\"none\")}return Fe(e.availableThemes??[\"light\",\"dark\",\"grayscale\"]),e.viewBaseline&&YC(o,e.viewBaseline,!0),Re(),V(),T(),{setSvg:R,setDiagnostics:X,setFatal:A,setViewBaseline(x,C=!1){YC(o,x,C),Re()},setDefaultFit(x){o.defaultFit=x},setShowMinimap(x){o.showMinimap=x,V()},setMode(x){let C=x===\"system\"?c():x;l(C)},setAvailableThemes(x){Fe(x)},setLocale(x){o.locale=x,Bt()},fitPage:L,fitWidth:j,actualSize:te,getZoom(){return o.scale},setZoom(x){o.activeFit=\"manual\",o.isDirty=!0,F(x)},dispose(){f&&clearTimeout(f),Q&&clearTimeout(Q);for(let x of s)x();s.length=0,t.classList.remove(\"nl-preview-root\"),t.removeAttribute(\"data-nl-mode\"),t.innerHTML=\"\"}}}function YC(t,e,r){e.theme&&!t.view.overridden.theme&&(t.view.theme=e.theme),e.now!==void 0&&!t.view.overridden.now&&(e.now===\"none\"||e.now===\"hide\"?t.view.now=\"hide\":typeof e.now==\"string\"&&/^\\d{4}-\\d{2}-\\d{2}$/.test(e.now)?t.view.now=e.now:t.view.now=\"today\"),e.showLinks!==void 0&&!t.view.overridden.showLinks&&(t.view.showLinks=e.showLinks!==!1),r&&(t.view.overridden={theme:!1,now:!1,showLinks:!1})}function e4(){let t=document.getElementById(\"nl-preview-data\");if(t?.textContent)try{return JSON.parse(t.textContent)}catch{return}}function t4(t){switch(t){case\"light\":case\"dark\":case\"grayscale\":case\"greyscale\":case\"auto\":return t;default:return\"auto\"}}function r4(t){switch(t){case\"light\":return\"light\";case\"dark\":return\"dark\";case\"grayscale\":case\"greyscale\":return\"grayscale\";default:return}}function n4(t){if(t!==\"today\")return t===\"hide\"||t===\"none\"?null:t}function i4(){let t=document.getElementById(\"nl-preview-root\");if(!t){console.error(\"nowline mcp preview: #nl-preview-root missing\");return}let e=e4();if(!e||typeof e.source!=\"string\")return;let{source:r,width:n,locale:i}=e,o={theme:t4(e.theme),now:e.now??\"today\",showLinks:e.showLinks!==!1},s;async function a(){if(s)try{let c=await kb(r,{theme:r4(o.theme),today:n4(o.now),width:n,locale:i,showLinks:o.showLinks});c.kind===\"svg\"?(s.setSvg(c.svg),s.setDiagnostics(c.warnings)):s.setDiagnostics(c.diagnostics)}catch(c){s.setFatal(c instanceof Error?c.message:String(c))}}s=Sb(t,{themeControl:\"show\",locale:i,initialFit:e.initialFit,showMinimap:e.showMinimap,viewBaseline:{theme:o.theme,now:o.now,showLinks:o.showLinks},onViewOptions:c=>{c.theme!==void 0&&(o.theme=c.theme),c.now!==void 0&&(o.now=c.now),c.showLinks!==void 0&&(o.showLinks=c.showLinks),a()},onSave:c=>{try{let l=c.format===\"png\"?\"image/png\":\"image/svg+xml\",u=new Blob([c.body],{type:l}),f=URL.createObjectURL(u),d=document.createElement(\"a\");d.href=f,d.download=`roadmap.${c.format}`,d.click(),setTimeout(()=>URL.revokeObjectURL(f),1e3)}catch{}}}),a()}i4();})();\n";
|
|
10
|
+
//# sourceMappingURL=ui-bundle.js.map
|