@jaabiri/bmad-studio 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/index.js +1996 -0
  2. package/package.json +53 -0
  3. package/ui-dist/assets/_baseUniq-B_n4QFRL.js +1 -0
  4. package/ui-dist/assets/_workflowId.lazy-FP56r40x.js +12 -0
  5. package/ui-dist/assets/arc-D8SlLs2L.js +1 -0
  6. package/ui-dist/assets/architectureDiagram-Q4EWVU46-BhKy9qBN.js +36 -0
  7. package/ui-dist/assets/blockDiagram-DXYQGD6D-DHQ9TuqQ.js +132 -0
  8. package/ui-dist/assets/c4Diagram-AHTNJAMY-BTPifryG.js +10 -0
  9. package/ui-dist/assets/channel-qsfw27Pz.js +1 -0
  10. package/ui-dist/assets/chevron-right-C3gMQbwP.js +1 -0
  11. package/ui-dist/assets/chunk-4BX2VUAB-DJJtjuLz.js +1 -0
  12. package/ui-dist/assets/chunk-4TB4RGXK-ONYWO0S_.js +206 -0
  13. package/ui-dist/assets/chunk-55IACEB6-CKub8aEM.js +1 -0
  14. package/ui-dist/assets/chunk-EDXVE4YY-c2zVzCwr.js +1 -0
  15. package/ui-dist/assets/chunk-FMBD7UC4-CnUcBH4x.js +15 -0
  16. package/ui-dist/assets/chunk-OYMX7WX6-DI7UEGCn.js +231 -0
  17. package/ui-dist/assets/chunk-QZHKN3VN-Dlq9g4FR.js +1 -0
  18. package/ui-dist/assets/chunk-YZCP3GAM-CpE3yTZs.js +1 -0
  19. package/ui-dist/assets/classDiagram-6PBFFD2Q-C6zNtups.js +1 -0
  20. package/ui-dist/assets/classDiagram-v2-HSJHXN6E-C6zNtups.js +1 -0
  21. package/ui-dist/assets/clone-lFRGLeBs.js +1 -0
  22. package/ui-dist/assets/cose-bilkent-S5V4N54A-BcwRulTx.js +1 -0
  23. package/ui-dist/assets/cytoscape.esm-5J0xJHOV.js +321 -0
  24. package/ui-dist/assets/dagre-KV5264BT-kD6LwyTY.js +4 -0
  25. package/ui-dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  26. package/ui-dist/assets/diagram-5BDNPKRD-7BtLyPf7.js +10 -0
  27. package/ui-dist/assets/diagram-G4DWMVQ6-BeU21gzV.js +24 -0
  28. package/ui-dist/assets/diagram-MMDJMWI5-BcZe7DAu.js +43 -0
  29. package/ui-dist/assets/diagram-TYMM5635-30qZErT6.js +24 -0
  30. package/ui-dist/assets/erDiagram-SMLLAGMA-DZzYsGd-.js +85 -0
  31. package/ui-dist/assets/flowDiagram-DWJPFMVM-CEyo_5fY.js +162 -0
  32. package/ui-dist/assets/ganttDiagram-T4ZO3ILL-CdxjNHta.js +292 -0
  33. package/ui-dist/assets/gitGraphDiagram-UUTBAWPF-OI6nqhRA.js +106 -0
  34. package/ui-dist/assets/graph-CJuDDeAK.js +1 -0
  35. package/ui-dist/assets/index-1QFQcLya.js +56 -0
  36. package/ui-dist/assets/index-BvVxlmMK.js +29 -0
  37. package/ui-dist/assets/index-DPA4A8ah.js +9 -0
  38. package/ui-dist/assets/index-DbkfLjQe.js +1 -0
  39. package/ui-dist/assets/index-cvXQBc8Y.css +1 -0
  40. package/ui-dist/assets/infoDiagram-42DDH7IO-Bgvk_VTG.js +2 -0
  41. package/ui-dist/assets/init-Gi6I4Gst.js +1 -0
  42. package/ui-dist/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  43. package/ui-dist/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  44. package/ui-dist/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  45. package/ui-dist/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  46. package/ui-dist/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  47. package/ui-dist/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  48. package/ui-dist/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  49. package/ui-dist/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  50. package/ui-dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  51. package/ui-dist/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  52. package/ui-dist/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  53. package/ui-dist/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  54. package/ui-dist/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  55. package/ui-dist/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  56. package/ui-dist/assets/ishikawaDiagram-UXIWVN3A-Cz2e8g4P.js +70 -0
  57. package/ui-dist/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  58. package/ui-dist/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  59. package/ui-dist/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  60. package/ui-dist/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  61. package/ui-dist/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  62. package/ui-dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  63. package/ui-dist/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  64. package/ui-dist/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  65. package/ui-dist/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  66. package/ui-dist/assets/journeyDiagram-VCZTEJTY-B7EdpiRX.js +139 -0
  67. package/ui-dist/assets/kanban-definition-6JOO6SKY-DiUf0qIs.js +89 -0
  68. package/ui-dist/assets/katex-BzTkCl_B.js +265 -0
  69. package/ui-dist/assets/layout-BhnDrrIT.js +1 -0
  70. package/ui-dist/assets/linear-BDwQpyTv.js +1 -0
  71. package/ui-dist/assets/mermaid.core-BR4XzyQe.js +303 -0
  72. package/ui-dist/assets/min-BJhF9j1-.js +1 -0
  73. package/ui-dist/assets/mindmap-definition-QFDTVHPH-D05ylhL6.js +96 -0
  74. package/ui-dist/assets/minus-M76p8_Mr.js +1 -0
  75. package/ui-dist/assets/ordinal-Cboi1Yqb.js +1 -0
  76. package/ui-dist/assets/pieDiagram-DEJITSTG-Bn-HlZLK.js +30 -0
  77. package/ui-dist/assets/proxy-B7DZsNQK.js +1 -0
  78. package/ui-dist/assets/quadrantDiagram-34T5L4WZ-BElRpUWb.js +7 -0
  79. package/ui-dist/assets/requirementDiagram-MS252O5E-CHPWxs3l.js +84 -0
  80. package/ui-dist/assets/sankeyDiagram-XADWPNL6-tlvafq0R.js +10 -0
  81. package/ui-dist/assets/sequenceDiagram-FGHM5R23-FgarYdCI.js +157 -0
  82. package/ui-dist/assets/sprint.lazy-CPHJj3lM.js +1 -0
  83. package/ui-dist/assets/stateDiagram-FHFEXIEX-BMEGKFsF.js +1 -0
  84. package/ui-dist/assets/stateDiagram-v2-QKLJ7IA2-BzoNePd4.js +1 -0
  85. package/ui-dist/assets/timeline-definition-GMOUNBTQ-REImLpEb.js +120 -0
  86. package/ui-dist/assets/timeline.lazy-BY5ZUkY-.js +1 -0
  87. package/ui-dist/assets/tooltip-DA8LKiqR.js +1 -0
  88. package/ui-dist/assets/validators-2LNt2eLU.js +1 -0
  89. package/ui-dist/assets/vennDiagram-DHZGUBPP-DcFGfj6d.js +34 -0
  90. package/ui-dist/assets/wardley-RL74JXVD-B9TLQgzI.js +162 -0
  91. package/ui-dist/assets/wardleyDiagram-NUSXRM2D-Hcgh3jSX.js +20 -0
  92. package/ui-dist/assets/x-CPRWsjef.js +1 -0
  93. package/ui-dist/assets/xychartDiagram-5P7HB3ND-BTe2ICiH.js +7 -0
  94. package/ui-dist/favicon.ico +0 -0
  95. package/ui-dist/index.html +32 -0
  96. package/ui-dist/logo192.png +0 -0
  97. package/ui-dist/logo512.png +0 -0
  98. package/ui-dist/manifest.json +25 -0
  99. package/ui-dist/robots.txt +3 -0
@@ -0,0 +1,162 @@
1
+ import{a3 as vg,_ as er}from"./index-1QFQcLya.js";import{m as hr,f as $g,d as Ag}from"./min-BJhF9j1-.js";import{b as Eg,l as Cg,c as Sg,m as wg,r as uf,n as Qo}from"./_baseUniq-B_n4QFRL.js";import{ba as bg}from"./mermaid.core-BR4XzyQe.js";function _g(t,e){return Eg(hr(t,e))}function Ng(t,e){return t&&t.length?Cg(t,Sg(e)):[]}function Ye(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function It(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function Pr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function kg(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Gi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class qp{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const 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){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Ye(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function $a(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Bp(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Wp(t){return $a(t)&&typeof t.fullText=="string"}class We{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const 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(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let 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){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new We(()=>({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 ft})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Ig(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new We(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ft:{done:!1,value:e(i)}})}filter(e){return new We(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ft})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new We(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(eo(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ft})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new We(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(eo(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ft})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new We(()=>{const 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 We(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ft:this.nextFn(r.state)))}distinct(e){return new We(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ft})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function Ig(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function eo(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Kp=new We(()=>{},()=>ft),ft=Object.freeze({done:!0,value:void 0});function Te(...t){if(t.length===1){const e=t[0];if(e instanceof We)return e;if(eo(e))return new We(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new We(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:ft)}return t.length>1?new We(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const 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){const r=t[e.collIndex++];eo(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return ft}):Kp}class $c extends We{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;){const 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 ft})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Pl;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(Pl||(Pl={}));function Ol(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ye(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Ol(i,e))}):Ye(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Ol(n,e)))}function wo(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function mr(t){const r=Fs(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Fs(t){for(;t.$container;)t=t.$container;return t}function cf(t){return It(t)?t.ref?[t.ref]:[]:Pr(t)?t.items.map(e=>e.ref):[]}function Ac(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e?.range;return new We(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Ye(a)){if(n.keyIndex++,ff(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Ye(o)&&ff(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return ft})}function Ma(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new $c(t,r=>Ac(r,e))}function gr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new $c(t,r=>Ac(r,e),{includeRoot:!0})}function ff(t,e){if(!e)return!0;const r=t.$cstNode?.range;return r?ey(r,e):!1}function to(t){return new We(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(It(n)||Pr(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(It(a)||Pr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return ft})}function Pg(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Vp(i.defaultValue))}function Vp(t){return Array.isArray(t)?[...t.map(Vp)]:t}const ct={$type:"AbstractElement",cardinality:"cardinality"};function Og(t){return te.isInstance(t,ct.$type)}const Gs={$type:"AbstractParserRule"};function Fa(t){return te.isInstance(t,Gs.$type)}const gs={$type:"AbstractRule"},_t={$type:"AbstractType"},tn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function bo(t){return te.isInstance(t,tn.$type)}const zs={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Hp(t){return te.isInstance(t,zs.$type)}const df={$type:"ArrayLiteral",elements:"elements"},pf={$type:"ArrayType",elementType:"elementType"},rn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function cn(t){return te.isInstance(t,rn.$type)}const Ll={$type:"BooleanLiteral",true:"true"};function Lg(t){return te.isInstance(t,Ll.$type)}const nn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function xg(t){return te.isInstance(t,nn.$type)}const Sn={$type:"Condition"},Us={$type:"Conjunction",left:"left",right:"right"};function Dg(t){return te.isInstance(t,Us.$type)}const an={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function _o(t){return te.isInstance(t,an.$type)}const js={$type:"Disjunction",left:"left",right:"right"};function Mg(t){return te.isInstance(t,js.$type)}const xl={$type:"EndOfFile",cardinality:"cardinality"};function Fg(t){return te.isInstance(t,xl.$type)}const Ur={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},hf={$type:"GrammarImport",path:"path"},In={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Ec(t){return te.isInstance(t,In.$type)}const Dl={$type:"InferredType",name:"name"};function Yp(t){return te.isInstance(t,Dl.$type)}const ur={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function ro(t){return te.isInstance(t,ur.$type)}const el={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},mf={$type:"InfixRuleOperators",precedences:"precedences"},ca={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Gg(t){return te.isInstance(t,ca.$type)}const fa={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function fn(t){return te.isInstance(t,fa.$type)}const ys={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Pn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function zg(t){return te.isInstance(t,Pn.$type)}const Ml={$type:"Negation",value:"value"};function Ug(t){return te.isInstance(t,Ml.$type)}const gf={$type:"NumberLiteral",value:"value"},Ts={$type:"Parameter",name:"name"},Fl={$type:"ParameterReference",parameter:"parameter"};function jg(t){return te.isInstance(t,Fl.$type)}const zt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function $r(t){return te.isInstance(t,zt.$type)}const tl={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},On={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function qg(t){return te.isInstance(t,On.$type)}const Gl={$type:"ReturnType",name:"name"};function Bg(t){return te.isInstance(t,Gl.$type)}const Ln={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function dn(t){return te.isInstance(t,Ln.$type)}const da={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Wg(t){return te.isInstance(t,da.$type)}const yf={$type:"StringLiteral",value:"value"},xn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Kg(t){return te.isInstance(t,xn.$type)}const yt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Dn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Vg(t){return te.isInstance(t,Dn.$type)}const Ir={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Ar(t){return te.isInstance(t,Ir.$type)}const Mn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Hg(t){return te.isInstance(t,Mn.$type)}const qs={$type:"Type",name:"name",type:"type"};function Yg(t){return te.isInstance(t,qs.$type)}const zi={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},Ui={$type:"TypeDefinition"},Tf={$type:"UnionType",types:"types"},Bs={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Xp(t){return te.isInstance(t,Bs.$type)}const Fn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Xg(t){return te.isInstance(t,Fn.$type)}const ji={$type:"ValueLiteral"},pa={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Jg(t){return te.isInstance(t,pa.$type)}class Jp extends qp{constructor(){super(...arguments),this.types={AbstractElement:{name:ct.$type,properties:{cardinality:{name:ct.cardinality}},superTypes:[]},AbstractParserRule:{name:Gs.$type,properties:{},superTypes:[gs.$type,_t.$type]},AbstractRule:{name:gs.$type,properties:{},superTypes:[]},AbstractType:{name:_t.$type,properties:{},superTypes:[]},Action:{name:tn.$type,properties:{cardinality:{name:tn.cardinality},feature:{name:tn.feature},inferredType:{name:tn.inferredType},operator:{name:tn.operator},type:{name:tn.type,referenceType:_t.$type}},superTypes:[ct.$type]},Alternatives:{name:zs.$type,properties:{cardinality:{name:zs.cardinality},elements:{name:zs.elements,defaultValue:[]}},superTypes:[ct.$type]},ArrayLiteral:{name:df.$type,properties:{elements:{name:df.elements,defaultValue:[]}},superTypes:[ji.$type]},ArrayType:{name:pf.$type,properties:{elementType:{name:pf.elementType}},superTypes:[Ui.$type]},Assignment:{name:rn.$type,properties:{cardinality:{name:rn.cardinality},feature:{name:rn.feature},operator:{name:rn.operator},predicate:{name:rn.predicate},terminal:{name:rn.terminal}},superTypes:[ct.$type]},BooleanLiteral:{name:Ll.$type,properties:{true:{name:Ll.true,defaultValue:!1}},superTypes:[Sn.$type,ji.$type]},CharacterRange:{name:nn.$type,properties:{cardinality:{name:nn.cardinality},left:{name:nn.left},lookahead:{name:nn.lookahead},parenthesized:{name:nn.parenthesized,defaultValue:!1},right:{name:nn.right}},superTypes:[yt.$type]},Condition:{name:Sn.$type,properties:{},superTypes:[]},Conjunction:{name:Us.$type,properties:{left:{name:Us.left},right:{name:Us.right}},superTypes:[Sn.$type]},CrossReference:{name:an.$type,properties:{cardinality:{name:an.cardinality},deprecatedSyntax:{name:an.deprecatedSyntax,defaultValue:!1},isMulti:{name:an.isMulti,defaultValue:!1},terminal:{name:an.terminal},type:{name:an.type,referenceType:_t.$type}},superTypes:[ct.$type]},Disjunction:{name:js.$type,properties:{left:{name:js.left},right:{name:js.right}},superTypes:[Sn.$type]},EndOfFile:{name:xl.$type,properties:{cardinality:{name:xl.cardinality}},superTypes:[ct.$type]},Grammar:{name:Ur.$type,properties:{imports:{name:Ur.imports,defaultValue:[]},interfaces:{name:Ur.interfaces,defaultValue:[]},isDeclared:{name:Ur.isDeclared,defaultValue:!1},name:{name:Ur.name},rules:{name:Ur.rules,defaultValue:[]},types:{name:Ur.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:hf.$type,properties:{path:{name:hf.path}},superTypes:[]},Group:{name:In.$type,properties:{cardinality:{name:In.cardinality},elements:{name:In.elements,defaultValue:[]},guardCondition:{name:In.guardCondition},predicate:{name:In.predicate}},superTypes:[ct.$type]},InferredType:{name:Dl.$type,properties:{name:{name:Dl.name}},superTypes:[_t.$type]},InfixRule:{name:ur.$type,properties:{call:{name:ur.call},dataType:{name:ur.dataType},inferredType:{name:ur.inferredType},name:{name:ur.name},operators:{name:ur.operators},parameters:{name:ur.parameters,defaultValue:[]},returnType:{name:ur.returnType,referenceType:_t.$type}},superTypes:[Gs.$type]},InfixRuleOperatorList:{name:el.$type,properties:{associativity:{name:el.associativity},operators:{name:el.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:mf.$type,properties:{precedences:{name:mf.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ca.$type,properties:{attributes:{name:ca.attributes,defaultValue:[]},name:{name:ca.name},superTypes:{name:ca.superTypes,defaultValue:[],referenceType:_t.$type}},superTypes:[_t.$type]},Keyword:{name:fa.$type,properties:{cardinality:{name:fa.cardinality},predicate:{name:fa.predicate},value:{name:fa.value}},superTypes:[ct.$type]},NamedArgument:{name:ys.$type,properties:{calledByName:{name:ys.calledByName,defaultValue:!1},parameter:{name:ys.parameter,referenceType:Ts.$type},value:{name:ys.value}},superTypes:[]},NegatedToken:{name:Pn.$type,properties:{cardinality:{name:Pn.cardinality},lookahead:{name:Pn.lookahead},parenthesized:{name:Pn.parenthesized,defaultValue:!1},terminal:{name:Pn.terminal}},superTypes:[yt.$type]},Negation:{name:Ml.$type,properties:{value:{name:Ml.value}},superTypes:[Sn.$type]},NumberLiteral:{name:gf.$type,properties:{value:{name:gf.value}},superTypes:[ji.$type]},Parameter:{name:Ts.$type,properties:{name:{name:Ts.name}},superTypes:[]},ParameterReference:{name:Fl.$type,properties:{parameter:{name:Fl.parameter,referenceType:Ts.$type}},superTypes:[Sn.$type]},ParserRule:{name:zt.$type,properties:{dataType:{name:zt.dataType},definition:{name:zt.definition},entry:{name:zt.entry,defaultValue:!1},fragment:{name:zt.fragment,defaultValue:!1},inferredType:{name:zt.inferredType},name:{name:zt.name},parameters:{name:zt.parameters,defaultValue:[]},returnType:{name:zt.returnType,referenceType:_t.$type}},superTypes:[Gs.$type]},ReferenceType:{name:tl.$type,properties:{isMulti:{name:tl.isMulti,defaultValue:!1},referenceType:{name:tl.referenceType}},superTypes:[Ui.$type]},RegexToken:{name:On.$type,properties:{cardinality:{name:On.cardinality},lookahead:{name:On.lookahead},parenthesized:{name:On.parenthesized,defaultValue:!1},regex:{name:On.regex}},superTypes:[yt.$type]},ReturnType:{name:Gl.$type,properties:{name:{name:Gl.name}},superTypes:[]},RuleCall:{name:Ln.$type,properties:{arguments:{name:Ln.arguments,defaultValue:[]},cardinality:{name:Ln.cardinality},predicate:{name:Ln.predicate},rule:{name:Ln.rule,referenceType:gs.$type}},superTypes:[ct.$type]},SimpleType:{name:da.$type,properties:{primitiveType:{name:da.primitiveType},stringType:{name:da.stringType},typeRef:{name:da.typeRef,referenceType:_t.$type}},superTypes:[Ui.$type]},StringLiteral:{name:yf.$type,properties:{value:{name:yf.value}},superTypes:[ji.$type]},TerminalAlternatives:{name:xn.$type,properties:{cardinality:{name:xn.cardinality},elements:{name:xn.elements,defaultValue:[]},lookahead:{name:xn.lookahead},parenthesized:{name:xn.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalElement:{name:yt.$type,properties:{cardinality:{name:yt.cardinality},lookahead:{name:yt.lookahead},parenthesized:{name:yt.parenthesized,defaultValue:!1}},superTypes:[ct.$type]},TerminalGroup:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},elements:{name:Dn.elements,defaultValue:[]},lookahead:{name:Dn.lookahead},parenthesized:{name:Dn.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalRule:{name:Ir.$type,properties:{definition:{name:Ir.definition},fragment:{name:Ir.fragment,defaultValue:!1},hidden:{name:Ir.hidden,defaultValue:!1},name:{name:Ir.name},type:{name:Ir.type}},superTypes:[gs.$type]},TerminalRuleCall:{name:Mn.$type,properties:{cardinality:{name:Mn.cardinality},lookahead:{name:Mn.lookahead},parenthesized:{name:Mn.parenthesized,defaultValue:!1},rule:{name:Mn.rule,referenceType:Ir.$type}},superTypes:[yt.$type]},Type:{name:qs.$type,properties:{name:{name:qs.name},type:{name:qs.type}},superTypes:[_t.$type]},TypeAttribute:{name:zi.$type,properties:{defaultValue:{name:zi.defaultValue},isOptional:{name:zi.isOptional,defaultValue:!1},name:{name:zi.name},type:{name:zi.type}},superTypes:[]},TypeDefinition:{name:Ui.$type,properties:{},superTypes:[]},UnionType:{name:Tf.$type,properties:{types:{name:Tf.types,defaultValue:[]}},superTypes:[Ui.$type]},UnorderedGroup:{name:Bs.$type,properties:{cardinality:{name:Bs.cardinality},elements:{name:Bs.elements,defaultValue:[]}},superTypes:[ct.$type]},UntilToken:{name:Fn.$type,properties:{cardinality:{name:Fn.cardinality},lookahead:{name:Fn.lookahead},parenthesized:{name:Fn.parenthesized,defaultValue:!1},terminal:{name:Fn.terminal}},superTypes:[yt.$type]},ValueLiteral:{name:ji.$type,properties:{},superTypes:[]},Wildcard:{name:pa.$type,properties:{cardinality:{name:pa.cardinality},lookahead:{name:pa.lookahead},parenthesized:{name:pa.parenthesized,defaultValue:!1}},superTypes:[yt.$type]}}}}const te=new Jp;function zl(t){return new $c(t,e=>$a(e)?e.content:[],{includeRoot:!0})}function Zg(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ul(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function no(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var dr;(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"})(dr||(dr={}));function Qg(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return dr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return dr.After;const 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?dr.Inside:r?dr.OverlapBack:n?dr.OverlapFront:dr.Outside}function ey(t,e){return Qg(t,e)>dr.After}const ty=/^[\w\p{L}]$/u;function ry(t,e){if(t){const r=ny(t,!0);if(r&&Rf(r,e))return r;if(Wp(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Rf(a,e))return a}}}}function Rf(t,e){return Bp(t)&&e.includes(t.tokenType.name)}function ny(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class Zp extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function Ga(t,e="Error: Got unexpected value."){throw new Error(e)}function W(t){return t.charCodeAt(0)}function rl(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function qi(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function wn(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function iy(){throw Error("Internal Error - Should never get here!")}function vf(t){return t.type==="Character"}const io=[];for(let t=W("0");t<=W("9");t++)io.push(t);const ao=[W("_")].concat(io);for(let t=W("a");t<=W("z");t++)ao.push(t);for(let t=W("A");t<=W("Z");t++)ao.push(t);const $f=[W(" "),W("\f"),W(`
2
+ `),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],ay=/[0-9a-fA-F]/,Rs=/[0-9]/,sy=/[1-9]/;class Qp{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("/");const r=this.disjunction();this.consumeChar("/");const 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":qi(n,"global");break;case"i":qi(n,"ignoreCase");break;case"m":qi(n,"multiLine");break;case"u":qi(n,"unicode");break;case"y":qi(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(){const 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(){const 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(){const 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}}wn(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return iy()}quantifier(e=!1){let r;const 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"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;wn(r);break}if(!(e===!0&&r===void 0)&&wn(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;const 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}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),wn(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
3
+ `),W("\r"),W("\u2028"),W("\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=io;break;case"D":e=io,r=!0;break;case"s":e=$f;break;case"S":e=$f,r=!0;break;case"w":e=ao;break;case"W":e=ao,r=!0;break}if(wn(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
4
+ `);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(wn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const 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:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:W(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,vf(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,vf(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else rl(n.value,e),e.push(W("-")),rl(i.value,e)}else rl(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
+ `: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:W("\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++;const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(sy.test(e)===!1)throw Error("Expecting a positive integer");for(;Rs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Rs.test(e)===!1)throw Error("Expecting an integer");for(;Rs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
+ `: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:W(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 Rs.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
+ `: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(){const 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`
9
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){const a=this.popChar();if(ay.test(a)===!1)throw Error("Expecting a HexDecimal digits");r+=a}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const 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}}}class No{visitChildren(e){for(const r in e){const 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){}}const oy=/\r?\n/gm,ly=new Qp;class uy extends No{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){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
10
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=ko(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
11
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const 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)}}const nl=new uy;function cy(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),nl.reset(t),nl.visit(ly.pattern(t)),nl.multiline}catch{return!1}}const fy=`\f
12
+ \r \v              \u2028\u2029   \uFEFF`.split("");function eh(t){const e=typeof t=="string"?new RegExp(t):t;return fy.some(r=>e.test(r))}function ko(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dy(t,e){const r=py(t),n=e.match(r);return!!n&&n[0].length>0}function py(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return new RegExp(i(),t.flags)}function hy(t){return t.rules.find(e=>$r(e)&&e.entry)}function my(t){return t.rules.filter(e=>Ar(e)&&e.hidden)}function th(t,e){const r=new Set,n=hy(t);if(!n)return new Set(t.rules);const i=[n].concat(my(t));for(const s of i)rh(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Ar(s)&&s.hidden)&&a.add(s);return a}function rh(t,e,r){e.add(t.name),Ma(t).forEach(n=>{if(dn(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&rh(i,e,r)}})}function gy(t){if(t.terminal)return t.terminal;if(t.type.ref)return ih(t.type.ref)?.terminal}function yy(t){return t.hidden&&!eh(Sc(t))}function Ty(t,e){return!t||!e?[]:Cc(t,e,t.astNode,!0)}function nh(t,e,r){if(!t||!e)return;const n=Cc(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 Cc(t,e,r,n){if(!n){const i=wo(t.grammarSource,cn);if(i&&i.feature===e)return[t]}return $a(t)&&t.astNode===r?t.content.flatMap(i=>Cc(i,e,r,!1)):[]}function Ry(t,e,r){if(!t)return;const n=vy(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 vy(t,e,r){if(t.astNode!==r)return[];if(fn(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=zl(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?fn(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function $y(t){const e=t.astNode;for(;e===t.container?.astNode;){const r=wo(t.grammarSource,cn);if(r)return r;t=t.container}}function ih(t){let e=t;return Yp(e)&&(bo(e.$container)?e=e.$container.$container:Fa(e.$container)?e=e.$container:Ga(e.$container)),ah(t,e,new Map)}function ah(t,e,r){function n(i,a){let s;return wo(i,cn)||(s=ah(a,a,r)),r.set(t,s),s}if(r.has(t))return r.get(t);r.set(t,void 0);for(const i of Ma(e)){if(cn(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(dn(i)&&$r(i.rule.ref))return n(i,i.rule.ref);if(Wg(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function sh(t){return oh(t,new Set)}function oh(t,e){if(e.has(t))return!0;e.add(t);for(const r of Ma(t))if(dn(r)){if(!r.rule.ref||$r(r.rule.ref)&&!oh(r.rule.ref,e)||ro(r.rule.ref))return!1}else{if(cn(r))return!1;if(bo(r))return!1}return!!t.definition}function lh(t){if(!Ar(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}function Aa(t){if(Fa(t))return $r(t)&&sh(t)?t.name:lh(t)??t.name;if(Gg(t)||Yg(t)||Bg(t))return t.name;if(bo(t)){const e=Ay(t);if(e)return e}else if(Yp(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Ay(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return Aa(t.type.ref)}function Ey(t){return Ar(t)?t.type?.name??"string":lh(t)??t.name}function Sc(t){const e={s:!1,i:!1,u:!1},r=$i(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const wc=/[\s\S]/.source;function $i(t,e){if(Kg(t))return Cy(t);if(Vg(t))return Sy(t);if(xg(t))return _y(t);if(Hg(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return yr($i(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(zg(t))return by(t);if(Xg(t))return wy(t);if(qg(t)){const 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")),yr(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Jg(t))return yr(wc,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function Cy(t){return yr(t.elements.map(e=>$i(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Sy(t){return yr(t.elements.map(e=>$i(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function wy(t){return yr(`${wc}*?${$i(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function by(t){return yr(`(?!${$i(t.terminal)})${wc}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function _y(t){return t.right?yr(`[${il(t.left)}-${il(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):yr(il(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function il(t){return ko(t.value)}function yr(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Ny(t){const e=[],r=t.Grammar;for(const n of r.rules)Ar(n)&&yy(n)&&cy(Sc(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ty}}var uh=typeof global=="object"&&global&&global.Object===Object&&global,ky=typeof self=="object"&&self&&self.Object===Object&&self,Wt=uh||ky||Function("return this")(),vt=Wt.Symbol,ch=Object.prototype,Iy=ch.hasOwnProperty,Py=ch.toString,Bi=vt?vt.toStringTag:void 0;function Oy(t){var e=Iy.call(t,Bi),r=t[Bi];try{t[Bi]=void 0;var n=!0}catch{}var i=Py.call(t);return n&&(e?t[Bi]=r:delete t[Bi]),i}var Ly=Object.prototype,xy=Ly.toString;function Dy(t){return xy.call(t)}var My="[object Null]",Fy="[object Undefined]",Af=vt?vt.toStringTag:void 0;function Mr(t){return t==null?t===void 0?Fy:My:Af&&Af in Object(t)?Oy(t):Dy(t)}function xt(t){return t!=null&&typeof t=="object"}var Gy="[object Symbol]";function Io(t){return typeof t=="symbol"||xt(t)&&Mr(t)==Gy}function Po(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 Q=Array.isArray,Ef=vt?vt.prototype:void 0,Cf=Ef?Ef.toString:void 0;function fh(t){if(typeof t=="string")return t;if(Q(t))return Po(t,fh)+"";if(Io(t))return Cf?Cf.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var zy=/\s/;function Uy(t){for(var e=t.length;e--&&zy.test(t.charAt(e)););return e}var jy=/^\s+/;function qy(t){return t&&t.slice(0,Uy(t)+1).replace(jy,"")}function $t(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Sf=NaN,By=/^[-+]0x[0-9a-f]+$/i,Wy=/^0b[01]+$/i,Ky=/^0o[0-7]+$/i,Vy=parseInt;function Hy(t){if(typeof t=="number")return t;if(Io(t))return Sf;if($t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=qy(t);var r=Wy.test(t);return r||Ky.test(t)?Vy(t.slice(2),r?2:8):By.test(t)?Sf:+t}var wf=1/0,Yy=17976931348623157e292;function Xy(t){if(!t)return t===0?t:0;if(t=Hy(t),t===wf||t===-wf){var e=t<0?-1:1;return e*Yy}return t===t?t:0}function Oo(t){var e=Xy(t),r=e%1;return e===e?r?e-r:e:0}function za(t){return t}var Jy="[object AsyncFunction]",Zy="[object Function]",Qy="[object GeneratorFunction]",eT="[object Proxy]";function Er(t){if(!$t(t))return!1;var e=Mr(t);return e==Zy||e==Qy||e==Jy||e==eT}var al=Wt["__core-js_shared__"],bf=(function(){var t=/[^.]+$/.exec(al&&al.keys&&al.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function tT(t){return!!bf&&bf in t}var rT=Function.prototype,nT=rT.toString;function Tn(t){if(t!=null){try{return nT.call(t)}catch{}try{return t+""}catch{}}return""}var iT=/[\\^$.*+?()[\]{}|]/g,aT=/^\[object .+?Constructor\]$/,sT=Function.prototype,oT=Object.prototype,lT=sT.toString,uT=oT.hasOwnProperty,cT=RegExp("^"+lT.call(uT).replace(iT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fT(t){if(!$t(t)||tT(t))return!1;var e=Er(t)?cT:aT;return e.test(Tn(t))}function dT(t,e){return t?.[e]}function Rn(t,e){var r=dT(t,e);return fT(r)?r:void 0}var jl=Rn(Wt,"WeakMap"),_f=Object.create,pT=(function(){function t(){}return function(e){if(!$t(e))return{};if(_f)return _f(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function hT(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Me(){}function mT(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var gT=800,yT=16,TT=Date.now;function RT(t){var e=0,r=0;return function(){var n=TT(),i=yT-(n-r);if(r=n,i>0){if(++e>=gT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function vT(t){return function(){return t}}var so=(function(){try{var t=Rn(Object,"defineProperty");return t({},"",{}),t}catch{}})(),$T=so?function(t,e){return so(t,"toString",{configurable:!0,enumerable:!1,value:vT(e),writable:!0})}:za,AT=RT($T);function dh(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ph(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function ET(t){return t!==t}function CT(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function bc(t,e,r){return e===e?CT(t,e,r):ph(t,ET,r)}function hh(t,e){var r=t==null?0:t.length;return!!r&&bc(t,e,0)>-1}var ST=9007199254740991,wT=/^(?:0|[1-9]\d*)$/;function Lo(t,e){var r=typeof t;return e=e??ST,!!e&&(r=="number"||r!="symbol"&&wT.test(t))&&t>-1&&t%1==0&&t<e}function _c(t,e,r){e=="__proto__"&&so?so(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ua(t,e){return t===e||t!==t&&e!==e}var bT=Object.prototype,_T=bT.hasOwnProperty;function xo(t,e,r){var n=t[e];(!(_T.call(t,e)&&Ua(n,r))||r===void 0&&!(e in t))&&_c(t,e,r)}function ja(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),i?_c(r,o,l):xo(r,o,l)}return r}var Nf=Math.max;function NT(t,e,r){return e=Nf(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=Nf(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),hT(t,this,o)}}function Nc(t,e){return AT(NT(t,e,za),t+"")}var kT=9007199254740991;function kc(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kT}function Kt(t){return t!=null&&kc(t.length)&&!Er(t)}function mh(t,e,r){if(!$t(r))return!1;var n=typeof e;return(n=="number"?Kt(r)&&Lo(e,r.length):n=="string"&&e in r)?Ua(r[e],t):!1}function IT(t){return Nc(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&mh(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var PT=Object.prototype;function qa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||PT;return t===r}function OT(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var LT="[object Arguments]";function kf(t){return xt(t)&&Mr(t)==LT}var gh=Object.prototype,xT=gh.hasOwnProperty,DT=gh.propertyIsEnumerable,Do=kf((function(){return arguments})())?kf:function(t){return xt(t)&&xT.call(t,"callee")&&!DT.call(t,"callee")};function MT(){return!1}var yh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,If=yh&&typeof module=="object"&&module&&!module.nodeType&&module,FT=If&&If.exports===yh,Pf=FT?Wt.Buffer:void 0,GT=Pf?Pf.isBuffer:void 0,Ea=GT||MT,zT="[object Arguments]",UT="[object Array]",jT="[object Boolean]",qT="[object Date]",BT="[object Error]",WT="[object Function]",KT="[object Map]",VT="[object Number]",HT="[object Object]",YT="[object RegExp]",XT="[object Set]",JT="[object String]",ZT="[object WeakMap]",QT="[object ArrayBuffer]",eR="[object DataView]",tR="[object Float32Array]",rR="[object Float64Array]",nR="[object Int8Array]",iR="[object Int16Array]",aR="[object Int32Array]",sR="[object Uint8Array]",oR="[object Uint8ClampedArray]",lR="[object Uint16Array]",uR="[object Uint32Array]",fe={};fe[tR]=fe[rR]=fe[nR]=fe[iR]=fe[aR]=fe[sR]=fe[oR]=fe[lR]=fe[uR]=!0;fe[zT]=fe[UT]=fe[QT]=fe[jT]=fe[eR]=fe[qT]=fe[BT]=fe[WT]=fe[KT]=fe[VT]=fe[HT]=fe[YT]=fe[XT]=fe[JT]=fe[ZT]=!1;function cR(t){return xt(t)&&kc(t.length)&&!!fe[Mr(t)]}function Mo(t){return function(e){return t(e)}}var Th=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ra=Th&&typeof module=="object"&&module&&!module.nodeType&&module,fR=Ra&&Ra.exports===Th,sl=fR&&uh.process,Or=(function(){try{var t=Ra&&Ra.require&&Ra.require("util").types;return t||sl&&sl.binding&&sl.binding("util")}catch{}})(),Of=Or&&Or.isTypedArray,Ic=Of?Mo(Of):cR,dR=Object.prototype,pR=dR.hasOwnProperty;function Rh(t,e){var r=Q(t),n=!r&&Do(t),i=!r&&!n&&Ea(t),a=!r&&!n&&!i&&Ic(t),s=r||n||i||a,o=s?OT(t.length,String):[],l=o.length;for(var u in t)(e||pR.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Lo(u,l)))&&o.push(u);return o}function vh(t,e){return function(r){return t(e(r))}}var hR=vh(Object.keys,Object),mR=Object.prototype,gR=mR.hasOwnProperty;function $h(t){if(!qa(t))return hR(t);var e=[];for(var r in Object(t))gR.call(t,r)&&r!="constructor"&&e.push(r);return e}function At(t){return Kt(t)?Rh(t):$h(t)}var yR=Object.prototype,TR=yR.hasOwnProperty,pt=IT(function(t,e){if(qa(e)||Kt(e)){ja(e,At(e),t);return}for(var r in e)TR.call(e,r)&&xo(t,r,e[r])});function RR(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var vR=Object.prototype,$R=vR.hasOwnProperty;function AR(t){if(!$t(t))return RR(t);var e=qa(t),r=[];for(var n in t)n=="constructor"&&(e||!$R.call(t,n))||r.push(n);return r}function Pc(t){return Kt(t)?Rh(t,!0):AR(t)}var ER=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,CR=/^\w*$/;function Oc(t,e){if(Q(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Io(t)?!0:CR.test(t)||!ER.test(t)||e!=null&&t in Object(e)}var Ca=Rn(Object,"create");function SR(){this.__data__=Ca?Ca(null):{},this.size=0}function wR(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var bR="__lodash_hash_undefined__",_R=Object.prototype,NR=_R.hasOwnProperty;function kR(t){var e=this.__data__;if(Ca){var r=e[t];return r===bR?void 0:r}return NR.call(e,t)?e[t]:void 0}var IR=Object.prototype,PR=IR.hasOwnProperty;function OR(t){var e=this.__data__;return Ca?e[t]!==void 0:PR.call(e,t)}var LR="__lodash_hash_undefined__";function xR(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ca&&e===void 0?LR:e,this}function pn(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])}}pn.prototype.clear=SR;pn.prototype.delete=wR;pn.prototype.get=kR;pn.prototype.has=OR;pn.prototype.set=xR;function DR(){this.__data__=[],this.size=0}function Fo(t,e){for(var r=t.length;r--;)if(Ua(t[r][0],e))return r;return-1}var MR=Array.prototype,FR=MR.splice;function GR(t){var e=this.__data__,r=Fo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():FR.call(e,r,1),--this.size,!0}function zR(t){var e=this.__data__,r=Fo(e,t);return r<0?void 0:e[r][1]}function UR(t){return Fo(this.__data__,t)>-1}function jR(t,e){var r=this.__data__,n=Fo(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Cr(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])}}Cr.prototype.clear=DR;Cr.prototype.delete=GR;Cr.prototype.get=zR;Cr.prototype.has=UR;Cr.prototype.set=jR;var Sa=Rn(Wt,"Map");function qR(){this.size=0,this.__data__={hash:new pn,map:new(Sa||Cr),string:new pn}}function BR(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Go(t,e){var r=t.__data__;return BR(e)?r[typeof e=="string"?"string":"hash"]:r.map}function WR(t){var e=Go(this,t).delete(t);return this.size-=e?1:0,e}function KR(t){return Go(this,t).get(t)}function VR(t){return Go(this,t).has(t)}function HR(t,e){var r=Go(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Sr(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])}}Sr.prototype.clear=qR;Sr.prototype.delete=WR;Sr.prototype.get=KR;Sr.prototype.has=VR;Sr.prototype.set=HR;var YR="Expected a function";function Lc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(YR);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Lc.Cache||Sr),r}Lc.Cache=Sr;var XR=500;function JR(t){var e=Lc(t,function(n){return r.size===XR&&r.clear(),n}),r=e.cache;return e}var ZR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,QR=/\\(\\)?/g,ev=JR(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ZR,function(r,n,i,a){e.push(i?a.replace(QR,"$1"):n||r)}),e});function tv(t){return t==null?"":fh(t)}function zo(t,e){return Q(t)?t:Oc(t,e)?[t]:ev(tv(t))}function Ba(t){if(typeof t=="string"||Io(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function xc(t,e){e=zo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ba(e[r++])];return r&&r==n?t:void 0}function rv(t,e,r){var n=t==null?void 0:xc(t,e);return n===void 0?r:n}function Dc(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Lf=vt?vt.isConcatSpreadable:void 0;function nv(t){return Q(t)||Do(t)||!!(Lf&&t&&t[Lf])}function Mc(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=nv),i||(i=[]);++a<s;){var o=t[a];r(o)?Dc(i,o):n||(i[i.length]=o)}return i}function Pt(t){var e=t==null?0:t.length;return e?Mc(t):[]}var Ah=vh(Object.getPrototypeOf,Object);function Eh(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}function iv(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function av(){this.__data__=new Cr,this.size=0}function sv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ov(t){return this.__data__.get(t)}function lv(t){return this.__data__.has(t)}var uv=200;function cv(t,e){var r=this.__data__;if(r instanceof Cr){var n=r.__data__;if(!Sa||n.length<uv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Sr(n)}return r.set(t,e),this.size=r.size,this}function qt(t){var e=this.__data__=new Cr(t);this.size=e.size}qt.prototype.clear=av;qt.prototype.delete=sv;qt.prototype.get=ov;qt.prototype.has=lv;qt.prototype.set=cv;function fv(t,e){return t&&ja(e,At(e),t)}function dv(t,e){return t&&ja(e,Pc(e),t)}var Ch=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xf=Ch&&typeof module=="object"&&module&&!module.nodeType&&module,pv=xf&&xf.exports===Ch,Df=pv?Wt.Buffer:void 0,Mf=Df?Df.allocUnsafe:void 0;function hv(t,e){var r=t.length,n=Mf?Mf(r):new t.constructor(r);return t.copy(n),n}function Fc(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function Sh(){return[]}var mv=Object.prototype,gv=mv.propertyIsEnumerable,Ff=Object.getOwnPropertySymbols,Gc=Ff?function(t){return t==null?[]:(t=Object(t),Fc(Ff(t),function(e){return gv.call(t,e)}))}:Sh;function yv(t,e){return ja(t,Gc(t),e)}var Tv=Object.getOwnPropertySymbols,wh=Tv?function(t){for(var e=[];t;)Dc(e,Gc(t)),t=Ah(t);return e}:Sh;function Rv(t,e){return ja(t,wh(t),e)}function bh(t,e,r){var n=e(t);return Q(t)?n:Dc(n,r(t))}function ql(t){return bh(t,At,Gc)}function vv(t){return bh(t,Pc,wh)}var Bl=Rn(Wt,"DataView"),Wl=Rn(Wt,"Promise"),Kn=Rn(Wt,"Set"),Gf="[object Map]",$v="[object Object]",zf="[object Promise]",Uf="[object Set]",jf="[object WeakMap]",qf="[object DataView]",Av=Tn(Bl),Ev=Tn(Sa),Cv=Tn(Wl),Sv=Tn(Kn),wv=Tn(jl),Tt=Mr;(Bl&&Tt(new Bl(new ArrayBuffer(1)))!=qf||Sa&&Tt(new Sa)!=Gf||Wl&&Tt(Wl.resolve())!=zf||Kn&&Tt(new Kn)!=Uf||jl&&Tt(new jl)!=jf)&&(Tt=function(t){var e=Mr(t),r=e==$v?t.constructor:void 0,n=r?Tn(r):"";if(n)switch(n){case Av:return qf;case Ev:return Gf;case Cv:return zf;case Sv:return Uf;case wv:return jf}return e});var bv=Object.prototype,_v=bv.hasOwnProperty;function Nv(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&_v.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var oo=Wt.Uint8Array;function kv(t){var e=new t.constructor(t.byteLength);return new oo(e).set(new oo(t)),e}function Iv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Pv=/\w*$/;function Ov(t){var e=new t.constructor(t.source,Pv.exec(t));return e.lastIndex=t.lastIndex,e}var Bf=vt?vt.prototype:void 0,Wf=Bf?Bf.valueOf:void 0;function Lv(t){return Wf?Object(Wf.call(t)):{}}function xv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Dv="[object Boolean]",Mv="[object Date]",Fv="[object Map]",Gv="[object Number]",zv="[object RegExp]",Uv="[object Set]",jv="[object String]",qv="[object Symbol]",Bv="[object ArrayBuffer]",Wv="[object DataView]",Kv="[object Float32Array]",Vv="[object Float64Array]",Hv="[object Int8Array]",Yv="[object Int16Array]",Xv="[object Int32Array]",Jv="[object Uint8Array]",Zv="[object Uint8ClampedArray]",Qv="[object Uint16Array]",e$="[object Uint32Array]";function t$(t,e,r){var n=t.constructor;switch(e){case Bv:return kv(t);case Dv:case Mv:return new n(+t);case Wv:return Iv(t);case Kv:case Vv:case Hv:case Yv:case Xv:case Jv:case Zv:case Qv:case e$:return xv(t);case Fv:return new n;case Gv:case jv:return new n(t);case zv:return Ov(t);case Uv:return new n;case qv:return Lv(t)}}function r$(t){return typeof t.constructor=="function"&&!qa(t)?pT(Ah(t)):{}}var n$="[object Map]";function i$(t){return xt(t)&&Tt(t)==n$}var Kf=Or&&Or.isMap,a$=Kf?Mo(Kf):i$,s$="[object Set]";function o$(t){return xt(t)&&Tt(t)==s$}var Vf=Or&&Or.isSet,l$=Vf?Mo(Vf):o$,u$=2,_h="[object Arguments]",c$="[object Array]",f$="[object Boolean]",d$="[object Date]",p$="[object Error]",Nh="[object Function]",h$="[object GeneratorFunction]",m$="[object Map]",g$="[object Number]",kh="[object Object]",y$="[object RegExp]",T$="[object Set]",R$="[object String]",v$="[object Symbol]",$$="[object WeakMap]",A$="[object ArrayBuffer]",E$="[object DataView]",C$="[object Float32Array]",S$="[object Float64Array]",w$="[object Int8Array]",b$="[object Int16Array]",_$="[object Int32Array]",N$="[object Uint8Array]",k$="[object Uint8ClampedArray]",I$="[object Uint16Array]",P$="[object Uint32Array]",le={};le[_h]=le[c$]=le[A$]=le[E$]=le[f$]=le[d$]=le[C$]=le[S$]=le[w$]=le[b$]=le[_$]=le[m$]=le[g$]=le[kh]=le[y$]=le[T$]=le[R$]=le[v$]=le[N$]=le[k$]=le[I$]=le[P$]=!0;le[p$]=le[Nh]=le[$$]=!1;function Ws(t,e,r,n,i,a){var s,o=e&u$;if(s!==void 0)return s;if(!$t(t))return t;var l=Q(t);if(l)return s=Nv(t),mT(t,s);var u=Tt(t),c=u==Nh||u==h$;if(Ea(t))return hv(t);if(u==kh||u==_h||c&&!i)return s=c?{}:r$(t),o?Rv(t,dv(s,t)):yv(t,fv(s,t));if(!le[u])return i?t:{};s=t$(t,u),a||(a=new qt);var f=a.get(t);if(f)return f;a.set(t,s),l$(t)?t.forEach(function($){s.add(Ws($,e,r,$,t,a))}):a$(t)&&t.forEach(function($,b){s.set(b,Ws($,e,r,b,t,a))});var p=ql,h=l?void 0:p(t);return dh(h||t,function($,b){h&&(b=$,$=t[b]),xo(s,b,Ws($,e,r,b,t,a))}),s}var O$=4;function He(t){return Ws(t,O$)}function Wa(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}var L$="__lodash_hash_undefined__";function x$(t){return this.__data__.set(t,L$),this}function D$(t){return this.__data__.has(t)}function hi(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Sr;++e<r;)this.add(t[e])}hi.prototype.add=hi.prototype.push=x$;hi.prototype.has=D$;function Ih(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function zc(t,e){return t.has(e)}var M$=1,F$=2;function Ph(t,e,r,n,i,a){var s=r&M$,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,p=!0,h=r&F$?new hi:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var $=t[f],b=e[f];if(n)var I=s?n(b,$,f,e,t,a):n($,b,f,t,e,a);if(I!==void 0){if(I)continue;p=!1;break}if(h){if(!Ih(e,function(E,C){if(!zc(h,C)&&($===E||i($,E,r,n,a)))return h.push(C)})){p=!1;break}}else if(!($===b||i($,b,r,n,a))){p=!1;break}}return a.delete(t),a.delete(e),p}function G$(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Uc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var z$=1,U$=2,j$="[object Boolean]",q$="[object Date]",B$="[object Error]",W$="[object Map]",K$="[object Number]",V$="[object RegExp]",H$="[object Set]",Y$="[object String]",X$="[object Symbol]",J$="[object ArrayBuffer]",Z$="[object DataView]",Hf=vt?vt.prototype:void 0,ol=Hf?Hf.valueOf:void 0;function Q$(t,e,r,n,i,a,s){switch(r){case Z$:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case J$:return!(t.byteLength!=e.byteLength||!a(new oo(t),new oo(e)));case j$:case q$:case K$:return Ua(+t,+e);case B$:return t.name==e.name&&t.message==e.message;case V$:case Y$:return t==e+"";case W$:var o=G$;case H$:var l=n&z$;if(o||(o=Uc),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=U$,s.set(t,e);var c=Ph(o(t),o(e),n,i,a,s);return s.delete(t),c;case X$:if(ol)return ol.call(t)==ol.call(e)}return!1}var eA=1,tA=Object.prototype,rA=tA.hasOwnProperty;function nA(t,e,r,n,i,a){var s=r&eA,o=ql(t),l=o.length,u=ql(e),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var p=o[f];if(!(s?p in e:rA.call(e,p)))return!1}var h=a.get(t),$=a.get(e);if(h&&$)return h==e&&$==t;var b=!0;a.set(t,e),a.set(e,t);for(var I=s;++f<l;){p=o[f];var E=t[p],C=e[p];if(n)var S=s?n(C,E,p,e,t,a):n(E,C,p,t,e,a);if(!(S===void 0?E===C||i(E,C,r,n,a):S)){b=!1;break}I||(I=p=="constructor")}if(b&&!I){var P=t.constructor,V=e.constructor;P!=V&&"constructor"in t&&"constructor"in e&&!(typeof P=="function"&&P instanceof P&&typeof V=="function"&&V instanceof V)&&(b=!1)}return a.delete(t),a.delete(e),b}var iA=1,Yf="[object Arguments]",Xf="[object Array]",vs="[object Object]",aA=Object.prototype,Jf=aA.hasOwnProperty;function sA(t,e,r,n,i,a){var s=Q(t),o=Q(e),l=s?Xf:Tt(t),u=o?Xf:Tt(e);l=l==Yf?vs:l,u=u==Yf?vs:u;var c=l==vs,f=u==vs,p=l==u;if(p&&Ea(t)){if(!Ea(e))return!1;s=!0,c=!1}if(p&&!c)return a||(a=new qt),s||Ic(t)?Ph(t,e,r,n,i,a):Q$(t,e,l,r,n,i,a);if(!(r&iA)){var h=c&&Jf.call(t,"__wrapped__"),$=f&&Jf.call(e,"__wrapped__");if(h||$){var b=h?t.value():t,I=$?e.value():e;return a||(a=new qt),i(b,I,r,n,a)}}return p?(a||(a=new qt),nA(t,e,r,n,i,a)):!1}function jc(t,e,r,n,i){return t===e?!0:t==null||e==null||!xt(t)&&!xt(e)?t!==t&&e!==e:sA(t,e,r,n,jc,i)}var oA=1,lA=2;function uA(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],l=t[o],u=s[1];if(s[2]){if(l===void 0&&!(o in t))return!1}else{var c=new qt,f;if(!(f===void 0?jc(u,l,oA|lA,n,c):f))return!1}}return!0}function Oh(t){return t===t&&!$t(t)}function cA(t){for(var e=At(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Oh(i)]}return e}function Lh(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function fA(t){var e=cA(t);return e.length==1&&e[0][2]?Lh(e[0][0],e[0][1]):function(r){return r===t||uA(r,t,e)}}function dA(t,e){return t!=null&&e in Object(t)}function xh(t,e,r){e=zo(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Ba(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&kc(i)&&Lo(s,i)&&(Q(t)||Do(t)))}function pA(t,e){return t!=null&&xh(t,e,dA)}var hA=1,mA=2;function gA(t,e){return Oc(t)&&Oh(e)?Lh(Ba(t),e):function(r){var n=rv(r,t);return n===void 0&&n===e?pA(r,t):jc(e,n,hA|mA)}}function yA(t){return function(e){return e?.[t]}}function TA(t){return function(e){return xc(e,t)}}function RA(t){return Oc(t)?yA(Ba(t)):TA(t)}function Vt(t){return typeof t=="function"?t:t==null?za:typeof t=="object"?Q(t)?gA(t[0],t[1]):fA(t):RA(t)}function vA(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}function $A(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[++i];if(r(a[l],l,a)===!1)break}return e}}var AA=$A();function EA(t,e){return t&&AA(t,e,At)}function CA(t,e){return function(r,n){if(r==null)return r;if(!Kt(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var vn=CA(EA);function SA(t,e,r,n){return vn(t,function(i,a,s){e(n,i,r(i),s)}),n}function wA(t,e){return function(r,n){var i=Q(r)?vA:SA,a=e?e():{};return i(r,t,Vt(n),a)}}var Dh=Object.prototype,bA=Dh.hasOwnProperty,qc=Nc(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&mh(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=Pc(a),o=-1,l=s.length;++o<l;){var u=s[o],c=t[u];(c===void 0||Ua(c,Dh[u])&&!bA.call(t,u))&&(t[u]=a[u])}return t});function Zf(t){return xt(t)&&Kt(t)}var _A=200;function NA(t,e,r,n){var i=-1,a=hh,s=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=_A&&(a=zc,s=!1,e=new hi(e));e:for(;++i<o;){var c=t[i],f=c;if(c=c!==0?c:0,s&&f===f){for(var p=u;p--;)if(e[p]===f)continue e;l.push(c)}else a(e,f,n)||l.push(c)}return l}var Uo=Nc(function(t,e){return Zf(t)?NA(t,Mc(e,1,Zf,!0)):[]});function hn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Be(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:Oo(e),Eh(t,e<0?0:e,n)):[]}function wa(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:Oo(e),e=n-e,Eh(t,0,e<0?0:e)):[]}function kA(t){return typeof t=="function"?t:za}function B(t,e){var r=Q(t)?dh:vn;return r(t,kA(e))}function IA(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function PA(t,e){var r=!0;return vn(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function Ot(t,e,r){var n=Q(t)?IA:PA;return n(t,Vt(e))}function Mh(t,e){var r=[];return vn(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function Et(t,e){var r=Q(t)?Fc:Mh;return r(t,Vt(e))}function OA(t){return function(e,r,n){var i=Object(e);if(!Kt(e)){var a=Vt(r);e=At(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var LA=Math.max;function xA(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Oo(r);return i<0&&(i=LA(n+i,0)),ph(t,Vt(e),i)}var mi=OA(xA);function Dt(t){return t&&t.length?t[0]:void 0}function DA(t,e){var r=-1,n=Kt(t)?Array(t.length):[];return vn(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function z(t,e){var r=Q(t)?Po:DA;return r(t,Vt(e))}function Rt(t,e){return Mc(z(t,e))}var MA=Object.prototype,FA=MA.hasOwnProperty,GA=wA(function(t,e,r){FA.call(t,r)?t[r].push(e):_c(t,r,[e])}),zA=Object.prototype,UA=zA.hasOwnProperty;function jA(t,e){return t!=null&&UA.call(t,e)}function j(t,e){return t!=null&&xh(t,e,jA)}var qA="[object String]";function it(t){return typeof t=="string"||!Q(t)&&xt(t)&&Mr(t)==qA}function BA(t,e){return Po(e,function(r){return t[r]})}function De(t){return t==null?[]:BA(t,At(t))}var WA=Math.max;function rt(t,e,r,n){t=Kt(t)?t:De(t),r=r?Oo(r):0;var i=t.length;return r<0&&(r=WA(i+r,0)),it(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&bc(t,e,r)>-1}function Qf(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return bc(t,e,i)}var KA="[object Map]",VA="[object Set]",HA=Object.prototype,YA=HA.hasOwnProperty;function ue(t){if(t==null)return!0;if(Kt(t)&&(Q(t)||typeof t=="string"||typeof t.splice=="function"||Ea(t)||Ic(t)||Do(t)))return!t.length;var e=Tt(t);if(e==KA||e==VA)return!t.size;if(qa(t))return!$h(t).length;for(var r in t)if(YA.call(t,r))return!1;return!0}var XA="[object RegExp]";function JA(t){return xt(t)&&Mr(t)==XA}var ed=Or&&Or.isRegExp,Tr=ed?Mo(ed):JA;function Rr(t){return t===void 0}var ZA="Expected a function";function QA(t){if(typeof t!="function")throw new TypeError(ZA);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function eE(t,e,r,n){if(!$t(t))return t;e=zo(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=Ba(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var c=o[l];u=void 0,u===void 0&&(u=$t(c)?c:Lo(e[i+1])?[]:{})}xo(o,l,u),o=o[l]}return t}function tE(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=xc(t,s);r(o,s)&&eE(a,zo(s,t),o)}return a}function Mt(t,e){if(t==null)return{};var r=Po(vv(t),function(n){return[n]});return e=Vt(e),tE(t,r,function(n,i){return e(n,i[0])})}function rE(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function ht(t,e,r){var n=Q(t)?iv:rE,i=arguments.length<3;return n(t,Vt(e),r,i,vn)}function jo(t,e){var r=Q(t)?Fc:Mh;return r(t,QA(Vt(e)))}function nE(t,e){var r;return vn(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function Fh(t,e,r){var n=Q(t)?Ih:nE;return n(t,Vt(e))}var iE=1/0,aE=Kn&&1/Uc(new Kn([,-0]))[1]==iE?function(t){return new Kn(t)}:Me,sE=200;function oE(t,e,r){var n=-1,i=hh,a=t.length,s=!0,o=[],l=o;if(a>=sE){var u=aE(t);if(u)return Uc(u);s=!1,i=zc,l=new hi}else l=o;e:for(;++n<a;){var c=t[n],f=c;if(c=c!==0?c:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue e;o.push(c)}else i(l,f,r)||(l!==o&&l.push(f),o.push(c))}return o}function Bc(t){return t&&t.length?oE(t):[]}function Kl(t){console&&console.error&&console.error(`Error: ${t}`)}function Gh(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function zh(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Uh(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function lE(t){return uE(t)?t.LABEL:t.name}function uE(t){return it(t.LABEL)&&t.LABEL!==""}class Ht{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),B(this.definition,r=>{r.accept(e)})}}class et extends Ht{constructor(e){super([]),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Ai extends Ht{constructor(e){super(e.definition),this.orgText="",pt(this,Mt(e,r=>r!==void 0))}}class at extends Ht{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,pt(this,Mt(e,r=>r!==void 0))}}let Ve=class extends Ht{constructor(e){super(e.definition),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}};class mt extends Ht{constructor(e){super(e.definition),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}}class gt extends Ht{constructor(e){super(e.definition),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}}class Se extends Ht{constructor(e){super(e.definition),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}}class st extends Ht{constructor(e){super(e.definition),this.idx=1,pt(this,Mt(e,r=>r!==void 0))}}class ot extends Ht{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,pt(this,Mt(e,r=>r!==void 0))}}class de{constructor(e){this.idx=1,pt(this,Mt(e,r=>r!==void 0))}accept(e){e.visit(this)}}function cE(t){return z(t,Ks)}function Ks(t){function e(r){return z(r,Ks)}if(t instanceof et){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return it(t.label)&&(r.label=t.label),r}else{if(t instanceof at)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ve)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof mt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof gt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Ks(new de({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof st)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Ks(new de({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Se)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ot)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof de){const r={type:"Terminal",name:t.terminalType.name,label:lE(t.terminalType),idx:t.idx};it(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Tr(n)?n.source:n),r}else{if(t instanceof Ai)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Ei{visit(e){const r=e;switch(r.constructor){case et:return this.visitNonTerminal(r);case at:return this.visitAlternative(r);case Ve:return this.visitOption(r);case mt:return this.visitRepetitionMandatory(r);case gt:return this.visitRepetitionMandatoryWithSeparator(r);case st:return this.visitRepetitionWithSeparator(r);case Se:return this.visitRepetition(r);case ot:return this.visitAlternation(r);case de:return this.visitTerminal(r);case Ai: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 fE(t){return t instanceof at||t instanceof Ve||t instanceof Se||t instanceof mt||t instanceof gt||t instanceof st||t instanceof de||t instanceof Ai}function lo(t,e=[]){return t instanceof Ve||t instanceof Se||t instanceof st?!0:t instanceof ot?Fh(t.definition,n=>lo(n,e)):t instanceof et&&rt(e,t)?!1:t instanceof Ht?(t instanceof et&&e.push(t),Ot(t.definition,n=>lo(n,e))):!1}function dE(t){return t instanceof ot}function Ut(t){if(t instanceof et)return"SUBRULE";if(t instanceof Ve)return"OPTION";if(t instanceof ot)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof st)return"MANY_SEP";if(t instanceof Se)return"MANY";if(t instanceof de)return"CONSUME";throw Error("non exhaustive match")}class qo{walk(e,r=[]){B(e.definition,(n,i)=>{const a=Be(e.definition,i+1);if(n instanceof et)this.walkProdRef(n,a,r);else if(n instanceof de)this.walkTerminal(n,a,r);else if(n instanceof at)this.walkFlat(n,a,r);else if(n instanceof Ve)this.walkOption(n,a,r);else if(n instanceof mt)this.walkAtLeastOne(n,a,r);else if(n instanceof gt)this.walkAtLeastOneSep(n,a,r);else if(n instanceof st)this.walkManySep(n,a,r);else if(n instanceof Se)this.walkMany(n,a,r);else if(n instanceof ot)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Ve({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=td(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Ve({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=td(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);B(e.definition,a=>{const s=new at({definition:[a]});this.walk(s,i)})}}function td(t,e,r){return[new Ve({definition:[new de({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ka(t){if(t instanceof et)return Ka(t.referencedRule);if(t instanceof de)return mE(t);if(fE(t))return pE(t);if(dE(t))return hE(t);throw Error("non exhaustive match")}function pE(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=lo(a),e=e.concat(Ka(a)),n=n+1,i=r.length>n;return Bc(e)}function hE(t){const e=z(t.definition,r=>Ka(r));return Bc(Pt(e))}function mE(t){return[t.terminalType]}const jh="_~IN~_";class gE extends qo{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=TE(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new at({definition:a}),o=Ka(s);this.follows[i]=o}}function yE(t){const e={};return B(t,r=>{const n=new gE(r).startWalking();pt(e,n)}),e}function TE(t,e){return t.name+e+jh}let Vs={};const RE=new Qp;function Bo(t){const e=t.toString();if(Vs.hasOwnProperty(e))return Vs[e];{const r=RE.pattern(e);return Vs[e]=r,r}}function vE(){Vs={}}const qh="Complement Sets are not supported for first char optimization",uo=`Unable to use "first char" lexer optimizations:
13
+ `;function $E(t,e=!1){try{const r=Bo(t);return Vl(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===qh)e&&Gh(`${uo} Unable to optimize: < ${t.toString()} >
14
+ Complement Sets cannot be automatically optimized.
15
+ This will disable the lexer's first char optimizations.
16
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
17
+ This will disable the lexer's first char optimizations.
18
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Kl(`${uo}
19
+ Failed parsing: < ${t.toString()} >
20
+ Using the @chevrotain/regexp-to-ast library
21
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Vl(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Vl(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":$s(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(qh);B(s.value,l=>{if(typeof l=="number")$s(l,e,r);else{const u=l;if(r===!0)for(let c=u.from;c<=u.to;c++)$s(c,e,r);else{for(let c=u.from;c<=u.to&&c<ma;c++)$s(c,e,r);if(u.to>=ma){const c=u.from>=ma?u.from:ma,f=u.to,p=Lr(c),h=Lr(f);for(let $=p;$<=h;$++)e[$]=$}}}});break;case"Group":Vl(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Hl(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return De(e)}function $s(t,e,r){const n=Lr(t);e[n]=n,r===!0&&AE(t,e)}function AE(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Lr(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Lr(i.charCodeAt(0));e[a]=a}}}function rd(t,e){return mi(t.value,r=>{if(typeof r=="number")return rt(e,r);{const n=r;return mi(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Hl(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Q(t.value)?Ot(t.value,Hl):Hl(t.value):!1}class EE extends No{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){rt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?rd(e,this.targetCharCodes)===void 0&&(this.found=!0):rd(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Wc(t,e){if(e instanceof RegExp){const r=Bo(e),n=new EE(t);return n.visit(r),n.found}else return mi(e,r=>rt(t,r.charCodeAt(0)))!==void 0}const mn="PATTERN",ha="defaultMode",As="modes";function CE(t,e){e=qc(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(C,S)=>S()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{HE()});let n;r("Reject Lexer.NA",()=>{n=jo(t,C=>C[mn]===nt.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=z(n,C=>{const S=C[mn];if(Tr(S)){const P=S.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!S.ignoreCase?P:P.length===2&&P[0]==="\\"&&!rt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])?P[1]:nd(S)}else{if(Er(S))return i=!0,{exec:S};if(typeof S=="object")return i=!0,S;if(typeof S=="string"){if(S.length===1)return S;{const P=S.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),V=new RegExp(P);return nd(V)}}else throw Error("non exhaustive match")}})});let s,o,l,u,c;r("misc mapping",()=>{s=z(n,C=>C.tokenTypeIdx),o=z(n,C=>{const S=C.GROUP;if(S!==nt.SKIPPED){if(it(S))return S;if(Rr(S))return!1;throw Error("non exhaustive match")}}),l=z(n,C=>{const S=C.LONGER_ALT;if(S)return Q(S)?z(S,V=>Qf(n,V)):[Qf(n,S)]}),u=z(n,C=>C.PUSH_MODE),c=z(n,C=>j(C,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{const C=Kh(e.lineTerminatorCharacters);f=z(n,S=>!1),e.positionTracking!=="onlyOffset"&&(f=z(n,S=>j(S,"LINE_BREAKS")?!!S.LINE_BREAKS:Wh(S,C)===!1&&Wc(C,S.PATTERN)))});let p,h,$,b;r("Misc Mapping #2",()=>{p=z(n,Bh),h=z(a,WE),$=ht(n,(C,S)=>{const P=S.GROUP;return it(P)&&P!==nt.SKIPPED&&(C[P]=[]),C},{}),b=z(a,(C,S)=>({pattern:a[S],longerAlt:l[S],canLineTerminator:f[S],isCustom:p[S],short:h[S],group:o[S],push:u[S],pop:c[S],tokenTypeIdx:s[S],tokenType:n[S]}))});let I=!0,E=[];return e.safeMode||r("First Char Optimization",()=>{E=ht(n,(C,S,P)=>{if(typeof S.PATTERN=="string"){const V=S.PATTERN.charCodeAt(0),H=Lr(V);ll(C,H,b[P])}else if(Q(S.START_CHARS_HINT)){let V;B(S.START_CHARS_HINT,H=>{const J=typeof H=="string"?H.charCodeAt(0):H,oe=Lr(J);V!==oe&&(V=oe,ll(C,oe,b[P]))})}else if(Tr(S.PATTERN))if(S.PATTERN.unicode)I=!1,e.ensureOptimizations&&Kl(`${uo} Unable to analyze < ${S.PATTERN.toString()} > pattern.
23
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
+ This will disable the lexer's first char optimizations.
25
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const V=$E(S.PATTERN,e.ensureOptimizations);ue(V)&&(I=!1),B(V,H=>{ll(C,H,b[P])})}else e.ensureOptimizations&&Kl(`${uo} TokenType: <${S.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
+ This will disable the lexer's first char optimizations.
27
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),I=!1;return C},[])}),{emptyGroups:$,patternIdxToConfig:b,charCodeToPatternIdxToConfig:E,hasCustom:i,canBeOptimized:I}}function SE(t,e){let r=[];const n=bE(t);r=r.concat(n.errors);const i=_E(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(wE(a)),r=r.concat(DE(a)),r=r.concat(ME(a,e)),r=r.concat(FE(a)),r}function wE(t){let e=[];const r=Et(t,n=>Tr(n[mn]));return e=e.concat(kE(r)),e=e.concat(OE(r)),e=e.concat(LE(r)),e=e.concat(xE(r)),e=e.concat(IE(r)),e}function bE(t){const e=Et(t,i=>!j(i,mn)),r=z(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:we.MISSING_PATTERN,tokenTypes:[i]})),n=Uo(t,e);return{errors:r,valid:n}}function _E(t){const e=Et(t,i=>{const a=i[mn];return!Tr(a)&&!Er(a)&&!j(a,"exec")&&!it(a)}),r=z(e,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:we.INVALID_PATTERN,tokenTypes:[i]})),n=Uo(t,e);return{errors:r,valid:n}}const NE=/[^\\][$]/;function kE(t){class e extends No{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}const r=Et(t,i=>{const a=i.PATTERN;try{const s=Bo(a),o=new e;return o.visit(s),o.found}catch{return NE.test(a.source)}});return z(r,i=>({message:`Unexpected RegExp Anchor Error:
28
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
29
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:we.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function IE(t){const e=Et(t,n=>n.PATTERN.test(""));return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:we.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const PE=/[^\\[][\^]|^\^/;function OE(t){class e extends No{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}const r=Et(t,i=>{const a=i.PATTERN;try{const s=Bo(a),o=new e;return o.visit(s),o.found}catch{return PE.test(a.source)}});return z(r,i=>({message:`Unexpected RegExp Anchor Error:
30
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
31
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:we.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function LE(t){const e=Et(t,n=>{const i=n[mn];return i instanceof RegExp&&(i.multiline||i.global)});return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:we.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function xE(t){const e=[];let r=z(t,a=>ht(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!rt(e,o)&&o.PATTERN!==nt.NA&&(e.push(o),s.push(o)),s),[]));r=Wa(r);const n=Et(r,a=>a.length>1);return z(n,a=>{const s=z(a,l=>l.name);return{message:`The same RegExp pattern ->${Dt(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:we.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function DE(t){const e=Et(t,n=>{if(!j(n,"GROUP"))return!1;const i=n.GROUP;return i!==nt.SKIPPED&&i!==nt.NA&&!it(i)});return z(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:we.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function ME(t,e){const r=Et(t,i=>i.PUSH_MODE!==void 0&&!rt(e,i.PUSH_MODE));return z(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:we.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function FE(t){const e=[],r=ht(t,(n,i,a)=>{const s=i.PATTERN;return s===nt.NA||(it(s)?n.push({str:s,idx:a,tokenType:i}):Tr(s)&&zE(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return B(t,(n,i)=>{B(r,({str:a,idx:s,tokenType:o})=>{if(i<s&&GE(a,n.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
32
+ Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
33
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:we.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function GE(t,e){if(Tr(e)){if(UE(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Er(e))return e(t,0,[],{});if(j(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function zE(t){return mi([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function UE(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function nd(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function jE(t,e,r){const n=[];return j(t,ha)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ha+`> property in its definition
34
+ `,type:we.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),j(t,As)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+As+`> property in its definition
35
+ `,type:we.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),j(t,As)&&j(t,ha)&&!j(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ha}: <${t.defaultMode}>which does not exist
36
+ `,type:we.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),j(t,As)&&B(t.modes,(i,a)=>{B(i,(s,o)=>{if(Rr(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
37
+ `,type:we.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(j(s,"LONGER_ALT")){const l=Q(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];B(l,u=>{!Rr(u)&&!rt(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}>
38
+ `,type:we.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function qE(t,e,r){const n=[];let i=!1;const a=Wa(Pt(De(t.modes))),s=jo(a,l=>l[mn]===nt.NA),o=Kh(r);return e&&B(s,l=>{const u=Wh(l,o);if(u!==!1){const f={message:VE(l,u),type:u.issue,tokenType:l};n.push(f)}else j(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Wc(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
39
+ This Lexer has been defined to track line and column information,
40
+ But none of the Token Types can be identified as matching a line terminator.
41
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
42
+ for details.`,type:we.NO_LINE_BREAKS_FLAGS}),n}function BE(t){const e={},r=At(t);return B(r,n=>{const i=t[n];if(Q(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Bh(t){const e=t.PATTERN;if(Tr(e))return!1;if(Er(e))return!0;if(j(e,"exec"))return!0;if(it(e))return!1;throw Error("non exhaustive match")}function WE(t){return it(t)&&t.length===1?t.charCodeAt(0):!1}const KE={test:function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const 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 Wh(t,e){if(j(t,"LINE_BREAKS"))return!1;if(Tr(t.PATTERN)){try{Wc(e,t.PATTERN)}catch(r){return{issue:we.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(it(t.PATTERN))return!1;if(Bh(t))return{issue:we.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function VE(t,e){if(e.issue===we.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
43
+ The problem is in the <${t.name}> Token Type
44
+ Root cause: ${e.errMsg}.
45
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===we.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
46
+ The problem is in the <${t.name}> Token Type
47
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Kh(t){return z(t,r=>it(r)?r.charCodeAt(0):r)}function ll(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const ma=256;let Hs=[];function Lr(t){return t<ma?t:Hs[t]}function HE(){if(ue(Hs)){Hs=new Array(65536);for(let t=0;t<65536;t++)Hs[t]=t>255?255+~~(t/255):t}}function Va(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function co(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let id=1;const Vh={};function Ha(t){const e=YE(t);XE(e),ZE(e),JE(e),B(e,r=>{r.isParent=r.categoryMatches.length>0})}function YE(t){let e=He(t),r=t,n=!0;for(;n;){r=Wa(Pt(z(r,a=>a.CATEGORIES)));const i=Uo(r,e);e=e.concat(i),ue(i)?n=!1:r=i}return e}function XE(t){B(t,e=>{Yh(e)||(Vh[id]=e,e.tokenTypeIdx=id++),ad(e)&&!Q(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ad(e)||(e.CATEGORIES=[]),QE(e)||(e.categoryMatches=[]),eC(e)||(e.categoryMatchesMap={})})}function JE(t){B(t,e=>{e.categoryMatches=[],B(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Vh[n].tokenTypeIdx)})})}function ZE(t){B(t,e=>{Hh([],e)})}function Hh(t,e){B(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),B(e.CATEGORIES,r=>{const n=t.concat(e);rt(n,r)||Hh(n,r)})}function Yh(t){return j(t,"tokenTypeIdx")}function ad(t){return j(t,"CATEGORIES")}function QE(t){return j(t,"categoryMatches")}function eC(t){return j(t,"categoryMatchesMap")}function tC(t){return j(t,"tokenTypeIdx")}const Yl={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var we;(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"})(we||(we={}));const ga={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Yl,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ga);class nt{constructor(e,r=ga){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,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:l}=zh(a),u=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
49
+ a boolean 2nd argument is no longer supported`);this.config=pt({},ga,r);const 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,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ga.lineTerminatorsPattern)this.config.lineTerminatorsPattern=KE;else if(this.config.lineTerminatorCharacters===ga.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
50
+ For 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),Q(e)?i={modes:{defaultMode:He(e)},defaultMode:ha}:(a=!1,i=He(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(jE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(qE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},B(i.modes,(o,l)=>{i.modes[l]=jo(o,u=>Rr(u))});const s=At(i.modes);if(B(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(SE(o,s))}),ue(this.lexerDefinitionErrors)){Ha(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=CE(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=pt({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!ue(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=z(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+l)}B(this.lexerDefinitionWarning,o=>{Gh(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Me),this.trackStartLines===!1&&(this.computeNewColumn=za),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Me),/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",()=>{const o=ht(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(r.ensureOptimizations&&!ue(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
53
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
54
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{vE()}),this.TRACE_INIT("toFastProperties",()=>{Uh(this)})})}tokenize(e,r=this.defaultMode){if(!ue(this.lexerDefinitionErrors)){const i=z(this.lexerDefinitionErrors,a=>a.message).join(`-----------------------
55
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,c,f,p,h,$,b,I,E;const C=e,S=C.length;let P=0,V=0;const H=this.hasCustom?0:Math.floor(e.length/10),J=new Array(H),oe=[];let pe=this.trackStartLines?1:void 0,he=this.trackStartLines?1:void 0;const N=BE(this.emptyGroups),T=this.trackStartLines,g=this.config.lineTerminatorsPattern;let w=0,y=[],R=[];const A=[],L=[];Object.freeze(L);let D=!1;const x=q=>{if(A.length===1&&q.tokenType.PUSH_MODE===void 0){const ne=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);oe.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:ne})}else{A.pop();const ne=hn(A);y=this.patternIdxToConfig[ne],R=this.charCodeToPatternIdxToConfig[ne],w=y.length;const Ge=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;R&&Ge?D=!0:D=!1}};function U(q){A.push(q),R=this.charCodeToPatternIdxToConfig[q],y=this.patternIdxToConfig[q],w=y.length,w=y.length;const ne=this.canModeBeOptimized[q]&&this.config.safeMode===!1;R&&ne?D=!0:D=!1}U.call(this,r);let F;const ae=this.config.recoveryEnabled;for(;P<S;){l=null,f=-1;const q=C.charCodeAt(P);let ne;if(D){const Ae=Lr(q),me=R[Ae];ne=me!==void 0?me:L}else ne=y;const Ge=ne.length;for(n=0;n<Ge;n++){F=ne[n];const Ae=F.pattern;u=null;const me=F.short;if(me!==!1?q===me&&(f=1,l=Ae):F.isCustom===!0?(E=Ae.exec(C,P,J,N),E!==null?(l=E[0],f=l.length,E.payload!==void 0&&(u=E.payload)):l=null):(Ae.lastIndex=P,f=this.matchLength(Ae,e,P)),f!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(P,P+f);const Le=o.length;for(a=0;a<Le;a++){const ze=y[o[a]],Ie=ze.pattern;if(c=null,ze.isCustom===!0?(E=Ie.exec(C,P,J,N),E!==null?(s=E[0],E.payload!==void 0&&(c=E.payload)):s=null):(Ie.lastIndex=P,s=this.match(Ie,e,P)),s&&s.length>l.length){l=s,f=s.length,u=c,F=ze;break}}}break}}if(f!==-1){if(p=F.group,p!==void 0&&(l=l!==null?l:e.substring(P,P+f),h=F.tokenTypeIdx,$=this.createTokenInstance(l,P,h,F.tokenType,pe,he,f),this.handlePayload($,u),p===!1?V=this.addToken(J,V,$):N[p].push($)),T===!0&&F.canLineTerminator===!0){let Ae=0,me,Le;g.lastIndex=0;do l=l!==null?l:e.substring(P,P+f),me=g.test(l),me===!0&&(Le=g.lastIndex-1,Ae++);while(me===!0);Ae!==0?(pe=pe+Ae,he=f-Le,this.updateTokenEndLineColumnLocation($,p,Le,Ae,pe,he,f)):he=this.computeNewColumn(he,f)}else he=this.computeNewColumn(he,f);P=P+f,this.handleModes(F,x,U,$)}else{const Ae=P,me=pe,Le=he;let ze=ae===!1;for(;ze===!1&&P<S;)for(P++,i=0;i<w;i++){const Ie=y[i],ee=Ie.pattern,lt=Ie.short;if(lt!==!1?C.charCodeAt(P)===lt&&(ze=!0):Ie.isCustom===!0?ze=ee.exec(C,P,J,N)!==null:(ee.lastIndex=P,ze=ee.exec(e)!==null),ze===!0)break}if(b=P-Ae,he=this.computeNewColumn(he,b),I=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,Ae,b,me,Le,hn(A)),oe.push({offset:Ae,line:me,column:Le,length:b,message:I}),ae===!1)break}}return this.hasCustom||(J.length=V),{tokens:J,groups:N,errors:oe}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let l,u;r!==void 0&&(l=n===o-1,u=l?-1:0,i===1&&l===!0||(e.endLine=a+u,e.endColumn=s-1+-u))}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,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-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}}nt.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.";nt.NA=/NOT_APPLICABLE/;function Vn(t){return Xh(t)?t.LABEL:t.name}function Xh(t){return it(t.LABEL)&&t.LABEL!==""}const rC="parent",sd="categories",od="label",ld="group",ud="push_mode",cd="pop_mode",fd="longer_alt",dd="line_breaks",pd="start_chars_hint";function Jh(t){return nC(t)}function nC(t){const e=t.pattern,r={};if(r.name=t.name,Rr(e)||(r.PATTERN=e),j(t,rC))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return j(t,sd)&&(r.CATEGORIES=t[sd]),Ha([r]),j(t,od)&&(r.LABEL=t[od]),j(t,ld)&&(r.GROUP=t[ld]),j(t,cd)&&(r.POP_MODE=t[cd]),j(t,ud)&&(r.PUSH_MODE=t[ud]),j(t,fd)&&(r.LONGER_ALT=t[fd]),j(t,dd)&&(r.LINE_BREAKS=t[dd]),j(t,pd)&&(r.START_CHARS_HINT=t[pd]),r}const xr=Jh({name:"EOF",pattern:nt.NA});Ha([xr]);function Kc(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Zh(t,e){return Va(t,e)}const Bn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Xh(t)?`--> ${Vn(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}){const a="Expecting: ",o=`
58
+ but found: '`+Dt(e).image+"'";if(n)return a+n+o;{const l=ht(t,(p,h)=>p.concat(h),[]),u=z(l,p=>`[${z(p,h=>Vn(h)).join(", ")}]`),f=`one of these possible Token sequences:
59
+ ${z(u,(p,h)=>` ${h+1}. ${p}`).join(`
60
+ `)}`;return a+f+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
61
+ but found: '`+Dt(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
62
+ <${z(t,u=>`[${z(u,c=>Vn(c)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Bn);const iC={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},ln={buildDuplicateFoundError(t,e){function r(c){return c instanceof de?c.terminalType.name:c instanceof et?c.nonTerminalName:""}const n=t.name,i=Dt(e),a=i.idx,s=Ut(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""}
64
+ appears more than once (${e.length} times) in the top level rule: ->${n}<-.
65
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
+ `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
67
+ `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
68
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
69
+ To resolve this make sure each Terminal and Non-Terminal names are unique
70
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
71
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=z(t.prefixPath,i=>Vn(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
+ in <OR${r}> inside <${t.topLevelRule.name}> Rule,
73
+ <${e}> may appears as a prefix path in all these alternatives.
74
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
75
+ For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
76
+ `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
77
+ Only the last alternative may be empty.
78
+ `;else{const i=z(t.prefixPath,a=>Vn(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
79
+ `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
80
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=Ut(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
81
+ This 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.
82
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
83
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
84
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=z(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
85
+ rule: <${e}> can be invoked from itself (directly or indirectly)
86
+ without consuming any Tokens. The grammar path that causes this is:
87
+ ${n}
88
+ To fix this refactor your grammar to remove the left recursion.
89
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ai?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function aC(t,e){const r=new sC(t,e);return r.resolveRefs(),r.errors}class sC extends Ei{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){B(De(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:tt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class oC extends qo{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=He(this.path.ruleStack).reverse(),this.occurrenceStack=He(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){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){ue(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class lC extends oC{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){const i=r.concat(n),a=new at({definition:i});this.possibleTokTypes=Ka(a),this.found=!0}}}class Wo extends qo{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}}class uC extends Wo{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Dt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class hd extends Wo{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Dt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class cC extends Wo{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Dt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class md extends Wo{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Dt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof de&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function Xl(t,e,r=[]){r=He(r);let n=[],i=0;function a(o){return o.concat(Be(t,i+1))}function s(o){const l=Xl(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof at)return s(o.definition);if(o instanceof et)return s(o.definition);if(o instanceof Ve)n=s(o.definition);else if(o instanceof mt){const l=o.definition.concat([new Se({definition:o.definition})]);return s(l)}else if(o instanceof gt){const l=[new at({definition:o.definition}),new Se({definition:[new de({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof st){const l=o.definition.concat([new Se({definition:[new de({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof Se){const l=o.definition.concat([new Se({definition:o.definition})]);n=s(l)}else{if(o instanceof ot)return B(o.definition,l=>{ue(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof de)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Be(t,i)}),n}function Qh(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ue(f);){const p=f.pop();if(p===s){o&&hn(f).idx<=u&&f.pop();continue}const h=p.def,$=p.idx,b=p.ruleStack,I=p.occurrenceStack;if(ue(h))continue;const E=h[0];if(E===i){const C={idx:$,def:Be(h),ruleStack:wa(b),occurrenceStack:wa(I)};f.push(C)}else if(E instanceof de)if($<l-1){const C=$+1,S=e[C];if(r(S,E.terminalType)){const P={idx:C,def:Be(h),ruleStack:b,occurrenceStack:I};f.push(P)}}else if($===l-1)c.push({nextTokenType:E.terminalType,nextTokenOccurrence:E.idx,ruleStack:b,occurrenceStack:I}),o=!0;else throw Error("non exhaustive match");else if(E instanceof et){const C=He(b);C.push(E.nonTerminalName);const S=He(I);S.push(E.idx);const P={idx:$,def:E.definition.concat(a,Be(h)),ruleStack:C,occurrenceStack:S};f.push(P)}else if(E instanceof Ve){const C={idx:$,def:Be(h),ruleStack:b,occurrenceStack:I};f.push(C),f.push(s);const S={idx:$,def:E.definition.concat(Be(h)),ruleStack:b,occurrenceStack:I};f.push(S)}else if(E instanceof mt){const C=new Se({definition:E.definition,idx:E.idx}),S=E.definition.concat([C],Be(h)),P={idx:$,def:S,ruleStack:b,occurrenceStack:I};f.push(P)}else if(E instanceof gt){const C=new de({terminalType:E.separator}),S=new Se({definition:[C].concat(E.definition),idx:E.idx}),P=E.definition.concat([S],Be(h)),V={idx:$,def:P,ruleStack:b,occurrenceStack:I};f.push(V)}else if(E instanceof st){const C={idx:$,def:Be(h),ruleStack:b,occurrenceStack:I};f.push(C),f.push(s);const S=new de({terminalType:E.separator}),P=new Se({definition:[S].concat(E.definition),idx:E.idx}),V=E.definition.concat([P],Be(h)),H={idx:$,def:V,ruleStack:b,occurrenceStack:I};f.push(H)}else if(E instanceof Se){const C={idx:$,def:Be(h),ruleStack:b,occurrenceStack:I};f.push(C),f.push(s);const S=new Se({definition:E.definition,idx:E.idx}),P=E.definition.concat([S],Be(h)),V={idx:$,def:P,ruleStack:b,occurrenceStack:I};f.push(V)}else if(E instanceof ot)for(let C=E.definition.length-1;C>=0;C--){const S=E.definition[C],P={idx:$,def:S.definition.concat(Be(h)),ruleStack:b,occurrenceStack:I};f.push(P),f.push(s)}else if(E instanceof at)f.push({idx:$,def:E.definition.concat(Be(h)),ruleStack:b,occurrenceStack:I});else if(E instanceof Ai)f.push(fC(E,$,b,I));else throw Error("non exhaustive match")}return c}function fC(t,e,r,n){const i=He(r);i.push(t.name);const a=He(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var Re;(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"})(Re||(Re={}));function Vc(t){if(t instanceof Ve||t==="Option")return Re.OPTION;if(t instanceof Se||t==="Repetition")return Re.REPETITION;if(t instanceof mt||t==="RepetitionMandatory")return Re.REPETITION_MANDATORY;if(t instanceof gt||t==="RepetitionMandatoryWithSeparator")return Re.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof st||t==="RepetitionWithSeparator")return Re.REPETITION_WITH_SEPARATOR;if(t instanceof ot||t==="Alternation")return Re.ALTERNATION;throw Error("non exhaustive match")}function gd(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Vc(n);return a===Re.ALTERNATION?Ko(e,r,i):Vo(e,r,a,i)}function dC(t,e,r,n,i,a){const s=Ko(t,e,r),o=rm(s)?co:Va;return a(s,n,o,i)}function pC(t,e,r,n,i,a){const s=Vo(t,e,i,r),o=rm(s)?co:Va;return a(s[0],o,n)}function hC(t,e,r,n){const i=t.length,a=Ot(t,s=>Ot(s,o=>o.length===1));if(e)return function(s){const o=z(s,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],c=u.length,f=o[l];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){const h=u[p],$=h.length;for(let b=0;b<$;b++){const I=this.LA(b+1);if(r(I,h[b])===!1)continue e}return l}}};if(a&&!n){const s=z(t,l=>Pt(l)),o=ht(s,(l,u,c)=>(B(u,f=>{j(l,f.tokenTypeIdx)||(l[f.tokenTypeIdx]=c),B(f.categoryMatches,p=>{j(l,p)||(l[p]=c)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],l=o.length;e:for(let u=0;u<l;u++){const c=o[u],f=c.length;for(let p=0;p<f;p++){const h=this.LA(p+1);if(r(h,c[p])===!1)continue e}return s}}}}function mC(t,e,r){const n=Ot(t,a=>a.length===1),i=t.length;if(n&&!r){const a=Pt(t);if(a.length===1&&ue(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=ht(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,B(l.categoryMatches,c=>{o[c]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,s[l])===!1)continue e}return!0}return!1}}class gC extends qo{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,Re.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Re.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Re.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Re.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class em extends Ei{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,Re.OPTION)}visitRepetition(e){this.checkIsTarget(e,Re.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Re.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Re.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Re.ALTERNATION)}}function yd(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function ul(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(s+l)}}e=i}return e}function yC(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function tm(t,e){const r=z(t,s=>Xl([s],1)),n=yd(r.length),i=z(r,s=>{const o={};return B(s,l=>{const u=ul(l.partialPath);B(u,c=>{o[c]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=yd(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let c=0;c<u.length;c++){const f=u[c].partialPath,p=u[c].suffixDef,h=ul(f);if(yC(i,h,l)||ue(p)||f.length===e){const b=n[l];if(Jl(b,f)===!1){b.push(f);for(let I=0;I<h.length;I++){const E=h[I];i[l][E]=!0}}}else{const b=Xl(p,s+1,f);a[l]=a[l].concat(b),B(b,I=>{const E=ul(I.partialPath);B(E,C=>{i[l][C]=!0})})}}}}return n}function Ko(t,e,r,n){const i=new em(t,Re.ALTERNATION,n);return e.accept(i),tm(i.result,r)}function Vo(t,e,r,n){const i=new em(t,r);e.accept(i);const a=i.result,o=new gC(e,t,r).startWalking(),l=new at({definition:a}),u=new at({definition:o});return tm([l,u],n)}function Jl(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function TC(t,e){return t.length<e.length&&Ot(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function rm(t){return Ot(t,e=>Ot(e,r=>Ot(r,n=>ue(n.categoryMatches))))}function RC(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return z(e,r=>Object.assign({type:tt.CUSTOM_LOOKAHEAD_VALIDATION},r))}function vC(t,e,r,n){const i=Rt(t,l=>$C(l,r)),a=OC(t,e,r),s=Rt(t,l=>NC(l,r)),o=Rt(t,l=>CC(l,t,n,r));return i.concat(a,s,o)}function $C(t,e){const r=new EC;t.accept(r);const n=r.allProductions,i=GA(n,AC),a=Mt(i,o=>o.length>1);return z(De(a),o=>{const l=Dt(o),u=e.buildDuplicateFoundError(t,o),c=Ut(l),f={message:u,type:tt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:l.idx},p=nm(l);return p&&(f.parameter=p),f})}function AC(t){return`${Ut(t)}_#_${t.idx}_#_${nm(t)}`}function nm(t){return t instanceof de?t.terminalType.name:t instanceof et?t.nonTerminalName:""}class EC extends Ei{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 CC(t,e,r,n){const i=[];if(ht(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:tt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function SC(t,e,r){const n=[];let i;return rt(e,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:tt.INVALID_RULE_OVERRIDE,ruleName:t})),n}function im(t,e,r,n=[]){const i=[],a=Ys(e.definition);if(ue(a))return[];{const s=t.name;rt(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:tt.LEFT_RECURSION,ruleName:s});const l=Uo(a,n.concat([t])),u=Rt(l,c=>{const f=He(n);return f.push(c),im(t,c,r,f)});return i.concat(u)}}function Ys(t){let e=[];if(ue(t))return e;const r=Dt(t);if(r instanceof et)e.push(r.referencedRule);else if(r instanceof at||r instanceof Ve||r instanceof mt||r instanceof gt||r instanceof st||r instanceof Se)e=e.concat(Ys(r.definition));else if(r instanceof ot)e=Pt(z(r.definition,a=>Ys(a.definition)));else if(!(r instanceof de))throw Error("non exhaustive match");const n=lo(r),i=t.length>1;if(n&&i){const a=Be(t);return e.concat(Ys(a))}else return e}class Hc extends Ei{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function wC(t,e){const r=new Hc;t.accept(r);const n=r.alternations;return Rt(n,a=>{const s=wa(a.definition);return Rt(s,(o,l)=>{const u=Qh([o],[],Va,1);return ue(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:tt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}function bC(t,e,r){const n=new Hc;t.accept(n);let i=n.alternations;return i=jo(i,s=>s.ignoreAmbiguities===!0),Rt(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=Ko(o,t,l,s),c=IC(u,s,t,r),f=PC(u,s,t,r);return c.concat(f)})}class _C extends Ei{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 NC(t,e){const r=new Hc;t.accept(r);const n=r.alternations;return Rt(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:tt.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function kC(t,e,r){const n=[];return B(t,i=>{const a=new _C;i.accept(a);const s=a.allProductions;B(s,o=>{const l=Vc(o),u=o.maxLookahead||e,c=o.idx,p=Vo(c,i,l,u)[0];if(ue(Pt(p))){const h=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:h,type:tt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function IC(t,e,r,n){const i=[],a=ht(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||B(l,c=>{const f=[u];B(t,(p,h)=>{u!==h&&Jl(p,c)&&e.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!Jl(i,c)&&(i.push(c),o.push({alts:f,path:c}))}),o),[]);return z(a,o=>{const l=z(o.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:tt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function PC(t,e,r,n){const i=ht(t,(s,o,l)=>{const u=z(o,c=>({idx:l,path:c}));return s.concat(u)},[]);return Wa(Rt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,c=Et(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<l&&TC(p.path,u));return z(c,p=>{const h=[p.idx+1,l+1],$=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:h,prefixPath:p.path}),type:tt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:$,alternatives:h}})}))}function OC(t,e,r){const n=[],i=z(e,a=>a.name);return B(t,a=>{const s=a.name;if(rt(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:tt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function LC(t){const e=qc(t,{errMsgProvider:iC}),r={};return B(t.rules,n=>{r[n.name]=n}),aC(r,e.errMsgProvider)}function xC(t){return t=qc(t,{errMsgProvider:ln}),vC(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const am="MismatchedTokenException",sm="NoViableAltException",om="EarlyExitException",lm="NotAllInputParsedException",um=[am,sm,om,lm];Object.freeze(um);function fo(t){return rt(um,t.name)}class Ho 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)}}class cm extends Ho{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=am}}class DC extends Ho{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sm}}class MC extends Ho{constructor(e,r){super(e,r),this.name=lm}}class FC extends Ho{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=om}}const cl={},fm="InRuleRecoveryException";class GC extends Error{constructor(e){super(e),this.name=fm}}class zC{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=j(e,"recoveryEnabled")?e.recoveryEnabled:vr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=UC)}getTokenToInsert(e){const r=Kc(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){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=()=>{const p=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:p,ruleName:this.getCurrRuleFullName()}),$=new cm(h,u,this.LA(0));$.resyncedTokens=wa(o),this.SAVE_ERROR($)};for(;!l;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,a)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const 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)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new GC("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||ue(r))return!1;const n=this.LA(1);return mi(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return rt(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=mi(e,a=>Zh(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return cl;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return z(e,(n,i)=>i===0?cl:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=z(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Pt(e)}getFollowSetFromFollowKey(e){if(e===cl)return[xr];const r=e.ruleName+e.idxInCallingRule+jh+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,xr)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return wa(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=He(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return z(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function UC(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const p=this.getCurrRuleFullName(),h=this.getGAstProductions()[p];l=new a(h,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,c=l.occurrence;const f=l.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=xr,c=1),!(u===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,c,s)&&this.tryInRepetitionRecovery(t,e,r,u)}const jC=4,Fr=8,dm=1<<Fr,pm=2<<Fr,Zl=3<<Fr,Ql=4<<Fr,eu=5<<Fr,Xs=6<<Fr;function fl(t,e,r){return r|e|t}class Yc{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:vr.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(ue(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return Rt(e,r=>im(r,r,ln))}validateEmptyOrAlternatives(e){return Rt(e,r=>wC(r,ln))}validateAmbiguousAlternationAlternatives(e,r){return Rt(e,n=>bC(n,r,ln))}validateSomeNonEmptyLookaheadPath(e,r){return kC(e,r,ln)}buildLookaheadForAlternation(e){return dC(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hC)}buildLookaheadForOptional(e){return pC(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Vc(e.prodType),mC)}}class qC{initLooksAhead(e){this.dynamicTokensEnabled=j(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:vr.dynamicTokensEnabled,this.maxLookahead=j(e,"maxLookahead")?e.maxLookahead:vr.maxLookahead,this.lookaheadStrategy=j(e,"lookaheadStrategy")?e.lookaheadStrategy:new Yc({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){B(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=WC(r);B(n,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${Ut(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=fl(this.fullRuleNameToShort[r.name],dm,u.idx);this.setLaFuncCache(p,f)})}),B(i,u=>{this.computeLookaheadFunc(r,u.idx,Zl,"Repetition",u.maxLookahead,Ut(u))}),B(a,u=>{this.computeLookaheadFunc(r,u.idx,pm,"Option",u.maxLookahead,Ut(u))}),B(s,u=>{this.computeLookaheadFunc(r,u.idx,Ql,"RepetitionMandatory",u.maxLookahead,Ut(u))}),B(o,u=>{this.computeLookaheadFunc(r,u.idx,Xs,"RepetitionMandatoryWithSeparator",u.maxLookahead,Ut(u))}),B(l,u=>{this.computeLookaheadFunc(r,u.idx,eu,"RepetitionWithSeparator",u.maxLookahead,Ut(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=fl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return fl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class BC extends Ei{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)}}const Es=new BC;function WC(t){Es.reset(),t.accept(Es);const e=Es.dslMethods;return Es.reset(),e}function Td(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Rd(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 KC(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function VC(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const HC="name";function hm(t,e){Object.defineProperty(t,HC,{enumerable:!1,configurable:!0,writable:!1,value:e})}function YC(t,e){const r=At(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let l=0;l<o;l++){const u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function XC(t,e){const r=function(){};hm(r,t+"BaseSemantics");const n={visit:function(i,a){if(Q(i)&&(i=i[0]),!Rr(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=ZC(this,e);if(!ue(i)){const a=z(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
90
+ ${a.join(`
91
+
92
+ `).replace(/\n/g,`
93
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function JC(t,e,r){const n=function(){};hm(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return B(e,a=>{i[a]=YC}),n.prototype=i,n.prototype.constructor=n,n}var tu;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(tu||(tu={}));function ZC(t,e){return QC(t,e)}function QC(t,e){const r=Et(e,i=>Er(t[i])===!1),n=z(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:tu.MISSING_METHOD,methodName:i}));return Wa(n)}class eS{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=j(e,"nodeLocationTracking")?e.nodeLocationTracking:vr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Me,this.cstFinallyStateUpdate=Me,this.cstPostTerminal=Me,this.cstPostNonTerminal=Me,this.cstPostRule=Me;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Rd,this.setNodeLocationFromNode=Rd,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Td,this.setNodeLocationFromNode=Td,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=Me,this.setInitialNodeLocation=Me;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const 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){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];KC(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];VC(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Rr(this.baseCstVisitorConstructor)){const e=XC(this.className,At(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Rr(this.baseCstVisitorWithDefaultsConstructor)){const e=JC(this.className,At(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class tS{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ho}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?ho:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class rS{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=mo){if(rt(this.definedRulesNames,e)){const s={message:ln.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:tt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=mo){const i=SC(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(fo(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return cE(De(this.gastProductionsCache))}}class nS{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=co,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},j(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
94
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
95
+ For Further details.`);if(Q(e)){if(ue(e))throw Error(`A Token Vocabulary cannot be empty.
96
+ Note that the first argument for the parser constructor
97
+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
98
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
99
+ For Further details.`)}if(Q(e))this.tokensMap=ht(e,(a,s)=>(a[s.name]=s,a),{});else if(j(e,"modes")&&Ot(Pt(De(e.modes)),tC)){const a=Pt(De(e.modes)),s=Bc(a);this.tokensMap=ht(s,(o,l)=>(o[l.name]=l,o),{})}else if($t(e))this.tokensMap=He(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=xr;const n=j(e,"modes")?Pt(De(e.modes)):De(e),i=Ot(n,a=>ue(a.categoryMatches));this.tokenMatcher=i?co:Va,Ha(De(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'
100
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=j(n,"resyncEnabled")?n.resyncEnabled:mo.resyncEnabled,a=j(n,"recoveryValueFunc")?n.recoveryValueFunc:mo.recoveryValueFunc,s=this.ruleShortNameIdx<<jC+Fr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);const f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(fo(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(pm,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(Ql,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,Ql,e,cC)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Xs,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,md],o,Xs,e,md)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(Zl,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,Zl,e,uC,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(eu,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,hd],o,eu,e,hd)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Xs,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(dm,r),i=Q(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(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new MC(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw fo(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{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new cm(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===fm?n:a}}else throw n}saveRecogState(){const e=this.errors,r=He(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),xr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class iS{initErrorHandler(e){this._errors=[],this.errorMessageProvider=j(e,"errorMessageProvider")?e.errorMessageProvider:vr.errorMessageProvider}SAVE_ERROR(e){if(fo(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:He(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return He(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=Vo(e,a,r,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new FC(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Ko(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new DC(l,this.LA(1),o))}}class aS{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Rr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Qh([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Dt(e.ruleStack),i=this.getGAstProductions()[r];return new lC(i,e).startWalking()}}const Yo={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Yo);const vd=!0,$d=Math.pow(2,Fr)-1,mm=Jh({name:"RECORDING_PHASE_TOKEN",pattern:nt.NA});Ha([mm]);const gm=Kc(mm,`This IToken indicates the Parser is in Recording Phase
101
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(gm);const sS={name:`This CSTNode indicates the Parser is in Recording Phase
102
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class oS{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++){const 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",()=>{const e=this;for(let r=0;r<10;r++){const 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 ho}topLevelRuleRecord(e,r){try{const n=new Ai({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+`
103
+ This error was thrown during the "grammar recording phase" For more info see:
104
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Wi.call(this,Ve,e,r)}atLeastOneInternalRecord(e,r){Wi.call(this,mt,r,e)}atLeastOneSepFirstInternalRecord(e,r){Wi.call(this,gt,r,e,vd)}manyInternalRecord(e,r){Wi.call(this,Se,r,e)}manySepFirstInternalRecord(e,r){Wi.call(this,st,r,e,vd)}orInternalRecord(e,r){return lS.call(this,e,r)}subruleInternalRecord(e,r,n){if(po(r),!e||j(e,"ruleName")===!1){const o=new Error(`<SUBRULE${Ad(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
105
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=hn(this.recordingProdStack),a=e.ruleName,s=new et({idx:r,nonTerminalName:a,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?sS:Yo}consumeInternalRecord(e,r,n){if(po(r),!Yh(e)){const s=new Error(`<CONSUME${Ad(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
106
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=hn(this.recordingProdStack),a=new de({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(a),gm}}function Wi(t,e,r,n=!1){po(r);const i=hn(this.recordingProdStack),a=Er(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),j(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),Yo}function lS(t,e){po(e);const r=hn(this.recordingProdStack),n=Q(t)===!1,i=n===!1?t:t.DEF,a=new ot({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});j(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=Fh(i,o=>Er(o.GATE));return a.hasPredicates=s,r.definition.push(a),B(i,o=>{const l=new at({definition:[]});a.definition.push(l),j(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:j(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Yo}function Ad(t){return t===0?"":`${t}`}function po(t){if(t<0||t>$d){const e=new Error(`Invalid DSL Method idx value: <${t}>
107
+ Idx value must be a none negative value smaller than ${$d+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class uS{initPerformanceTracer(e){if(j(e,"traceInitPerf")){const 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=vr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=zh(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function cS(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const ho=Kc(xr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ho);const vr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),mo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var tt;(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"})(tt||(tt={}));function Ed(t=void 0){return function(){return t}}class Ya{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Uh(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),B(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=LC({rules:De(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(ue(n)&&this.skipValidations===!1){const i=xC({rules:De(this.gastProductionsCache),tokenTypes:De(this.tokensMap),errMsgProvider:ln,grammarName:r}),a=RC({lookaheadStrategy:this.lookaheadStrategy,rules:De(this.gastProductionsCache),tokenTypes:De(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),ue(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=yE(De(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:De(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(De(this.gastProductionsCache))})),!Ya.DEFER_DEFINITION_ERRORS_HANDLING&&!ue(this.definitionErrors))throw e=z(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
108
+ ${e.join(`
109
+ -------------------------------
110
+ `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),j(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
111
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
112
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
113
+ For further details.`);this.skipValidations=j(r,"skipValidations")?r.skipValidations:vr.skipValidations}}Ya.DEFER_DEFINITION_ERRORS_HANDLING=!1;cS(Ya,[zC,qC,eS,tS,nS,rS,iS,aS,oS,uS]);class fS extends Ya{constructor(e,r=vr){const n=He(r);n.outputCst=!1,super(e,n)}}function gi(t,e,r){return`${t.name}_${e}_${r}`}const Dr=1,dS=2,ym=4,Tm=5,Xa=7,pS=8,hS=9,mS=10,gS=11,Rm=12;class Xc{constructor(e){this.target=e}isEpsilon(){return!1}}class Jc extends Xc{constructor(e,r){super(e),this.tokenType=r}}class vm extends Xc{constructor(e){super(e)}isEpsilon(){return!0}}class Zc extends Xc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function yS(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};TS(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=$n(e,i,i);a!==void 0&&NS(e,i,a)}return e}function TS(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=Fe(t,i,void 0,{type:dS}),s=Fe(t,i,void 0,{type:Xa});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function $m(t,e,r){return r instanceof de?Qc(t,e,r.terminalType,r):r instanceof et?_S(t,e,r):r instanceof ot?ES(t,e,r):r instanceof Ve?CS(t,e,r):r instanceof Se?RS(t,e,r):r instanceof st?vS(t,e,r):r instanceof mt?$S(t,e,r):r instanceof gt?AS(t,e,r):$n(t,e,r)}function RS(t,e,r){const n=Fe(t,e,r,{type:Tm});Gr(t,n);const i=Ci(t,e,n,r,$n(t,e,r));return Em(t,e,r,i)}function vS(t,e,r){const n=Fe(t,e,r,{type:Tm});Gr(t,n);const i=Ci(t,e,n,r,$n(t,e,r)),a=Qc(t,e,r.separator,r);return Em(t,e,r,i,a)}function $S(t,e,r){const n=Fe(t,e,r,{type:ym});Gr(t,n);const i=Ci(t,e,n,r,$n(t,e,r));return Am(t,e,r,i)}function AS(t,e,r){const n=Fe(t,e,r,{type:ym});Gr(t,n);const i=Ci(t,e,n,r,$n(t,e,r)),a=Qc(t,e,r.separator,r);return Am(t,e,r,i,a)}function ES(t,e,r){const n=Fe(t,e,r,{type:Dr});Gr(t,n);const i=hr(r.definition,s=>$m(t,e,s));return Ci(t,e,n,r,...i)}function CS(t,e,r){const n=Fe(t,e,r,{type:Dr});Gr(t,n);const i=Ci(t,e,n,r,$n(t,e,r));return SS(t,e,r,i)}function $n(t,e,r){const n=wg(hr(r.definition,i=>$m(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:bS(t,n)}function Am(t,e,r,n,i){const a=n.left,s=n.right,o=Fe(t,e,r,{type:gS});Gr(t,o);const l=Fe(t,e,r,{type:Rm});return a.loopback=o,l.loopback=o,t.decisionMap[gi(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Pe(s,o),i===void 0?(Pe(o,a),Pe(o,l)):(Pe(o,l),Pe(o,i.left),Pe(i.right,a)),{left:a,right:l}}function Em(t,e,r,n,i){const a=n.left,s=n.right,o=Fe(t,e,r,{type:mS});Gr(t,o);const l=Fe(t,e,r,{type:Rm}),u=Fe(t,e,r,{type:hS});return o.loopback=u,l.loopback=u,Pe(o,a),Pe(o,l),Pe(s,u),i!==void 0?(Pe(u,l),Pe(u,i.left),Pe(i.right,a)):Pe(u,o),t.decisionMap[gi(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function SS(t,e,r,n){const i=n.left,a=n.right;return Pe(i,a),t.decisionMap[gi(e,"Option",r.idx)]=i,n}function Gr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ci(t,e,r,n,...i){const a=Fe(t,e,n,{type:pS,start:r});r.end=a;for(const o of i)o!==void 0?(Pe(r,o.left),Pe(o.right,a)):Pe(r,a);const s={left:r,right:a};return t.decisionMap[gi(e,wS(n),n.idx)]=r,s}function wS(t){if(t instanceof ot)return"Alternation";if(t instanceof Ve)return"Option";if(t instanceof Se)return"Repetition";if(t instanceof st)return"RepetitionWithSeparator";if(t instanceof mt)return"RepetitionMandatory";if(t instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function bS(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const l=o instanceof Zc,u=o,c=e[a+1].left;s.left.type===Dr&&s.right.type===Dr&&o!==void 0&&(l&&u.followState===s.right||o.target===s.right)?(l?u.followState=c:o.target=c,kS(t,s.right)):Pe(s.right,c)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Qc(t,e,r,n){const i=Fe(t,e,n,{type:Dr}),a=Fe(t,e,n,{type:Dr});return ef(i,new Jc(a,r)),{left:i,right:a}}function _S(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=Fe(t,e,r,{type:Dr}),s=Fe(t,e,r,{type:Dr}),o=new Zc(i,n,s);return ef(a,o),{left:a,right:s}}function NS(t,e,r){const n=t.ruleToStartState.get(e);Pe(n,r.left);const i=t.ruleToStopState.get(e);return Pe(r.right,i),{left:n,right:i}}function Pe(t,e){const r=new vm(e);ef(t,r)}function Fe(t,e,r,n){const 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 ef(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function kS(t,e){t.states.splice(t.states.indexOf(e),1)}const go={};class ru{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Cm(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return hr(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function Cm(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function IS(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}class Sm{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}}const Cd=new Sm;class PS extends Yc{constructor(e){var r;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(e){this.atn=yS(e.rules),this.dfas=OS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=gi(n,"Alternation",r),c=this.atn.decisionMap[l].decision,f=hr(gd({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>hr(p,h=>h[0]));if(Sd(f,!1)&&!a){const p=uf(f,(h,$,b)=>(Qo($,I=>{I&&(h[I.tokenTypeIdx]=b,Qo(I.categoryMatches,E=>{h[E]=b}))}),h),{});return i?function(h){var $;const b=this.LA(1),I=p[b.tokenTypeIdx];if(h!==void 0&&I!==void 0){const E=($=h[I])===null||$===void 0?void 0:$.GATE;if(E!==void 0&&E.call(this)===!1)return}return I}:function(){const h=this.LA(1);return p[h.tokenTypeIdx]}}else return i?function(p){const h=new Sm,$=p===void 0?0:p.length;for(let I=0;I<$;I++){const E=p?.[I].GATE;h.set(I,E===void 0||E.call(this))}const b=dl.call(this,s,c,h,o);return typeof b=="number"?b:void 0}:function(){const p=dl.call(this,s,c,Cd,o);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=gi(n,i,r),c=this.atn.decisionMap[l].decision,f=hr(gd({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>hr(p,h=>h[0]));if(Sd(f)&&f[0][0]&&!a){const p=f[0],h=$g(p);if(h.length===1&&bg(h[0].categoryMatches)){const b=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===b}}else{const $=uf(h,(b,I)=>(I!==void 0&&(b[I.tokenTypeIdx]=!0,Qo(I.categoryMatches,E=>{b[E]=!0})),b),{});return function(){const b=this.LA(1);return $[b.tokenTypeIdx]===!0}}}return function(){const p=dl.call(this,s,c,Cd,o);return typeof p=="object"?!1:p===0}}}function Sd(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function OS(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=IS(t.decisionStates[n],n);return r}function dl(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=BS(i.atnStartState);a=bm(i,wm(o)),i.start=a}return LS.apply(this,[i,a,r,n])}function LS(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let l=zS(i,o);if(l===void 0&&(l=xS.apply(this,[t,i,o,a,r,n])),l===go)return GS(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function xS(t,e,r,n,i,a){const s=US(e.configs,r,i);if(s.size===0)return wd(t,e,r,go),go;let o=wm(s);const l=qS(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(HS(s)){const u=Ag(s.alts);o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u,DS.apply(this,[t,n,s.alts,a])}return o=wd(t,e,r,o),o}function DS(t,e,r,n){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=MS({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function MS(t){const e=hr(t.prefixPath,i=>Vn(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${FS(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
114
+ <${e}> may appears as a prefix path in all these alternatives.
115
+ `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
116
+ For Further details.`,n}function FS(t){if(t instanceof et)return"SUBRULE";if(t instanceof Ve)return"OPTION";if(t instanceof ot)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof st)return"MANY_SEP";if(t instanceof Se)return"MANY";if(t instanceof de)return"CONSUME";throw Error("non exhaustive match")}function GS(t,e,r){const n=_g(e.configs.elements,a=>a.state.transitions),i=Ng(n.filter(a=>a instanceof Jc).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function zS(t,e){return t.edges[e.tokenTypeIdx]}function US(t,e,r){const n=new ru,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Xa){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],c=jS(u,e);c!==void 0&&n.add({state:c,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new ru;for(const s of n.elements)yo(s,a)}if(i.length>0&&!KS(a))for(const s of i)a.add(s);return a}function jS(t,e){if(t instanceof Jc&&Zh(e,t.tokenType))return t.target}function qS(t,e){let r;for(const 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 wm(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function wd(t,e,r,n){return n=bm(t,n),e.edges[r.tokenTypeIdx]=n,n}function bm(t,e){if(e===go)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function BS(t){const e=new ru,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};yo(a,e)}return e}function yo(t,e){const r=t.state;if(r.type===Xa){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};yo(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=WS(t,a);s!==void 0&&yo(s,e)}}function WS(t,e){if(e instanceof vm)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Zc){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function KS(t){for(const e of t.elements)if(e.state.type===Xa)return!0;return!1}function VS(t){for(const e of t.elements)if(e.state.type!==Xa)return!1;return!0}function HS(t){if(VS(t))return!0;const e=YS(t.elements);return XS(e)&&!JS(e)}function YS(t){const e=new Map;for(const r of t){const n=Cm(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function XS(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function JS(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var nu;(function(t){function e(r){return typeof r=="string"}t.is=e})(nu||(nu={}));var To;(function(t){function e(r){return typeof r=="string"}t.is=e})(To||(To={}));var iu;(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})(iu||(iu={}));var ba;(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})(ba||(ba={}));var re;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=ba.MAX_VALUE),i===Number.MAX_VALUE&&(i=ba.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})(re||(re={}));var X;(function(t){function e(n,i,a,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(a)&&v.uinteger(s))return{start:re.create(n,i),end:re.create(a,s)};if(re.is(n)&&re.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&re.is(i.start)&&re.is(i.end)}t.is=r})(X||(X={}));var _a;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&X.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(_a||(_a={}));var au;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&X.is(i.targetRange)&&v.string(i.targetUri)&&X.is(i.targetSelectionRange)&&(X.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(au||(au={}));var Ro;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const 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})(Ro||(Ro={}));var su;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&X.is(i.range)&&Ro.is(i.color)}t.is=r})(su||(su={}));var ou;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||Bt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,Bt.is))}t.is=r})(ou||(ou={}));var lu;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(lu||(lu={}));var uu;(function(t){function e(n,i,a,s,o,l){const u={startLine:n,endLine:i};return v.defined(a)&&(u.startCharacter=a),v.defined(s)&&(u.endCharacter=s),v.defined(o)&&(u.kind=o),v.defined(l)&&(u.collapsedText=l),u}t.create=e;function r(n){const 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})(uu||(uu={}));var vo;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&_a.is(i.location)&&v.string(i.message)}t.is=r})(vo||(vo={}));var cu;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(cu||(cu={}));var fu;(function(t){t.Unnecessary=1,t.Deprecated=2})(fu||(fu={}));var du;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(du||(du={}));var Na;(function(t){function e(n,i,a,s,o,l){let u={range:n,message:i};return v.defined(a)&&(u.severity=a),v.defined(s)&&(u.code=s),v.defined(o)&&(u.source=o),v.defined(l)&&(u.relatedInformation=l),u}t.create=e;function r(n){var i;let a=n;return v.defined(a)&&X.is(a.range)&&v.string(a.message)&&(v.number(a.severity)||v.undefined(a.severity))&&(v.integer(a.code)||v.string(a.code)||v.undefined(a.code))&&(v.undefined(a.codeDescription)||v.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(a.source)||v.undefined(a.source))&&(v.undefined(a.relatedInformation)||v.typedArray(a.relatedInformation,vo.is))}t.is=r})(Na||(Na={}));var gn;(function(t){function e(n,i,...a){let s={title:n,command:i};return v.defined(a)&&a.length>0&&(s.arguments=a),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})(gn||(gn={}));var Bt;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return v.objectLiteral(s)&&v.string(s.newText)&&X.is(s.range)}t.is=i})(Bt||(Bt={}));var un;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const 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})(un||(un={}));var Ke;(function(t){function e(r){const n=r;return v.string(n)}t.is=e})(Ke||(Ke={}));var pr;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return Bt.is(s)&&(un.is(s.annotationId)||Ke.is(s.annotationId))}t.is=i})(pr||(pr={}));var ka;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Ia.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(ka||(ka={}));var yi;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),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||Ke.is(i.annotationId))}t.is=r})(yi||(yi={}));var Ti;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}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||Ke.is(i.annotationId))}t.is=r})(Ti||(Ti={}));var Ri;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),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||Ke.is(i.annotationId))}t.is=r})(Ri||(Ri={}));var $o;(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)?yi.is(i)||Ti.is(i)||Ri.is(i):ka.is(i)))}t.is=e})($o||($o={}));class Cs{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=Bt.insert(e,r):Ke.is(n)?(a=n,i=pr.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=pr.insert(e,r,a)),this.edits.push(i),a!==void 0)return a}replace(e,r,n){let i,a;if(n===void 0?i=Bt.replace(e,r):Ke.is(n)?(a=n,i=pr.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=pr.replace(e,r,a)),this.edits.push(i),a!==void 0)return a}delete(e,r){let n,i;if(r===void 0?n=Bt.del(e):Ke.is(r)?(i=r,n=pr.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=pr.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.")}}class bd{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(Ke.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()}}class ZS{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new bd(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(ka.is(r)){const n=new Cs(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new Cs(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(Ia.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const r={uri:e.uri,version:e.version};let n=this._textEditChanges[r.uri];if(!n){const i=[],a={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(a),n=new Cs(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 Cs(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new bd,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;un.is(r)||Ke.is(r)?i=r:n=r;let a,s;if(i===void 0?a=yi.create(e,n):(s=Ke.is(i)?i:this._changeAnnotations.manage(i),a=yi.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),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 a;un.is(n)||Ke.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Ti.create(e,r,i):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=Ti.create(e,r,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}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;un.is(r)||Ke.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Ri.create(e,n):(s=Ke.is(i)?i:this._changeAnnotations.manage(i),a=Ri.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var pu;(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})(pu||(pu={}));var hu;(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})(hu||(hu={}));var Ia;(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})(Ia||(Ia={}));var mu;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,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})(mu||(mu={}));var Ao;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Ao||(Ao={}));var vi;(function(t){function e(r){const n=r;return v.objectLiteral(r)&&Ao.is(n.kind)&&v.string(n.value)}t.is=e})(vi||(vi={}));var gu;(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})(gu||(gu={}));var yu;(function(t){t.PlainText=1,t.Snippet=2})(yu||(yu={}));var Tu;(function(t){t.Deprecated=1})(Tu||(Tu={}));var Ru;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&v.string(i.newText)&&X.is(i.insert)&&X.is(i.replace)}t.is=r})(Ru||(Ru={}));var vu;(function(t){t.asIs=1,t.adjustIndentation=2})(vu||(vu={}));var $u;(function(t){function e(r){const n=r;return n&&(v.string(n.detail)||n.detail===void 0)&&(v.string(n.description)||n.description===void 0)}t.is=e})($u||($u={}));var Au;(function(t){function e(r){return{label:r}}t.create=e})(Au||(Au={}));var Eu;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Eu||(Eu={}));var Pa;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=r})(Pa||(Pa={}));var Cu;(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(vi.is(n.contents)||Pa.is(n.contents)||v.typedArray(n.contents,Pa.is))&&(r.range===void 0||X.is(r.range))}t.is=e})(Cu||(Cu={}));var Su;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Su||(Su={}));var wu;(function(t){function e(r,n,...i){let a={label:r};return v.defined(n)&&(a.documentation=n),v.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(wu||(wu={}));var bu;(function(t){t.Text=1,t.Read=2,t.Write=3})(bu||(bu={}));var _u;(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(_u||(_u={}));var Nu;(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})(Nu||(Nu={}));var ku;(function(t){t.Deprecated=1})(ku||(ku={}));var Iu;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(Iu||(Iu={}));var Pu;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Pu||(Pu={}));var Ou;(function(t){function e(n,i,a,s,o,l){let u={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(u.children=l),u}t.create=e;function r(n){let i=n;return i&&v.string(i.name)&&v.number(i.kind)&&X.is(i.range)&&X.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})(Ou||(Ou={}));var Lu;(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"})(Lu||(Lu={}));var Oa;(function(t){t.Invoked=1,t.Automatic=2})(Oa||(Oa={}));var xu;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.typedArray(i.diagnostics,Na.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Oa.Invoked||i.triggerKind===Oa.Automatic)}t.is=r})(xu||(xu={}));var Du;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):gn.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,Na.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||gn.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||$o.is(i.edit))}t.is=r})(Du||(Du={}));var Mu;(function(t){function e(n,i){let a={range:n};return v.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return v.defined(i)&&X.is(i.range)&&(v.undefined(i.command)||gn.is(i.command))}t.is=r})(Mu||(Mu={}));var Fu;(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})(Fu||(Fu={}));var Gu;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return v.defined(i)&&X.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(Gu||(Gu={}));var zu;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&X.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(zu||(zu={}));var Uu;(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"})(Uu||(Uu={}));var ju;(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"})(ju||(ju={}));var qu;(function(t){function e(r){const 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})(qu||(qu={}));var Bu;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&v.string(i.text)}t.is=r})(Bu||(Bu={}));var Wu;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(Wu||(Wu={}));var Ku;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&X.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Ku||(Ku={}));var Vu;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return v.defined(i)&&X.is(n.stoppedLocation)}t.is=r})(Vu||(Vu={}));var Eo;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Eo||(Eo={}));var Co;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||vi.is(i.tooltip))&&(i.location===void 0||_a.is(i.location))&&(i.command===void 0||gn.is(i.command))}t.is=r})(Co||(Co={}));var Hu;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&re.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,Co.is))&&(i.kind===void 0||Eo.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,Bt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||vi.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Hu||(Hu={}));var Yu;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Yu||(Yu={}));var Xu;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(Xu||(Xu={}));var Ju;(function(t){function e(r){return{items:r}}t.create=e})(Ju||(Ju={}));var Zu;(function(t){t.Invoked=0,t.Automatic=1})(Zu||(Zu={}));var Qu;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Qu||(Qu={}));var ec;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(ec||(ec={}));var tc;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&To.is(n.uri)&&v.string(n.name)}t.is=e})(tc||(tc={}));const QS=[`
117
+ `,`\r
118
+ `,"\r"];var rc;(function(t){function e(a,s,o,l){return new ew(a,s,o,l)}t.create=e;function r(a){let s=a;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(a,s){let o=a.getText(),l=i(s,(c,f)=>{let p=c.range.start.line-f.range.start.line;return p===0?c.range.start.character-f.range.start.character:p}),u=o.length;for(let c=l.length-1;c>=0;c--){let f=l[c],p=a.offsetAt(f.range.start),h=a.offsetAt(f.range.end);if(h<=u)o=o.substring(0,p)+f.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");u=p}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,l=a.slice(0,o),u=a.slice(o);i(l,s),i(u,s);let c=0,f=0,p=0;for(;c<l.length&&f<u.length;)s(l[c],u[f])<=0?a[p++]=l[c++]:a[p++]=u[f++];for(;c<l.length;)a[p++]=l[c++];for(;f<u.length;)a[p++]=u[f++];return a}})(rc||(rc={}));let ew=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 a=r.charAt(i);n=a==="\r"||a===`
119
+ `,a==="\r"&&i+1<r.length&&r.charAt(i+1)===`
120
+ `&&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 re.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let a=n-1;return re.create(a,e-r[a])}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}};var v;(function(t){const e=Object.prototype.toString;function r(h){return typeof h<"u"}t.defined=r;function n(h){return typeof h>"u"}t.undefined=n;function i(h){return h===!0||h===!1}t.boolean=i;function a(h){return e.call(h)==="[object String]"}t.string=a;function s(h){return e.call(h)==="[object Number]"}t.number=s;function o(h,$,b){return e.call(h)==="[object Number]"&&$<=h&&h<=b}t.numberRange=o;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=l;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=u;function c(h){return e.call(h)==="[object Function]"}t.func=c;function f(h){return h!==null&&typeof h=="object"}t.objectLiteral=f;function p(h,$){return Array.isArray(h)&&h.every($)}t.typedArray=p})(v||(v={}));const tw=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return pr},get ChangeAnnotation(){return un},get ChangeAnnotationIdentifier(){return Ke},get CodeAction(){return Du},get CodeActionContext(){return xu},get CodeActionKind(){return Lu},get CodeActionTriggerKind(){return Oa},get CodeDescription(){return du},get CodeLens(){return Mu},get Color(){return Ro},get ColorInformation(){return su},get ColorPresentation(){return ou},get Command(){return gn},get CompletionItem(){return Au},get CompletionItemKind(){return gu},get CompletionItemLabelDetails(){return $u},get CompletionItemTag(){return Tu},get CompletionList(){return Eu},get CreateFile(){return yi},get DeleteFile(){return Ri},get Diagnostic(){return Na},get DiagnosticRelatedInformation(){return vo},get DiagnosticSeverity(){return cu},get DiagnosticTag(){return fu},get DocumentHighlight(){return _u},get DocumentHighlightKind(){return bu},get DocumentLink(){return Gu},get DocumentSymbol(){return Ou},get DocumentUri(){return nu},EOL:QS,get FoldingRange(){return uu},get FoldingRangeKind(){return lu},get FormattingOptions(){return Fu},get Hover(){return Cu},get InlayHint(){return Hu},get InlayHintKind(){return Eo},get InlayHintLabelPart(){return Co},get InlineCompletionContext(){return ec},get InlineCompletionItem(){return Xu},get InlineCompletionList(){return Ju},get InlineCompletionTriggerKind(){return Zu},get InlineValueContext(){return Vu},get InlineValueEvaluatableExpression(){return Ku},get InlineValueText(){return Bu},get InlineValueVariableLookup(){return Wu},get InsertReplaceEdit(){return Ru},get InsertTextFormat(){return yu},get InsertTextMode(){return vu},get Location(){return _a},get LocationLink(){return au},get MarkedString(){return Pa},get MarkupContent(){return vi},get MarkupKind(){return Ao},get OptionalVersionedTextDocumentIdentifier(){return Ia},get ParameterInformation(){return Su},get Position(){return re},get Range(){return X},get RenameFile(){return Ti},get SelectedCompletionInfo(){return Qu},get SelectionRange(){return zu},get SemanticTokenModifiers(){return ju},get SemanticTokenTypes(){return Uu},get SemanticTokens(){return qu},get SignatureInformation(){return wu},get StringValue(){return Yu},get SymbolInformation(){return Iu},get SymbolKind(){return Nu},get SymbolTag(){return ku},get TextDocument(){return rc},get TextDocumentEdit(){return ka},get TextDocumentIdentifier(){return pu},get TextDocumentItem(){return mu},get TextEdit(){return Bt},get URI(){return To},get VersionedTextDocumentIdentifier(){return hu},WorkspaceChange:ZS,get WorkspaceEdit(){return $o},get WorkspaceFolder(){return tc},get WorkspaceSymbol(){return Pu},get integer(){return iu},get uinteger(){return ba}},Symbol.toStringTag,{value:"Module"}));class rw{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Nm(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new tf;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new nc(e.startOffset,e.image.length,Ul(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new nc(a.startOffset,a.image.length,Ul(a),a.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;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}}class _m{get hidden(){return!1}get astNode(){const 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)}}class nc extends _m{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,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class tf extends _m{constructor(){super(...arguments),this.content=new rf(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{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:re.create(0,0),end:re.create(0,0)}}get firstNonHiddenNode(){for(const 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--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class rf extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,rf.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(const r of e)r.container=this.parent}}class Nm extends tf{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const ic=Symbol("Datatype");function pl(t){return t.$type===ic}const _d="​",km=t=>t.endsWith(_d)?t:t+_d;class Im{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new ow(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Om(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}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()}}class nw extends Im{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new rw,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){const n=this.computeRuleType(e);let i;ro(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(km(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),$r(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){const a=e.operators.precedences[i];for(const s of a.operators)n.set(s.value,{precedence:i,rightAssoc:a.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return ro(e)?Aa(e):e.fragment?void 0:sh(e)?ic:Aa(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const 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.");const a=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Ol(a,{deep:!0}),{value:a,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=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===ic?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const 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){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const c=fn(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(pl(u)){let c=i.image;fn(n)||(c=this.converter.convert(c,s).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(pl(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}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);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):pl(e)?this.converter.convert(e.value,e.$cstNode):(Pg(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let b=0;b<i.length;b++){const I=i[b],E=r.get(I)??{precedence:1/0,rightAssoc:!1};E.precedence>s?(s=E.precedence,a=b):E.precedence===s&&(E.rightAssoc||(a=b))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),c=n.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},h=this.constructInfix(f,r),$=this.constructInfix(p,r);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:i[a],right:$}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=wo(e,cn);this.assignmentMap.set(e,{assignment:r,crossRef:r&&_o(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class iw{buildMismatchTokenMessage(e){return Bn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Bn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Bn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Bn.buildEarlyExitMessage(e)}}class Pm extends iw{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}\`.`}}class aw extends Im{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const 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){const n=this.wrapper.DEFINE_RULE(km(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=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const 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,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const sw={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Pm};class Om extends fS{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...sw,lookaheadStrategy:n?new Yc({maxLookahead:r.maxLookahead}):new PS({logging:r.skipValidations?()=>{}:void 0}),...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,{})}}class ow extends Om{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}}function Lm(t,e,r){return lw({parser:e,tokens:r,ruleNames:new Map},t),e}function lw(t,e){const r=th(e,!1),n=Te(e.rules).filter($r).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,yn(s,a.definition))}const i=Te(e.rules).filter(ro).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,uw(t,a))}function uw(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Ar(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(h=>h.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const f=n.map(h=>t.tokens[h.value]).map((h,$)=>({ALT:()=>t.parser.consume($,h,l)}));let p;return h=>{p??(p=nf(t,r)),t.parser.subrule(0,p,!1,a,h),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,p,!1,u,h)}})}}function yn(t,e,r=!1){let n;if(fn(e))n=gw(t,e);else if(bo(e))n=cw(t,e);else if(cn(e))n=yn(t,e.terminal);else if(_o(e))n=xm(t,e);else if(dn(e))n=fw(t,e);else if(Hp(e))n=pw(t,e);else if(Xp(e))n=hw(t,e);else if(Ec(e))n=mw(t,e);else if(Fg(e)){const i=t.consume++;n=()=>t.parser.consume(i,xr,e)}else throw new Zp(e.$cstNode,`Unexpected element type: ${e.$type}`);return Dm(t,r?void 0:So(e),n,e.cardinality)}function cw(t,e){const r=Aa(e);return()=>t.parser.action(r,e)}function fw(t,e){const r=e.rule.ref;if(Fa(r)){const n=t.subrule++,i=$r(r)&&r.fragment,a=e.arguments.length>0?dw(r,e.arguments):()=>({});let s;return o=>{s??(s=nf(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Ar(r)){const n=t.consume++,i=ac(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Ga();else throw new Zp(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function dw(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:jt(i.value)}));return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>jt(i.value));return i=>{const a={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){const o=t.parameters[s].name,l=n[s];a[o]=l(i)}return a}}}function jt(t){if(Mg(t)){const e=jt(t.left),r=jt(t.right);return n=>e(n)||r(n)}else if(Dg(t)){const e=jt(t.left),r=jt(t.right);return n=>e(n)&&r(n)}else if(Ug(t)){const e=jt(t.value);return r=>!e(r)}else if(jg(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Lg(t)){const e=!!t.true;return()=>e}Ga()}function pw(t,e){if(e.elements.length===1)return yn(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:yn(t,i,!0)},s=So(i);s&&(a.GATE=jt(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function hw(t,e){if(e.elements.length===1)return yn(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:yn(t,o,!0)},u=So(o);u&&(l.GATE=jt(u)),r.push(l)}const n=t.or++,i=(o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},a=o=>t.parser.alternatives(n,r.map((l,u)=>{const c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(l.ALT(o),!f.isRecording()){const h=i(n,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);const $=f.unorderedGroups.get(h);typeof $?.[u]>"u"&&($[u]=!0)}};const p=l.GATE;return p?c.GATE=()=>p(o):c.GATE=()=>!f.unorderedGroups.get(i(n,f))?.[u],c})),s=Dm(t,So(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function mw(t,e){const r=e.elements.map(n=>yn(t,n));return n=>r.forEach(i=>i(n))}function So(t){if(Ec(t))return t.guardCondition}function xm(t,e,r=e.terminal){if(r)if(dn(r)&&$r(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=nf(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(dn(r)&&Ar(r.rule.ref)){const n=t.consume++,i=ac(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(fn(r)){const n=t.consume++,i=ac(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);const i=ih(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Aa(e.type.ref));return xm(t,e,i)}}function gw(t,e){const 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 Dm(t,e,r,n){const i=e&&jt(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:Ed(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:Ed(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else Ga()}function nf(t,e){const r=yw(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function yw(t,e){if(Fa(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!$r(n);)(Ec(n)||Hp(n)||Xp(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 ac(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Tw(t){const e=t.Grammar,r=t.parser.Lexer,n=new aw(t);return Lm(e,n,r.definition),n.finalize(),n}function Rw(t){const e=vw(t);return e.finalize(),e}function vw(t){const e=t.Grammar,r=t.parser.Lexer,n=new nw(t);return Lm(e,n,r.definition)}class Mm{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Te(th(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Ar).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Sc(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=eh(r)?nt.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Fa).flatMap(i=>Ma(i).filter(fn)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(ko(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i?.PATTERN;return a?.source&&dy("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class Fm{convert(e,r){let n=r.grammarSource;if(_o(n)&&(n=gy(n)),dn(n)){const 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 fr.convertInt(r);case"STRING":return fr.convertString(r);case"ID":return fr.convertID(r)}switch(Ey(e)?.toLowerCase()){case"number":return fr.convertNumber(r);case"boolean":return fr.convertBoolean(r);case"bigint":return fr.convertBigint(r);case"date":return fr.convertDate(r);default:return r}}}var fr;(function(t){function e(u){let c="";for(let f=1;f<u.length-1;f++){const p=u.charAt(f);if(p==="\\"){const h=u.charAt(++f);c+=r(h)}else c+=p}return c}t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
121
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function a(u){return BigInt(u)}t.convertBigint=a;function s(u){return new Date(u)}t.convertDate=s;function o(u){return Number(u)}t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}t.convertBoolean=l})(fr||(fr={}));var jr={},Ss={},Nd;function An(){if(Nd)return Ss;Nd=1,Object.defineProperty(Ss,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return(function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n})(e||(e={})),Ss.default=e,Ss}var Ue={},kd;function Ja(){if(kd)return Ue;kd=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.stringArray=Ue.array=Ue.func=Ue.error=Ue.number=Ue.string=Ue.boolean=void 0;function t(o){return o===!0||o===!1}Ue.boolean=t;function e(o){return typeof o=="string"||o instanceof String}Ue.string=e;function r(o){return typeof o=="number"||o instanceof Number}Ue.number=r;function n(o){return o instanceof Error}Ue.error=n;function i(o){return typeof o=="function"}Ue.func=i;function a(o){return Array.isArray(o)}Ue.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return Ue.stringArray=s,Ue}var qr={},Id;function Si(){if(Id)return qr;Id=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.Emitter=qr.Event=void 0;const t=An();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(qr.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let l=0,u=this._callbacks.length;l<u;l++)if(this._callbacks[l]===a)if(this._contexts[l]===s){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let u=0,c=o.length;u<c;u++)try{s.push(o[u].apply(l[u],a))}catch(f){(0,t.default)().console.error(f)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),l.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return qr.Emitter=n,n._noop=function(){},qr}var Pd;function Xo(){if(Pd)return jr;Pd=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.CancellationTokenSource=jr.CancellationToken=void 0;const t=An(),e=Ja(),r=Si();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function l(u){const c=u;return c&&(c===o.None||c===o.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}o.is=l})(n||(jr.CancellationToken=n={}));const i=Object.freeze(function(o,l){const u=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){u.dispose()}}});class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return jr.CancellationTokenSource=s,jr}var ve=Xo();function $w(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Js=0,Aw=10;function Ew(){return Js=performance.now(),new ve.CancellationTokenSource}const Wn=Symbol("OperationCancelled");function Jo(t){return t===Wn}async function Qe(t){if(t===ve.CancellationToken.None)return;const e=performance.now();if(e-Js>=Aw&&(Js=e,await $w(),Js=performance.now()),t.isCancellationRequested)throw Wn}class af{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class La{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){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(La.isIncremental(n)){const i=zm(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const c=Od(n.text,!1,a);if(l-o===c.length)for(let p=0,h=c.length;p<h;p++)u[p+o+1]=c[p];else c.length<1e4?u.splice(o+1,l-o,...c):this._lineOffsets=u=u.slice(0,o+1).concat(c,u.slice(l+1));const f=n.text.length-(s-a);if(f!==0)for(let p=o+1+c.length,h=u.length;p<h;p++)u[p]=u[p]+f}else if(La.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=Od(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&Gm(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var sc;(function(t){function e(i,a,s,o){return new La(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof La)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=oc(a.map(Cw),(c,f)=>{const p=c.range.start.line-f.range.start.line;return p===0?c.range.start.character-f.range.start.character:p});let l=0;const u=[];for(const c of o){const f=i.offsetAt(c.range.start);if(f<l)throw new Error("Overlapping edit");f>l&&u.push(s.substring(l,f)),c.newText.length&&u.push(c.newText),l=i.offsetAt(c.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(sc||(sc={}));function oc(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);oc(n,e),oc(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function Od(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);Gm(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Gm(t){return t===13||t===10}function zm(t){const 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 Cw(t){const e=zm(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Um;(()=>{var t={975:N=>{function T(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function g(y,R){for(var A,L="",D=0,x=-1,U=0,F=0;F<=y.length;++F){if(F<y.length)A=y.charCodeAt(F);else{if(A===47)break;A=47}if(A===47){if(!(x===F-1||U===1))if(x!==F-1&&U===2){if(L.length<2||D!==2||L.charCodeAt(L.length-1)!==46||L.charCodeAt(L.length-2)!==46){if(L.length>2){var ae=L.lastIndexOf("/");if(ae!==L.length-1){ae===-1?(L="",D=0):D=(L=L.slice(0,ae)).length-1-L.lastIndexOf("/"),x=F,U=0;continue}}else if(L.length===2||L.length===1){L="",D=0,x=F,U=0;continue}}R&&(L.length>0?L+="/..":L="..",D=2)}else L.length>0?L+="/"+y.slice(x+1,F):L=y.slice(x+1,F),D=F-x-1;x=F,U=0}else A===46&&U!==-1?++U:U=-1}return L}var w={resolve:function(){for(var y,R="",A=!1,L=arguments.length-1;L>=-1&&!A;L--){var D;L>=0?D=arguments[L]:(y===void 0&&(y=process.cwd()),D=y),T(D),D.length!==0&&(R=D+"/"+R,A=D.charCodeAt(0)===47)}return R=g(R,!A),A?R.length>0?"/"+R:"/":R.length>0?R:"."},normalize:function(y){if(T(y),y.length===0)return".";var R=y.charCodeAt(0)===47,A=y.charCodeAt(y.length-1)===47;return(y=g(y,!R)).length!==0||R||(y="."),y.length>0&&A&&(y+="/"),R?"/"+y:y},isAbsolute:function(y){return T(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,R=0;R<arguments.length;++R){var A=arguments[R];T(A),A.length>0&&(y===void 0?y=A:y+="/"+A)}return y===void 0?".":w.normalize(y)},relative:function(y,R){if(T(y),T(R),y===R||(y=w.resolve(y))===(R=w.resolve(R)))return"";for(var A=1;A<y.length&&y.charCodeAt(A)===47;++A);for(var L=y.length,D=L-A,x=1;x<R.length&&R.charCodeAt(x)===47;++x);for(var U=R.length-x,F=D<U?D:U,ae=-1,q=0;q<=F;++q){if(q===F){if(U>F){if(R.charCodeAt(x+q)===47)return R.slice(x+q+1);if(q===0)return R.slice(x+q)}else D>F&&(y.charCodeAt(A+q)===47?ae=q:q===0&&(ae=0));break}var ne=y.charCodeAt(A+q);if(ne!==R.charCodeAt(x+q))break;ne===47&&(ae=q)}var Ge="";for(q=A+ae+1;q<=L;++q)q!==L&&y.charCodeAt(q)!==47||(Ge.length===0?Ge+="..":Ge+="/..");return Ge.length>0?Ge+R.slice(x+ae):(x+=ae,R.charCodeAt(x)===47&&++x,R.slice(x))},_makeLong:function(y){return y},dirname:function(y){if(T(y),y.length===0)return".";for(var R=y.charCodeAt(0),A=R===47,L=-1,D=!0,x=y.length-1;x>=1;--x)if((R=y.charCodeAt(x))===47){if(!D){L=x;break}}else D=!1;return L===-1?A?"/":".":A&&L===1?"//":y.slice(0,L)},basename:function(y,R){if(R!==void 0&&typeof R!="string")throw new TypeError('"ext" argument must be a string');T(y);var A,L=0,D=-1,x=!0;if(R!==void 0&&R.length>0&&R.length<=y.length){if(R.length===y.length&&R===y)return"";var U=R.length-1,F=-1;for(A=y.length-1;A>=0;--A){var ae=y.charCodeAt(A);if(ae===47){if(!x){L=A+1;break}}else F===-1&&(x=!1,F=A+1),U>=0&&(ae===R.charCodeAt(U)?--U==-1&&(D=A):(U=-1,D=F))}return L===D?D=F:D===-1&&(D=y.length),y.slice(L,D)}for(A=y.length-1;A>=0;--A)if(y.charCodeAt(A)===47){if(!x){L=A+1;break}}else D===-1&&(x=!1,D=A+1);return D===-1?"":y.slice(L,D)},extname:function(y){T(y);for(var R=-1,A=0,L=-1,D=!0,x=0,U=y.length-1;U>=0;--U){var F=y.charCodeAt(U);if(F!==47)L===-1&&(D=!1,L=U+1),F===46?R===-1?R=U:x!==1&&(x=1):R!==-1&&(x=-1);else if(!D){A=U+1;break}}return R===-1||L===-1||x===0||x===1&&R===L-1&&R===A+1?"":y.slice(R,L)},format:function(y){if(y===null||typeof y!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof y);return(function(R,A){var L=A.dir||A.root,D=A.base||(A.name||"")+(A.ext||"");return L?L===A.root?L+D:L+"/"+D:D})(0,y)},parse:function(y){T(y);var R={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return R;var A,L=y.charCodeAt(0),D=L===47;D?(R.root="/",A=1):A=0;for(var x=-1,U=0,F=-1,ae=!0,q=y.length-1,ne=0;q>=A;--q)if((L=y.charCodeAt(q))!==47)F===-1&&(ae=!1,F=q+1),L===46?x===-1?x=q:ne!==1&&(ne=1):x!==-1&&(ne=-1);else if(!ae){U=q+1;break}return x===-1||F===-1||ne===0||ne===1&&x===F-1&&x===U+1?F!==-1&&(R.base=R.name=U===0&&D?y.slice(1,F):y.slice(U,F)):(U===0&&D?(R.name=y.slice(1,x),R.base=y.slice(1,F)):(R.name=y.slice(U,x),R.base=y.slice(U,F)),R.ext=y.slice(x,F)),U>0?R.dir=y.slice(0,U-1):D&&(R.dir="/"),R},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w,N.exports=w}},e={};function r(N){var T=e[N];if(T!==void 0)return T.exports;var g=e[N]={exports:{}};return t[N](g,g.exports,r),g.exports}r.d=(N,T)=>{for(var g in T)r.o(T,g)&&!r.o(N,g)&&Object.defineProperty(N,g,{enumerable:!0,get:T[g]})},r.o=(N,T)=>Object.prototype.hasOwnProperty.call(N,T),r.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>p,Utils:()=>he}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(N,T){if(!N.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!a.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!s.test(N.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(o.test(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",c="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{static isUri(T){return T instanceof p||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,g,w,y,R,A=!1){typeof T=="object"?(this.scheme=T.scheme||u,this.authority=T.authority||u,this.path=T.path||u,this.query=T.query||u,this.fragment=T.fragment||u):(this.scheme=(function(L,D){return L||D?L:"file"})(T,A),this.authority=g||u,this.path=(function(L,D){switch(L){case"https":case"http":case"file":D?D[0]!==c&&(D=c+D):D=c}return D})(this.scheme,w||u),this.query=y||u,this.fragment=R||u,l(this,A))}get fsPath(){return C(this)}with(T){if(!T)return this;let{scheme:g,authority:w,path:y,query:R,fragment:A}=T;return g===void 0?g=this.scheme:g===null&&(g=u),w===void 0?w=this.authority:w===null&&(w=u),y===void 0?y=this.path:y===null&&(y=u),R===void 0?R=this.query:R===null&&(R=u),A===void 0?A=this.fragment:A===null&&(A=u),g===this.scheme&&w===this.authority&&y===this.path&&R===this.query&&A===this.fragment?this:new $(g,w,y,R,A)}static parse(T,g=!1){const w=f.exec(T);return w?new $(w[2]||u,H(w[4]||u),H(w[5]||u),H(w[7]||u),H(w[9]||u),g):new $(u,u,u,u,u)}static file(T){let g=u;if(i&&(T=T.replace(/\\/g,c)),T[0]===c&&T[1]===c){const w=T.indexOf(c,2);w===-1?(g=T.substring(2),T=c):(g=T.substring(2,w),T=T.substring(w)||c)}return new $("file",g,T,u,u)}static from(T){const g=new $(T.scheme,T.authority,T.path,T.query,T.fragment);return l(g,!0),g}toString(T=!1){return S(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof p)return T;{const g=new $(T);return g._formatted=T.external,g._fsPath=T._sep===h?T.fsPath:null,g}}return T}}const h=i?1:void 0;class $ extends p{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=C(this)),this._fsPath}toString(T=!1){return T?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=h),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const b={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 I(N,T,g){let w,y=-1;for(let R=0;R<N.length;R++){const A=N.charCodeAt(R);if(A>=97&&A<=122||A>=65&&A<=90||A>=48&&A<=57||A===45||A===46||A===95||A===126||T&&A===47||g&&A===91||g&&A===93||g&&A===58)y!==-1&&(w+=encodeURIComponent(N.substring(y,R)),y=-1),w!==void 0&&(w+=N.charAt(R));else{w===void 0&&(w=N.substr(0,R));const L=b[A];L!==void 0?(y!==-1&&(w+=encodeURIComponent(N.substring(y,R)),y=-1),w+=L):y===-1&&(y=R)}}return y!==-1&&(w+=encodeURIComponent(N.substring(y))),w!==void 0?w:N}function E(N){let T;for(let g=0;g<N.length;g++){const w=N.charCodeAt(g);w===35||w===63?(T===void 0&&(T=N.substr(0,g)),T+=b[w]):T!==void 0&&(T+=N[g])}return T!==void 0?T:N}function C(N,T){let g;return g=N.authority&&N.path.length>1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(g=g.replace(/\//g,"\\")),g}function S(N,T){const g=T?E:I;let w="",{scheme:y,authority:R,path:A,query:L,fragment:D}=N;if(y&&(w+=y,w+=":"),(R||y==="file")&&(w+=c,w+=c),R){let x=R.indexOf("@");if(x!==-1){const U=R.substr(0,x);R=R.substr(x+1),x=U.lastIndexOf(":"),x===-1?w+=g(U,!1,!1):(w+=g(U.substr(0,x),!1,!1),w+=":",w+=g(U.substr(x+1),!1,!0)),w+="@"}R=R.toLowerCase(),x=R.lastIndexOf(":"),x===-1?w+=g(R,!1,!0):(w+=g(R.substr(0,x),!1,!0),w+=R.substr(x))}if(A){if(A.length>=3&&A.charCodeAt(0)===47&&A.charCodeAt(2)===58){const x=A.charCodeAt(1);x>=65&&x<=90&&(A=`/${String.fromCharCode(x+32)}:${A.substr(3)}`)}else if(A.length>=2&&A.charCodeAt(1)===58){const x=A.charCodeAt(0);x>=65&&x<=90&&(A=`${String.fromCharCode(x+32)}:${A.substr(2)}`)}w+=g(A,!0,!1)}return L&&(w+="?",w+=g(L,!1,!1)),D&&(w+="#",w+=T?D:I(D,!1,!1)),w}function P(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+P(N.substr(3)):N}}const V=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function H(N){return N.match(V)?N.replace(V,(T=>P(T))):N}var J=r(975);const oe=J.posix||J,pe="/";var he;(function(N){N.joinPath=function(T,...g){return T.with({path:oe.join(T.path,...g)})},N.resolvePath=function(T,...g){let w=T.path,y=!1;w[0]!==pe&&(w=pe+w,y=!0);let R=oe.resolve(w,...g);return y&&R[0]===pe&&!T.authority&&(R=R.substring(1)),T.with({path:R})},N.dirname=function(T){if(T.path.length===0||T.path===pe)return T;let g=oe.dirname(T.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),T.with({path:g})},N.basename=function(T){return oe.basename(T.path)},N.extname=function(T){return oe.extname(T.path)}})(he||(he={})),Um=n})();const{URI:Lt,Utils:Ki}=Um;var dt;(function(t){t.basename=Ki.basename,t.dirname=Ki.dirname,t.extname=Ki.extname,t.joinPath=Ki.joinPath,t.resolvePath=Ki.resolvePath;const e=typeof process=="object"&&process?.platform==="win32";function r(s,o){return s?.toString()===o?.toString()}t.equals=r;function n(s,o){const l=typeof s=="string"?Lt.parse(s).path:s.path,u=typeof o=="string"?Lt.parse(o).path:o.path,c=l.split("/").filter(b=>b.length>0),f=u.split("/").filter(b=>b.length>0);if(e){const b=/^[A-Z]:$/;if(c[0]&&b.test(c[0])&&(c[0]=c[0].toLowerCase()),f[0]&&b.test(f[0])&&(f[0]=f[0].toLowerCase()),c[0]!==f[0])return u.substring(1)}let p=0;for(;p<c.length&&c[p]===f[p];p++);const h="../".repeat(c.length-p),$=f.slice(p).join("/");return h+$}t.relative=n;function i(s){return Lt.parse(s.toString()).toString()}t.normalize=i;function a(s,o){let l=typeof s=="string"?s:s.path,u=typeof o=="string"?o:o.path;return u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),u===l?!0:u.length<l.length||u.charAt(l.length)!=="/"?!1:u.startsWith(l)}t.contains=a})(dt||(dt={}));class Sw{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return dt.normalize(e)}clear(){this.root.children.clear()}insert(e,r){const n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){const 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){const r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:dt.joinPath(Lt.parse(r),n.name).toString(),element:n.element}}findChildren(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:dt.joinPath(Lt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(dt.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}}var Y;(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"})(Y||(Y={}));class ww{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=ve.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Lt.parse(e.uri),ve.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return ve.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"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Y.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Y.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){const n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Y.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){const n=this.serviceRegistry;let i;return()=>i??(i=sc.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class bw{constructor(e){this.documentTrie=new Sw,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Te(this.documentTrie.all())}addDocument(e){const 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){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const 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));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Y.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Y.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Y.Changed;return this.documentTrie.delete(r),n}}const bn=Symbol("RefResolving");class _w{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=ve.CancellationToken.None){if(this.profiler?.isActive("linking")){const n=this.profiler.createTask("linking",this.languageId);n.start();try{for(const i of gr(e.parseResult.value))await Qe(r),to(i).forEach(a=>{const s=`${i.$type}:${a.property}`;n.startSubTask(s);try{this.doLink(a,e)}finally{n.stopSubTask(s)}})}finally{n.stop()}}else for(const n of gr(e.parseResult.value))await Qe(r),to(n).forEach(i=>this.doLink(i,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=bn;try{const i=this.getCandidate(e);if(Gi(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=bn;try{const i=this.getCandidates(e),a=[];if(Gi(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}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(const 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){const 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){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Ye(this._ref))return this._ref;if(kg(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=bn;const o=Fs(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<Y.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o?.references.push(this)}else this._ref===bn&&a.throwCyclicReferenceError(e,r,i);return Ye(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Gi(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){const a=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=bn;const o=Fs(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),u=[];if(Gi(l))this._linkingError=l;else for(const c of l){const f=a.loadAstNode(c);f&&u.push({ref:f,$nodeDescription:c})}this._items=u,o?.references.push(this)}else this._items===bn&&a.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=a.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{const r=this.getCandidate(e);if(Gi(r))return{error:r};const 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);const 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;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Fs(e.container).$document;n&&n.state<Y.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}}function Nw(t){return typeof t.name=="string"}class kw{getName(e){if(Nw(e))return e.name}getNameNode(e){return nh(e.$cstNode,"name")}}class Iw{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=gr(e.Grammar).some(r=>_o(r)&&r.isMulti)}findDeclarations(e){if(e){const r=$y(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(It(i)||Pr(i))return cf(i);if(Array.isArray(i)){for(const a of i)if((It(a)||Pr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return cf(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Zg(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of to(n))if(Pr(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>dt.equals(a.sourceUri,r.documentUri))),n.push(...i),Te(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=mr(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:no(a),local:!0})}}return n}}class xa{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Pl.sum(Te(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const 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){const r=this.map.get(e);return r?Te(r):Kp}has(e,r){if(r===void 0)return this.map.has(e);{const 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 Te(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Te(this.map.keys())}values(){return Te(this.map.values()).flat()}entriesGroupedByKey(){return Te(this.map.entries())}}class Ld{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[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){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class Pw{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=ve.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Ac,i=ve.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Qe(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=ve.CancellationToken.None){const n=e.parseResult.value,i=new xa;for(const a of Ma(n))await Qe(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class xd{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){const 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){const 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}}class Ow{constructor(e,r,n){this.elements=new xa,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const 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){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Te(n).concat(this.outerScope.getElements(e)):Te(n)}getAllElements(){let e=Te(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class jm{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")}}class Lw extends jm{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){const 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()}}class xw extends jm{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();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class Dw extends Lw{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()}))}}class Mw{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 Dw(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=mr(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new xd(Te(e),r,n)}createScopeForNodes(e,r,n){const i=Te(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new xd(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Ow(this.indexManager.allElements(e)))}}function Fw(t){return typeof t.$comment=="string"}function Dd(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Gw{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){const n=r??{},i=r?.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=mr(e),JSON.stringify(e,s,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(It(r)){const l=r.ref,u=n?r.$refText:void 0;if(l){const c=mr(l);let f="";this.currentDocument&&this.currentDocument!==c&&(o?f=o(c.uri,l):f=c.uri.toString());const p=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${p}`,$refText:u}}else return{$error:r.error?.message??"Could not resolve reference",$refText:u}}else if(Pr(r)){const l=n?r.$refText:void 0,u=[];for(const c of r.items){const f=c.ref,p=mr(c.ref);let h="";this.currentDocument&&this.currentDocument!==p&&(o?h=o(p.uri,f):h=p.uri.toString());const $=this.astNodeLocator.getAstNodePath(f);u.push(`${h}#${$}`)}return{$refs:u,$refText:l}}else if(Ye(r)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(l??(l={...r}),l.$sourceText=r.$cstNode?.text),s){l??(l={...r});const u=this.commentProvider.getComment(r);u&&(l.$comment=u.replace(/\r/g,""))}return l??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=Ty(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c<u.length;c++){const f=u[c];Dd(f)?u[c]=this.reviveReference(e,l,r,f,n):Ye(f)&&this.linkNode(f,r,n,e,l,c)}else Dd(u)?e[l]=this.reviveReference(e,l,r,u,n):Ye(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error,l;if(i.$ref){const u=this.getRefNode(n,i.$ref,a.uriConverter);if(Ye(u))return s||(s=this.nameProvider.getName(u)),{$refText:s??"",ref:u};o=u}else if(i.$refs){const u=[];for(const c of i.$refs){const f=this.getRefNode(n,c,a.uriConverter);Ye(f)&&u.push({ref:f})}if(u.length===0)l={$refText:s??"",items:u},o??(o="Could not resolve multi-reference");else return{$refText:s??"",items:u}}if(o)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:e,property:r,reference:l},message:o},l}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):Lt.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Lt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class zw{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){const r=e.LanguageMetaData;for(const 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(const 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.");const r=this.textDocuments?.get(e)?.languageId;if(r!==void 0){const s=this.languageIdMap.get(r);if(s)return s}const n=dt.extname(e),i=dt.basename(e),a=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!a)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 a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function ya(t){return{code:t}}var lc;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(lc||(lc={}));class Uw{constructor(e){this.entries=new xa,this.knownCategories=new Set(lc.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(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else Ga()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Jo(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Te(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,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const jw=Object.freeze({validateNode:!0,validateChildren:!0});class qw{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=ve.CancellationToken.None){const i=e.parseResult,a=[];if(await Qe(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>s.data?.code===kt.LexingError)||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>s.data?.code===kt.ParsingError))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>s.data?.code===kt.LinkingError))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Jo(s))throw s;console.error("An error occurred during validation:",s)}return await Qe(n),a}processLexingErrors(e,r,n){const i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of i){const s=a.severity??"error",o={severity:hl(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Ww(s),source:this.getSource()};r.push(o)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Ul(i.token);if(a){const s={severity:hl("error"),range:a,message:i.message,data:ya(kt.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.info.container,range:i.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:kt.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=ve.CancellationToken.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=ve.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Qe(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=ve.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=gr(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode)try{const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const c of u)await c(o,n,i)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=gr(e).iterator();for(const s of a){await Qe(i);const o=this.validateSingleNodeOptions(s,r);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,r.categories);for(const u of l)await u(s,n,i)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,r){return jw}async validateAstAfter(e,r,n,i=ve.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Qe(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Bw(n),severity:hl(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 Bw(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=nh(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Ry(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 hl(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 Ww(t){switch(t){case"error":return ya(kt.LexingError);case"warning":return ya(kt.LexingWarning);case"info":return ya(kt.LexingInfo);case"hint":return ya(kt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var kt;(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"})(kt||(kt={}));class Kw{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??mr(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>s??(s=no(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:no(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class Vw{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=ve.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of gr(i))await Qe(r),to(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];It(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Pr(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=mr(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=no(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:dt.equals(l.documentUri,i)});return s}}class Hw{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const 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,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return i[o]?.[l]}return i[a]},e)}}var Yw=Si();class Xw{constructor(e){this._ready=new af,this.onConfigurationSectionUpdateEmitter=new Yw.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){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}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;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Br={},Wr={},ws={},ml={},G={},Md;function qm(){if(Md)return G;Md=1,Object.defineProperty(G,"__esModule",{value:!0}),G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;const t=Ja();var e;(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})(e||(G.ErrorCodes=e={}));class r extends Error{constructor(g,w,y){super(w),this.code=t.number(g)?g:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,r.prototype)}toJson(){const g={code:this.code,message:this.message};return this.data!==void 0&&(g.data=this.data),g}}G.ResponseError=r;class n{constructor(g){this.kind=g}static is(g){return g===n.auto||g===n.byName||g===n.byPosition}toString(){return this.kind}}G.ParameterStructures=n,n.auto=new n("auto"),n.byPosition=new n("byPosition"),n.byName=new n("byName");class i{constructor(g,w){this.method=g,this.numberOfParams=w}get parameterStructures(){return n.auto}}G.AbstractMessageSignature=i;class a extends i{constructor(g){super(g,0)}}G.RequestType0=a;class s extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.RequestType=s;class o extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.RequestType1=o;class l extends i{constructor(g){super(g,2)}}G.RequestType2=l;class u extends i{constructor(g){super(g,3)}}G.RequestType3=u;class c extends i{constructor(g){super(g,4)}}G.RequestType4=c;class f extends i{constructor(g){super(g,5)}}G.RequestType5=f;class p extends i{constructor(g){super(g,6)}}G.RequestType6=p;class h extends i{constructor(g){super(g,7)}}G.RequestType7=h;class $ extends i{constructor(g){super(g,8)}}G.RequestType8=$;class b extends i{constructor(g){super(g,9)}}G.RequestType9=b;class I extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.NotificationType=I;class E extends i{constructor(g){super(g,0)}}G.NotificationType0=E;class C extends i{constructor(g,w=n.auto){super(g,1),this._parameterStructures=w}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=C;class S extends i{constructor(g){super(g,2)}}G.NotificationType2=S;class P extends i{constructor(g){super(g,3)}}G.NotificationType3=P;class V extends i{constructor(g){super(g,4)}}G.NotificationType4=V;class H extends i{constructor(g){super(g,5)}}G.NotificationType5=H;class J extends i{constructor(g){super(g,6)}}G.NotificationType6=J;class oe extends i{constructor(g){super(g,7)}}G.NotificationType7=oe;class pe extends i{constructor(g){super(g,8)}}G.NotificationType8=pe;class he extends i{constructor(g){super(g,9)}}G.NotificationType9=he;var N;return(function(T){function g(R){const A=R;return A&&t.string(A.method)&&(t.string(A.id)||t.number(A.id))}T.isRequest=g;function w(R){const A=R;return A&&t.string(A.method)&&R.id===void 0}T.isNotification=w;function y(R){const A=R;return A&&(A.result!==void 0||!!A.error)&&(t.string(A.id)||t.number(A.id)||A.id===null)}T.isResponse=y})(N||(G.Message=N={})),G}var tr={},Fd;function Bm(){if(Fd)return tr;Fd=1;var t;Object.defineProperty(tr,"__esModule",{value:!0}),tr.LRUCache=tr.LinkedMap=tr.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(tr.Touch=e={}));class r{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(a){return this._map.has(a)}get(a,s=e.None){const o=this._map.get(a);if(o)return s!==e.None&&this.touch(o,s),o.value}set(a,s,o=e.None){let l=this._map.get(a);if(l)l.value=s,o!==e.None&&this.touch(l,o);else{switch(l={key:a,value:s,next:void 0,previous:void 0},o){case e.None:this.addItemLast(l);break;case e.First:this.addItemFirst(l);break;case e.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(a,l),this._size++}return this}delete(a){return!!this.remove(a)}remove(a){const s=this._map.get(a);if(s)return this._map.delete(a),this.removeItem(s),this._size--,s.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const a=this._head;return this._map.delete(a.key),this.removeItem(a),this._size--,a.value}forEach(a,s){const o=this._state;let l=this._head;for(;l;){if(s?a.bind(s)(l.value,l.key,this):a(l.value,l.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");l=l.next}}keys(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.key,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}values(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.value,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}entries(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:[s.key,s.value],done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(a){if(a>=this.size)return;if(a===0){this.clear();return}let s=this._head,o=this.size;for(;s&&o>a;)this._map.delete(s.key),s=s.next,o--;this._head=s,this._size=o,s&&(s.previous=void 0),this._state++}addItemFirst(a){if(!this._head&&!this._tail)this._tail=a;else if(this._head)a.next=this._head,this._head.previous=a;else throw new Error("Invalid list");this._head=a,this._state++}addItemLast(a){if(!this._head&&!this._tail)this._head=a;else if(this._tail)a.previous=this._tail,this._tail.next=a;else throw new Error("Invalid list");this._tail=a,this._state++}removeItem(a){if(a===this._head&&a===this._tail)this._head=void 0,this._tail=void 0;else if(a===this._head){if(!a.next)throw new Error("Invalid list");a.next.previous=void 0,this._head=a.next}else if(a===this._tail){if(!a.previous)throw new Error("Invalid list");a.previous.next=void 0,this._tail=a.previous}else{const s=a.next,o=a.previous;if(!s||!o)throw new Error("Invalid list");s.previous=o,o.next=s}a.next=void 0,a.previous=void 0,this._state++}touch(a,s){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(s!==e.First&&s!==e.Last)){if(s===e.First){if(a===this._head)return;const o=a.next,l=a.previous;a===this._tail?(l.next=void 0,this._tail=l):(o.previous=l,l.next=o),a.previous=void 0,a.next=this._head,this._head.previous=a,this._head=a,this._state++}else if(s===e.Last){if(a===this._tail)return;const o=a.next,l=a.previous;a===this._head?(o.previous=void 0,this._head=o):(o.previous=l,l.next=o),a.next=void 0,a.previous=this._tail,this._tail.next=a,this._tail=a,this._state++}}}toJSON(){const a=[];return this.forEach((s,o)=>{a.push([o,s])}),a}fromJSON(a){this.clear();for(const[s,o]of a)this.set(s,o)}}tr.LinkedMap=r;class n extends r{constructor(a,s=1){super(),this._limit=a,this._ratio=Math.min(Math.max(0,s),1)}get limit(){return this._limit}set limit(a){this._limit=a,this.checkTrim()}get ratio(){return this._ratio}set ratio(a){this._ratio=Math.min(Math.max(0,a),1),this.checkTrim()}get(a,s=e.AsNew){return super.get(a,s)}peek(a){return super.get(a,e.None)}set(a,s){return super.set(a,s,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return tr.LRUCache=n,tr}var Vi={},Gd;function Jw(){if(Gd)return Vi;Gd=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.Disposable=void 0;var t;return(function(e){function r(n){return{dispose:n}}e.create=r})(t||(Vi.Disposable=t={})),Vi}var Kr={},zd;function Zw(){if(zd)return Kr;zd=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.SharedArrayReceiverStrategy=Kr.SharedArraySenderStrategy=void 0;const t=Xo();var e;(function(s){s.Continue=0,s.Cancelled=1})(e||(e={}));class r{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const l=new SharedArrayBuffer(4),u=new Int32Array(l,0,1);u[0]=e.Continue,this.buffers.set(o.id,l),o.$cancellationData=l}async sendCancellation(o,l){const u=this.buffers.get(l);if(u===void 0)return;const c=new Int32Array(u,0,1);Atomics.store(c,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}Kr.SharedArraySenderStrategy=r;class n{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new n(o)}cancel(){}dispose(){}}class a{constructor(){this.kind="request"}createCancellationTokenSource(o){const l=o.$cancellationData;return l===void 0?new t.CancellationTokenSource:new i(l)}}return Kr.SharedArrayReceiverStrategy=a,Kr}var rr={},Hi={},Ud;function Wm(){if(Ud)return Hi;Ud=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.Semaphore=void 0;const t=An();class e{constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,a)=>{this._waiting.push({thunk:n,resolve:i,reject:a}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=n.thunk();i instanceof Promise?i.then(a=>{this._active--,n.resolve(a),this.runNext()},a=>{this._active--,n.reject(a),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}}return Hi.Semaphore=e,Hi}var jd;function Qw(){if(jd)return rr;jd=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.ReadableStreamMessageReader=rr.AbstractMessageReader=rr.MessageReader=void 0;const t=An(),e=Ja(),r=Si(),n=Wm();var i;(function(l){function u(c){let f=c;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}l.is=u})(i||(rr.MessageReader=i={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}rr.AbstractMessageReader=a;var s;(function(l){function u(c){let f,p;const h=new Map;let $;const b=new Map;if(c===void 0||typeof c=="string")f=c??"utf-8";else{if(f=c.charset??"utf-8",c.contentDecoder!==void 0&&(p=c.contentDecoder,h.set(p.name,p)),c.contentDecoders!==void 0)for(const I of c.contentDecoders)h.set(I.name,I);if(c.contentTypeDecoder!==void 0&&($=c.contentTypeDecoder,b.set($.name,$)),c.contentTypeDecoders!==void 0)for(const I of c.contentTypeDecoders)b.set(I.name,I)}return $===void 0&&($=(0,t.default)().applicationJson.decoder,b.set($.name,$)),{charset:f,contentDecoder:p,contentDecoders:h,contentTypeDecoder:$,contentTypeDecoders:b}}l.fromOptions=u})(s||(s={}));class o extends a{constructor(u,c){super(),this.readable=u,this.options=s.fromOptions(c),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new n.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const c=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),c}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const p=f.get("content-length");if(!p){this.fireError(new Error(`Header must provide a Content-Length property.
122
+ ${JSON.stringify(Object.fromEntries(f))}`));return}const h=parseInt(p);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${p}`));return}this.nextMessageLength=h}const c=this.buffer.tryReadBody(this.nextMessageLength);if(c===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(c):c,p=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(p)}).catch(f=>{this.fireError(f)})}}catch(c){this.fireError(c)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,c)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:c}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return rr.ReadableStreamMessageReader=o,rr}var nr={},qd;function eb(){if(qd)return nr;qd=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.WriteableStreamMessageWriter=nr.AbstractMessageWriter=nr.MessageWriter=void 0;const t=An(),e=Ja(),r=Wm(),n=Si(),i="Content-Length: ",a=`\r
123
+ `;var s;(function(c){function f(p){let h=p;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}c.is=f})(s||(nr.MessageWriter=s={}));class o{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,p,h){this.errorEmitter.fire([this.asError(f),p,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}nr.AbstractMessageWriter=o;var l;(function(c){function f(p){return p===void 0||typeof p=="string"?{charset:p??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:p.charset??"utf-8",contentEncoder:p.contentEncoder,contentTypeEncoder:p.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}c.fromOptions=f})(l||(l={}));class u extends o{constructor(f,p){super(),this.writable=f,this.options=l.fromOptions(p),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const $=[];return $.push(i,h.byteLength.toString(),a),$.push(a),this.doWrite(f,$,h)},h=>{throw this.fireError(h),h}))}async doWrite(f,p,h){try{return await this.writable.write(p.join(""),"ascii"),this.writable.write(h)}catch($){return this.handleError($,f),Promise.reject($)}}handleError(f,p){this.errorCount++,this.fireError(f,p,this.errorCount)}end(){this.writable.end()}}return nr.WriteableStreamMessageWriter=u,nr}var Yi={},Bd;function tb(){if(Bd)return Yi;Bd=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.AbstractMessageBuffer=void 0;const t=13,e=10,r=`\r
124
+ `;class n{constructor(a="utf-8"){this._encoding=a,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(a){const s=typeof a=="string"?this.fromString(a,this._encoding):a;this._chunks.push(s),this._totalLength+=s.byteLength}tryReadHeaders(a=!1){if(this._chunks.length===0)return;let s=0,o=0,l=0,u=0;e:for(;o<this._chunks.length;){const h=this._chunks[o];for(l=0;l<h.length;){switch(h[l]){case t:switch(s){case 0:s=1;break;case 2:s=3;break;default:s=0}break;case e:switch(s){case 1:s=2;break;case 3:s=4,l++;break e;default:s=0}break;default:s=0}l++}u+=h.byteLength,o++}if(s!==4)return;const c=this._read(u+l),f=new Map,p=this.toString(c,"ascii").split(r);if(p.length<2)return f;for(let h=0;h<p.length-2;h++){const $=p[h],b=$.indexOf(":");if(b===-1)throw new Error(`Message header must separate key and value using ':'
125
+ ${$}`);const I=$.substr(0,b),E=$.substr(b+1).trim();f.set(a?I.toLowerCase():I,E)}return f}tryReadBody(a){if(!(this._totalLength<a))return this._read(a)}get numberOfBytes(){return this._totalLength}_read(a){if(a===0)return this.emptyBuffer();if(a>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===a){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=a,this.asNative(u)}if(this._chunks[0].byteLength>a){const u=this._chunks[0],c=this.asNative(u,a);return this._chunks[0]=u.slice(a),this._totalLength-=a,c}const s=this.allocNative(a);let o=0,l=0;for(;a>0;){const u=this._chunks[l];if(u.byteLength>a){const c=u.slice(0,a);s.set(c,o),o+=a,this._chunks[l]=u.slice(a),this._totalLength-=a,a-=a}else s.set(u,o),o+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,a-=u.byteLength}return s}}return Yi.AbstractMessageBuffer=n,Yi}var gl={},Wd;function rb(){return Wd||(Wd=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=An(),r=Ja(),n=qm(),i=Bm(),a=Si(),s=Xo();var o;(function(g){g.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(g){function w(y){return typeof y=="string"||typeof y=="number"}g.is=w})(l||(t.ProgressToken=l={}));var u;(function(g){g.type=new n.NotificationType("$/progress")})(u||(u={}));class c{constructor(){}}t.ProgressType=c;var f;(function(g){function w(y){return r.func(y)}g.is=w})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var h;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(h||(t.TraceValues=h={})),(function(g){function w(R){if(!r.string(R))return g.Off;switch(R=R.toLowerCase(),R){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}g.fromString=w;function y(R){switch(R){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}g.toString=y})(p||(t.Trace=p={}));var $;(function(g){g.Text="text",g.JSON="json"})($||(t.TraceFormat=$={})),(function(g){function w(y){return r.string(y)?(y=y.toLowerCase(),y==="json"?g.JSON:g.Text):g.Text}g.fromString=w})($||(t.TraceFormat=$={}));var b;(function(g){g.type=new n.NotificationType("$/setTrace")})(b||(t.SetTraceNotification=b={}));var I;(function(g){g.type=new n.NotificationType("$/logTrace")})(I||(t.LogTraceNotification=I={}));var E;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(E||(t.ConnectionErrors=E={}));class C extends Error{constructor(w,y){super(y),this.code=w,Object.setPrototypeOf(this,C.prototype)}}t.ConnectionError=C;var S;(function(g){function w(y){const R=y;return R&&r.func(R.cancelUndispatched)}g.is=w})(S||(t.ConnectionStrategy=S={}));var P;(function(g){function w(y){const R=y;return R&&(R.kind===void 0||R.kind==="id")&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}g.is=w})(P||(t.IdCancellationReceiverStrategy=P={}));var V;(function(g){function w(y){const R=y;return R&&R.kind==="request"&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}g.is=w})(V||(t.RequestCancellationReceiverStrategy=V={}));var H;(function(g){g.Message=Object.freeze({createCancellationTokenSource(y){return new s.CancellationTokenSource}});function w(y){return P.is(y)||V.is(y)}g.is=w})(H||(t.CancellationReceiverStrategy=H={}));var J;(function(g){g.Message=Object.freeze({sendCancellation(y,R){return y.sendNotification(o.type,{id:R})},cleanup(y){}});function w(y){const R=y;return R&&r.func(R.sendCancellation)&&r.func(R.cleanup)}g.is=w})(J||(t.CancellationSenderStrategy=J={}));var oe;(function(g){g.Message=Object.freeze({receiver:H.Message,sender:J.Message});function w(y){const R=y;return R&&H.is(R.receiver)&&J.is(R.sender)}g.is=w})(oe||(t.CancellationStrategy=oe={}));var pe;(function(g){function w(y){const R=y;return R&&r.func(R.handleMessage)}g.is=w})(pe||(t.MessageStrategy=pe={}));var he;(function(g){function w(y){const R=y;return R&&(oe.is(R.cancellationStrategy)||S.is(R.connectionStrategy)||pe.is(R.messageStrategy))}g.is=w})(he||(t.ConnectionOptions=he={}));var N;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(N||(N={}));function T(g,w,y,R){const A=y!==void 0?y:t.NullLogger;let L=0,D=0,x=0;const U="2.0";let F;const ae=new Map;let q;const ne=new Map,Ge=new Map;let Ae,me=new i.LinkedMap,Le=new Map,ze=new Set,Ie=new Map,ee=p.Off,lt=$.Text,Ee,St=N.New;const En=new a.Emitter,_i=new a.Emitter,Ni=new a.Emitter,ki=new a.Emitter,Ii=new a.Emitter,wt=R&&R.cancellationStrategy?R.cancellationStrategy:oe.Message;function Pi(m){if(m===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+m.toString()}function Za(m){return m===null?"res-unknown-"+(++x).toString():"res-"+m.toString()}function Qa(){return"not-"+(++D).toString()}function es(m,_){n.Message.isRequest(_)?m.set(Pi(_.id),_):n.Message.isResponse(_)?m.set(Za(_.id),_):m.set(Qa(),_)}function ts(m){}function Oi(){return St===N.Listening}function Li(){return St===N.Closed}function Zt(){return St===N.Disposed}function xi(){(St===N.New||St===N.Listening)&&(St=N.Closed,_i.fire(void 0))}function rs(m){En.fire([m,void 0,void 0])}function ns(m){En.fire(m)}g.onClose(xi),g.onError(rs),w.onClose(xi),w.onError(ns);function Di(){Ae||me.size===0||(Ae=(0,e.default)().timer.setImmediate(()=>{Ae=void 0,is()}))}function Mi(m){n.Message.isRequest(m)?ss(m):n.Message.isNotification(m)?ls(m):n.Message.isResponse(m)?os(m):us(m)}function is(){if(me.size===0)return;const m=me.shift();try{const _=R?.messageStrategy;pe.is(_)?_.handleMessage(m,Mi):Mi(m)}finally{Di()}}const as=m=>{try{if(n.Message.isNotification(m)&&m.method===o.type.method){const _=m.params.id,O=Pi(_),M=me.get(O);if(n.Message.isRequest(M)){const se=R?.connectionStrategy,Ce=se&&se.cancelUndispatched?se.cancelUndispatched(M,ts):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){me.delete(O),Ie.delete(_),Ce.id=M.id,zr(Ce,m.method,Date.now()),w.write(Ce).catch(()=>A.error("Sending response for canceled message failed."));return}}const ce=Ie.get(_);if(ce!==void 0){ce.cancel(),Cn(m);return}else ze.add(_)}es(me,m)}finally{Di()}};function ss(m){if(Zt())return;function _(Z,ge,ie){const xe={jsonrpc:U,id:m.id};Z instanceof n.ResponseError?xe.error=Z.toJson():xe.result=Z===void 0?null:Z,zr(xe,ge,ie),w.write(xe).catch(()=>A.error("Sending response failed."))}function O(Z,ge,ie){const xe={jsonrpc:U,id:m.id,error:Z.toJson()};zr(xe,ge,ie),w.write(xe).catch(()=>A.error("Sending response failed."))}function M(Z,ge,ie){Z===void 0&&(Z=null);const xe={jsonrpc:U,id:m.id,result:Z};zr(xe,ge,ie),w.write(xe).catch(()=>A.error("Sending response failed."))}ds(m);const ce=ae.get(m.method);let se,Ce;ce&&(se=ce.type,Ce=ce.handler);const Ne=Date.now();if(Ce||F){const Z=m.id??String(Date.now()),ge=P.is(wt.receiver)?wt.receiver.createCancellationTokenSource(Z):wt.receiver.createCancellationTokenSource(m);m.id!==null&&ze.has(m.id)&&ge.cancel(),m.id!==null&&Ie.set(Z,ge);try{let ie;if(Ce)if(m.params===void 0){if(se!==void 0&&se.numberOfParams!==0){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines ${se.numberOfParams} params but received none.`),m.method,Ne);return}ie=Ce(ge.token)}else if(Array.isArray(m.params)){if(se!==void 0&&se.parameterStructures===n.ParameterStructures.byName){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by name but received parameters by position`),m.method,Ne);return}ie=Ce(...m.params,ge.token)}else{if(se!==void 0&&se.parameterStructures===n.ParameterStructures.byPosition){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by position but received parameters by name`),m.method,Ne);return}ie=Ce(m.params,ge.token)}else F&&(ie=F(m.method,m.params,ge.token));const xe=ie;ie?xe.then?xe.then(Xe=>{Ie.delete(Z),_(Xe,m.method,Ne)},Xe=>{Ie.delete(Z),Xe instanceof n.ResponseError?O(Xe,m.method,Ne):Xe&&r.string(Xe.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${Xe.message}`),m.method,Ne):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,Ne)}):(Ie.delete(Z),_(ie,m.method,Ne)):(Ie.delete(Z),M(ie,m.method,Ne))}catch(ie){Ie.delete(Z),ie instanceof n.ResponseError?_(ie,m.method,Ne):ie&&r.string(ie.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${ie.message}`),m.method,Ne):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,Ne)}}else O(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${m.method}`),m.method,Ne)}function os(m){if(!Zt())if(m.id===null)m.error?A.error(`Received response message without id: Error is:
126
+ ${JSON.stringify(m.error,void 0,4)}`):A.error("Received response message without id. No further error information provided.");else{const _=m.id,O=Le.get(_);if(ps(m,O),O!==void 0){Le.delete(_);try{if(m.error){const M=m.error;O.reject(new n.ResponseError(M.code,M.message,M.data))}else if(m.result!==void 0)O.resolve(m.result);else throw new Error("Should never happen.")}catch(M){M.message?A.error(`Response handler '${O.method}' failed with message: ${M.message}`):A.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}function ls(m){if(Zt())return;let _,O;if(m.method===o.type.method){const M=m.params.id;ze.delete(M),Cn(m);return}else{const M=ne.get(m.method);M&&(O=M.handler,_=M.type)}if(O||q)try{if(Cn(m),O)if(m.params===void 0)_!==void 0&&_.numberOfParams!==0&&_.parameterStructures!==n.ParameterStructures.byName&&A.error(`Notification ${m.method} defines ${_.numberOfParams} params but received none.`),O();else if(Array.isArray(m.params)){const M=m.params;m.method===u.type.method&&M.length===2&&l.is(M[0])?O({token:M[0],value:M[1]}):(_!==void 0&&(_.parameterStructures===n.ParameterStructures.byName&&A.error(`Notification ${m.method} defines parameters by name but received parameters by position`),_.numberOfParams!==m.params.length&&A.error(`Notification ${m.method} defines ${_.numberOfParams} params but received ${M.length} arguments`)),O(...M))}else _!==void 0&&_.parameterStructures===n.ParameterStructures.byPosition&&A.error(`Notification ${m.method} defines parameters by position but received parameters by name`),O(m.params);else q&&q(m.method,m.params)}catch(M){M.message?A.error(`Notification handler '${m.method}' failed with message: ${M.message}`):A.error(`Notification handler '${m.method}' failed unexpectedly.`)}else Ni.fire(m)}function us(m){if(!m){A.error("Received empty message.");return}A.error(`Received message which is neither a response nor a notification message:
127
+ ${JSON.stringify(m,null,4)}`);const _=m;if(r.string(_.id)||r.number(_.id)){const O=_.id,M=Le.get(O);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function bt(m){if(m!=null)switch(ee){case p.Verbose:return JSON.stringify(m,null,4);case p.Compact:return JSON.stringify(m);default:return}}function cs(m){if(!(ee===p.Off||!Ee))if(lt===$.Text){let _;(ee===p.Verbose||ee===p.Compact)&&m.params&&(_=`Params: ${bt(m.params)}
128
+
129
+ `),Ee.log(`Sending request '${m.method} - (${m.id})'.`,_)}else Qt("send-request",m)}function fs(m){if(!(ee===p.Off||!Ee))if(lt===$.Text){let _;(ee===p.Verbose||ee===p.Compact)&&(m.params?_=`Params: ${bt(m.params)}
130
+
131
+ `:_=`No parameters provided.
132
+
133
+ `),Ee.log(`Sending notification '${m.method}'.`,_)}else Qt("send-notification",m)}function zr(m,_,O){if(!(ee===p.Off||!Ee))if(lt===$.Text){let M;(ee===p.Verbose||ee===p.Compact)&&(m.error&&m.error.data?M=`Error data: ${bt(m.error.data)}
134
+
135
+ `:m.result?M=`Result: ${bt(m.result)}
136
+
137
+ `:m.error===void 0&&(M=`No result returned.
138
+
139
+ `)),Ee.log(`Sending response '${_} - (${m.id})'. Processing request took ${Date.now()-O}ms`,M)}else Qt("send-response",m)}function ds(m){if(!(ee===p.Off||!Ee))if(lt===$.Text){let _;(ee===p.Verbose||ee===p.Compact)&&m.params&&(_=`Params: ${bt(m.params)}
140
+
141
+ `),Ee.log(`Received request '${m.method} - (${m.id})'.`,_)}else Qt("receive-request",m)}function Cn(m){if(!(ee===p.Off||!Ee||m.method===I.type.method))if(lt===$.Text){let _;(ee===p.Verbose||ee===p.Compact)&&(m.params?_=`Params: ${bt(m.params)}
142
+
143
+ `:_=`No parameters provided.
144
+
145
+ `),Ee.log(`Received notification '${m.method}'.`,_)}else Qt("receive-notification",m)}function ps(m,_){if(!(ee===p.Off||!Ee))if(lt===$.Text){let O;if((ee===p.Verbose||ee===p.Compact)&&(m.error&&m.error.data?O=`Error data: ${bt(m.error.data)}
146
+
147
+ `:m.result?O=`Result: ${bt(m.result)}
148
+
149
+ `:m.error===void 0&&(O=`No result returned.
150
+
151
+ `)),_){const M=m.error?` Request failed: ${m.error.message} (${m.error.code}).`:"";Ee.log(`Received response '${_.method} - (${m.id})' in ${Date.now()-_.timerStart}ms.${M}`,O)}else Ee.log(`Received response ${m.id} without active response promise.`,O)}else Qt("receive-response",m)}function Qt(m,_){if(!Ee||ee===p.Off)return;const O={isLSPMessage:!0,type:m,message:_,timestamp:Date.now()};Ee.log(O)}function Nr(){if(Li())throw new C(E.Closed,"Connection is closed.");if(Zt())throw new C(E.Disposed,"Connection is disposed.")}function hs(){if(Oi())throw new C(E.AlreadyListening,"Connection is already listening")}function ms(){if(!Oi())throw new Error("Call listen() first.")}function kr(m){return m===void 0?null:m}function Fi(m){if(m!==null)return m}function d(m){return m!=null&&!Array.isArray(m)&&typeof m=="object"}function be(m,_){switch(m){case n.ParameterStructures.auto:return d(_)?Fi(_):[kr(_)];case n.ParameterStructures.byName:if(!d(_))throw new Error("Received parameters by name but param is not an object literal.");return Fi(_);case n.ParameterStructures.byPosition:return[kr(_)];default:throw new Error(`Unknown parameter structure ${m.toString()}`)}}function _e(m,_){let O;const M=m.numberOfParams;switch(M){case 0:O=void 0;break;case 1:O=be(m.parameterStructures,_[0]);break;default:O=[];for(let ce=0;ce<_.length&&ce<M;ce++)O.push(kr(_[ce]));if(_.length<M)for(let ce=_.length;ce<M;ce++)O.push(null);break}return O}const K={sendNotification:(m,..._)=>{Nr();let O,M;if(r.string(m)){O=m;const se=_[0];let Ce=0,Ne=n.ParameterStructures.auto;n.ParameterStructures.is(se)&&(Ce=1,Ne=se);let Z=_.length;const ge=Z-Ce;switch(ge){case 0:M=void 0;break;case 1:M=be(Ne,_[Ce]);break;default:if(Ne===n.ParameterStructures.byName)throw new Error(`Received ${ge} parameters for 'by Name' notification parameter structure.`);M=_.slice(Ce,Z).map(ie=>kr(ie));break}}else{const se=_;O=m.method,M=_e(m,se)}const ce={jsonrpc:U,method:O,params:M};return fs(ce),w.write(ce).catch(se=>{throw A.error("Sending notification failed."),se})},onNotification:(m,_)=>{Nr();let O;return r.func(m)?q=m:_&&(r.string(m)?(O=m,ne.set(m,{type:void 0,handler:_})):(O=m.method,ne.set(m.method,{type:m,handler:_}))),{dispose:()=>{O!==void 0?ne.delete(O):q=void 0}}},onProgress:(m,_,O)=>{if(Ge.has(_))throw new Error(`Progress handler for token ${_} already registered`);return Ge.set(_,O),{dispose:()=>{Ge.delete(_)}}},sendProgress:(m,_,O)=>K.sendNotification(u.type,{token:_,value:O}),onUnhandledProgress:ki.event,sendRequest:(m,..._)=>{Nr(),ms();let O,M,ce;if(r.string(m)){O=m;const Z=_[0],ge=_[_.length-1];let ie=0,xe=n.ParameterStructures.auto;n.ParameterStructures.is(Z)&&(ie=1,xe=Z);let Xe=_.length;s.CancellationToken.is(ge)&&(Xe=Xe-1,ce=ge);const Ft=Xe-ie;switch(Ft){case 0:M=void 0;break;case 1:M=be(xe,_[ie]);break;default:if(xe===n.ParameterStructures.byName)throw new Error(`Received ${Ft} parameters for 'by Name' request parameter structure.`);M=_.slice(ie,Xe).map(Rg=>kr(Rg));break}}else{const Z=_;O=m.method,M=_e(m,Z);const ge=m.numberOfParams;ce=s.CancellationToken.is(Z[ge])?Z[ge]:void 0}const se=L++;let Ce;ce&&(Ce=ce.onCancellationRequested(()=>{const Z=wt.sender.sendCancellation(K,se);return Z===void 0?(A.log(`Received no promise from cancellation strategy when cancelling id ${se}`),Promise.resolve()):Z.catch(()=>{A.log(`Sending cancellation messages for id ${se} failed`)})}));const Ne={jsonrpc:U,id:se,method:O,params:M};return cs(Ne),typeof wt.sender.enableCancellation=="function"&&wt.sender.enableCancellation(Ne),new Promise(async(Z,ge)=>{const ie=Ft=>{Z(Ft),wt.sender.cleanup(se),Ce?.dispose()},xe=Ft=>{ge(Ft),wt.sender.cleanup(se),Ce?.dispose()},Xe={method:O,timerStart:Date.now(),resolve:ie,reject:xe};try{await w.write(Ne),Le.set(se,Xe)}catch(Ft){throw A.error("Sending request failed."),Xe.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Ft.message?Ft.message:"Unknown reason")),Ft}})},onRequest:(m,_)=>{Nr();let O=null;return f.is(m)?(O=void 0,F=m):r.string(m)?(O=null,_!==void 0&&(O=m,ae.set(m,{handler:_,type:void 0}))):_!==void 0&&(O=m.method,ae.set(m.method,{type:m,handler:_})),{dispose:()=>{O!==null&&(O!==void 0?ae.delete(O):F=void 0)}}},hasPendingResponse:()=>Le.size>0,trace:async(m,_,O)=>{let M=!1,ce=$.Text;O!==void 0&&(r.boolean(O)?M=O:(M=O.sendNotification||!1,ce=O.traceFormat||$.Text)),ee=m,lt=ce,ee===p.Off?Ee=void 0:Ee=_,M&&!Li()&&!Zt()&&await K.sendNotification(b.type,{value:p.toString(m)})},onError:En.event,onClose:_i.event,onUnhandledNotification:Ni.event,onDispose:Ii.event,end:()=>{w.end()},dispose:()=>{if(Zt())return;St=N.Disposed,Ii.fire(void 0);const m=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const _ of Le.values())_.reject(m);Le=new Map,Ie=new Map,ze=new Set,me=new i.LinkedMap,r.func(w.dispose)&&w.dispose(),r.func(g.dispose)&&g.dispose()},listen:()=>{Nr(),hs(),St=N.Listening,g.listen(as)},inspect:()=>{(0,e.default)().console.log("inspect")}};return K.onNotification(I.type,m=>{if(ee===p.Off||!Ee)return;const _=ee===p.Verbose||ee===p.Compact;Ee.log(m.message,_?m.verbose:void 0)}),K.onNotification(u.type,m=>{const _=Ge.get(m.token);_?_(m.value):ki.fire(m)}),K}t.createMessageConnection=T})(gl)),gl}var Kd;function uc(){return Kd||(Kd=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=qm();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const r=Bm();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return r.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return r.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return r.Touch}});const n=Jw();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Si();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=Xo();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=Zw();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=Qw();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const l=eb();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const u=tb();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const c=rb();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return c.MessageStrategy}});const f=An();t.RAL=f.default})(ml)),ml}var Vd;function nb(){if(Vd)return ws;Vd=1,Object.defineProperty(ws,"__esModule",{value:!0});const t=uc();class e extends t.AbstractMessageBuffer{constructor(l="utf-8"){super(l),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(l,u){return new TextEncoder().encode(l)}toString(l,u){return u==="ascii"?this.asciiDecoder.decode(l):new TextDecoder(u).decode(l)}asNative(l,u){return u===void 0?l:l.slice(0,u)}allocNative(l){return new Uint8Array(l)}}e.emptyBuffer=new Uint8Array(0);class r{constructor(l){this.socket=l,this._onData=new t.Emitter,this._messageListener=u=>{u.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}onData(l){return this._onData.event(l)}}class n{constructor(l){this.socket=l}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}write(l,u){if(typeof l=="string"){if(u!==void 0&&u!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`);this.socket.send(l)}else this.socket.send(l);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:o=>new e(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,l)=>{if(l.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l.charset}`);return Promise.resolve(i.encode(JSON.stringify(o,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(o,l)=>{if(!(o instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(l.charset).decode(o)))}})}),stream:Object.freeze({asReadableStream:o=>new r(o),asWritableStream:o=>new n(o)}),console,timer:Object.freeze({setTimeout(o,l,...u){const c=setTimeout(o,l,...u);return{dispose:()=>clearTimeout(c)}},setImmediate(o,...l){const u=setTimeout(o,0,...l);return{dispose:()=>clearTimeout(u)}},setInterval(o,l,...u){const c=setInterval(o,l,...u);return{dispose:()=>clearInterval(c)}}})});function s(){return a}return(function(o){function l(){t.RAL.install(a)}o.install=l})(s||(s={})),ws.default=s,ws}var Hd;function wi(){return Hd||(Hd=1,(function(t){var e=Wr&&Wr.__createBinding||(Object.create?(function(l,u,c,f){f===void 0&&(f=c);var p=Object.getOwnPropertyDescriptor(u,c);(!p||("get"in p?!u.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(l,f,p)}):(function(l,u,c,f){f===void 0&&(f=c),l[f]=u[c]})),r=Wr&&Wr.__exportStar||function(l,u){for(var c in l)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&e(u,l,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,nb().default.install();const i=uc();r(uc(),t);class a extends i.AbstractMessageReader{constructor(u){super(),this._onData=new i.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},u.addEventListener("error",c=>this.fireError(c)),u.onmessage=this._messageListener}listen(u){return this._onData.event(u)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(u){super(),this.port=u,this.errorCount=0,u.addEventListener("error",c=>this.fireError(c))}write(u){try{return this.port.postMessage(u),Promise.resolve()}catch(c){return this.handleError(c,u),Promise.reject(c)}}handleError(u,c){this.errorCount++,this.fireError(u,c,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,u,c,f){return c===void 0&&(c=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(l,u,c,f)}t.createMessageConnection=o})(Wr)),Wr}var yl,Yd;function Xd(){return Yd||(Yd=1,yl=wi()),yl}var Vr={};const sf=vg(tw);var Je={},Jd;function $e(){if(Jd)return Je;Jd=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.ProtocolNotificationType=Je.ProtocolNotificationType0=Je.ProtocolRequestType=Je.ProtocolRequestType0=Je.RegistrationType=Je.MessageDirection=void 0;const t=wi();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(Je.MessageDirection=e={}));class r{constructor(l){this.method=l}}Je.RegistrationType=r;class n extends t.RequestType0{constructor(l){super(l)}}Je.ProtocolRequestType0=n;class i extends t.RequestType{constructor(l){super(l,t.ParameterStructures.byName)}}Je.ProtocolRequestType=i;class a extends t.NotificationType0{constructor(l){super(l)}}Je.ProtocolNotificationType0=a;class s extends t.NotificationType{constructor(l){super(l,t.ParameterStructures.byName)}}return Je.ProtocolNotificationType=s,Je}var Tl={},ke={},Zd;function of(){if(Zd)return ke;Zd=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.objectLiteral=ke.typedArray=ke.stringArray=ke.array=ke.func=ke.error=ke.number=ke.string=ke.boolean=void 0;function t(u){return u===!0||u===!1}ke.boolean=t;function e(u){return typeof u=="string"||u instanceof String}ke.string=e;function r(u){return typeof u=="number"||u instanceof Number}ke.number=r;function n(u){return u instanceof Error}ke.error=n;function i(u){return typeof u=="function"}ke.func=i;function a(u){return Array.isArray(u)}ke.array=a;function s(u){return a(u)&&u.every(c=>e(c))}ke.stringArray=s;function o(u,c){return Array.isArray(u)&&u.every(c)}ke.typedArray=o;function l(u){return u!==null&&typeof u=="object"}return ke.objectLiteral=l,ke}var Xi={},Qd;function ib(){if(Qd)return Xi;Qd=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.ImplementationRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/implementation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Xi.ImplementationRequest=e={})),Xi}var Ji={},ep;function ab(){if(ep)return Ji;ep=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.TypeDefinitionRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/typeDefinition",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ji.TypeDefinitionRequest=e={})),Ji}var Hr={},tp;function sb(){if(tp)return Hr;tp=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.DidChangeWorkspaceFoldersNotification=Hr.WorkspaceFoldersRequest=void 0;const t=$e();var e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(e||(Hr.WorkspaceFoldersRequest=e={}));var r;return(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolNotificationType(n.method)})(r||(Hr.DidChangeWorkspaceFoldersNotification=r={})),Hr}var Zi={},rp;function ob(){if(rp)return Zi;rp=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.ConfigurationRequest=void 0;const t=$e();var e;return(function(r){r.method="workspace/configuration",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(Zi.ConfigurationRequest=e={})),Zi}var Yr={},np;function lb(){if(np)return Yr;np=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.ColorPresentationRequest=Yr.DocumentColorRequest=void 0;const t=$e();var e;(function(n){n.method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(Yr.DocumentColorRequest=e={}));var r;return(function(n){n.method="textDocument/colorPresentation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(Yr.ColorPresentationRequest=r={})),Yr}var Xr={},ip;function ub(){if(ip)return Xr;ip=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.FoldingRangeRefreshRequest=Xr.FoldingRangeRequest=void 0;const t=$e();var e;(function(n){n.method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(Xr.FoldingRangeRequest=e={}));var r;return(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(Xr.FoldingRangeRefreshRequest=r={})),Xr}var Qi={},ap;function cb(){if(ap)return Qi;ap=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.DeclarationRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/declaration",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Qi.DeclarationRequest=e={})),Qi}var ea={},sp;function fb(){if(sp)return ea;sp=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.SelectionRangeRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/selectionRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ea.SelectionRangeRequest=e={})),ea}var ir={},op;function db(){if(op)return ir;op=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.WorkDoneProgressCancelNotification=ir.WorkDoneProgressCreateRequest=ir.WorkDoneProgress=void 0;const t=wi(),e=$e();var r;(function(a){a.type=new t.ProgressType;function s(o){return o===a.type}a.is=s})(r||(ir.WorkDoneProgress=r={}));var n;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(n||(ir.WorkDoneProgressCreateRequest=n={}));var i;return(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(i||(ir.WorkDoneProgressCancelNotification=i={})),ir}var ar={},lp;function pb(){if(lp)return ar;lp=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.CallHierarchyOutgoingCallsRequest=ar.CallHierarchyIncomingCallsRequest=ar.CallHierarchyPrepareRequest=void 0;const t=$e();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(ar.CallHierarchyPrepareRequest=e={}));var r;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(ar.CallHierarchyIncomingCallsRequest=r={}));var n;return(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(ar.CallHierarchyOutgoingCallsRequest=n={})),ar}var Ze={},up;function hb(){if(up)return Ze;up=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.SemanticTokensRefreshRequest=Ze.SemanticTokensRangeRequest=Ze.SemanticTokensDeltaRequest=Ze.SemanticTokensRequest=Ze.SemanticTokensRegistrationType=Ze.TokenFormat=void 0;const t=$e();var e;(function(o){o.Relative="relative"})(e||(Ze.TokenFormat=e={}));var r;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(r||(Ze.SemanticTokensRegistrationType=r={}));var n;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(n||(Ze.SemanticTokensRequest=n={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(i||(Ze.SemanticTokensDeltaRequest=i={}));var a;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(a||(Ze.SemanticTokensRangeRequest=a={}));var s;return(function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(s||(Ze.SemanticTokensRefreshRequest=s={})),Ze}var ta={},cp;function mb(){if(cp)return ta;cp=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.ShowDocumentRequest=void 0;const t=$e();var e;return(function(r){r.method="window/showDocument",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(ta.ShowDocumentRequest=e={})),ta}var ra={},fp;function gb(){if(fp)return ra;fp=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.LinkedEditingRangeRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ra.LinkedEditingRangeRequest=e={})),ra}var je={},dp;function yb(){if(dp)return je;dp=1,Object.defineProperty(je,"__esModule",{value:!0}),je.WillDeleteFilesRequest=je.DidDeleteFilesNotification=je.DidRenameFilesNotification=je.WillRenameFilesRequest=je.DidCreateFilesNotification=je.WillCreateFilesRequest=je.FileOperationPatternKind=void 0;const t=$e();var e;(function(l){l.file="file",l.folder="folder"})(e||(je.FileOperationPatternKind=e={}));var r;(function(l){l.method="workspace/willCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(r||(je.WillCreateFilesRequest=r={}));var n;(function(l){l.method="workspace/didCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(n||(je.DidCreateFilesNotification=n={}));var i;(function(l){l.method="workspace/willRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(je.WillRenameFilesRequest=i={}));var a;(function(l){l.method="workspace/didRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(a||(je.DidRenameFilesNotification=a={}));var s;(function(l){l.method="workspace/didDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(s||(je.DidDeleteFilesNotification=s={}));var o;return(function(l){l.method="workspace/willDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(je.WillDeleteFilesRequest=o={})),je}var sr={},pp;function Tb(){if(pp)return sr;pp=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.MonikerRequest=sr.MonikerKind=sr.UniquenessLevel=void 0;const t=$e();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(sr.UniquenessLevel=e={}));var r;(function(i){i.$import="import",i.$export="export",i.local="local"})(r||(sr.MonikerKind=r={}));var n;return(function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(sr.MonikerRequest=n={})),sr}var or={},hp;function Rb(){if(hp)return or;hp=1,Object.defineProperty(or,"__esModule",{value:!0}),or.TypeHierarchySubtypesRequest=or.TypeHierarchySupertypesRequest=or.TypeHierarchyPrepareRequest=void 0;const t=$e();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(or.TypeHierarchyPrepareRequest=e={}));var r;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(or.TypeHierarchySupertypesRequest=r={}));var n;return(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(or.TypeHierarchySubtypesRequest=n={})),or}var Jr={},mp;function vb(){if(mp)return Jr;mp=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.InlineValueRefreshRequest=Jr.InlineValueRequest=void 0;const t=$e();var e;(function(n){n.method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(Jr.InlineValueRequest=e={}));var r;return(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(Jr.InlineValueRefreshRequest=r={})),Jr}var lr={},gp;function $b(){if(gp)return lr;gp=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.InlayHintRefreshRequest=lr.InlayHintResolveRequest=lr.InlayHintRequest=void 0;const t=$e();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(lr.InlayHintRequest=e={}));var r;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(lr.InlayHintResolveRequest=r={}));var n;return(function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(n||(lr.InlayHintRefreshRequest=n={})),lr}var ut={},yp;function Ab(){if(yp)return ut;yp=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.DiagnosticRefreshRequest=ut.WorkspaceDiagnosticRequest=ut.DocumentDiagnosticRequest=ut.DocumentDiagnosticReportKind=ut.DiagnosticServerCancellationData=void 0;const t=wi(),e=of(),r=$e();var n;(function(l){function u(c){const f=c;return f&&e.boolean(f.retriggerRequest)}l.is=u})(n||(ut.DiagnosticServerCancellationData=n={}));var i;(function(l){l.Full="full",l.Unchanged="unchanged"})(i||(ut.DocumentDiagnosticReportKind=i={}));var a;(function(l){l.method="textDocument/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(a||(ut.DocumentDiagnosticRequest=a={}));var s;(function(l){l.method="workspace/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(s||(ut.WorkspaceDiagnosticRequest=s={}));var o;return(function(l){l.method="workspace/diagnostic/refresh",l.messageDirection=r.MessageDirection.serverToClient,l.type=new r.ProtocolRequestType0(l.method)})(o||(ut.DiagnosticRefreshRequest=o={})),ut}var ye={},Tp;function Eb(){if(Tp)return ye;Tp=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.DidCloseNotebookDocumentNotification=ye.DidSaveNotebookDocumentNotification=ye.DidChangeNotebookDocumentNotification=ye.NotebookCellArrayChange=ye.DidOpenNotebookDocumentNotification=ye.NotebookDocumentSyncRegistrationType=ye.NotebookDocument=ye.NotebookCell=ye.ExecutionSummary=ye.NotebookCellKind=void 0;const t=sf,e=of(),r=$e();var n;(function(h){h.Markup=1,h.Code=2;function $(b){return b===1||b===2}h.is=$})(n||(ye.NotebookCellKind=n={}));var i;(function(h){function $(E,C){const S={executionOrder:E};return(C===!0||C===!1)&&(S.success=C),S}h.create=$;function b(E){const C=E;return e.objectLiteral(C)&&t.uinteger.is(C.executionOrder)&&(C.success===void 0||e.boolean(C.success))}h.is=b;function I(E,C){return E===C?!0:E==null||C===null||C===void 0?!1:E.executionOrder===C.executionOrder&&E.success===C.success}h.equals=I})(i||(ye.ExecutionSummary=i={}));var a;(function(h){function $(C,S){return{kind:C,document:S}}h.create=$;function b(C){const S=C;return e.objectLiteral(S)&&n.is(S.kind)&&t.DocumentUri.is(S.document)&&(S.metadata===void 0||e.objectLiteral(S.metadata))}h.is=b;function I(C,S){const P=new Set;return C.document!==S.document&&P.add("document"),C.kind!==S.kind&&P.add("kind"),C.executionSummary!==S.executionSummary&&P.add("executionSummary"),(C.metadata!==void 0||S.metadata!==void 0)&&!E(C.metadata,S.metadata)&&P.add("metadata"),(C.executionSummary!==void 0||S.executionSummary!==void 0)&&!i.equals(C.executionSummary,S.executionSummary)&&P.add("executionSummary"),P}h.diff=I;function E(C,S){if(C===S)return!0;if(C==null||S===null||S===void 0||typeof C!=typeof S||typeof C!="object")return!1;const P=Array.isArray(C),V=Array.isArray(S);if(P!==V)return!1;if(P&&V){if(C.length!==S.length)return!1;for(let H=0;H<C.length;H++)if(!E(C[H],S[H]))return!1}if(e.objectLiteral(C)&&e.objectLiteral(S)){const H=Object.keys(C),J=Object.keys(S);if(H.length!==J.length||(H.sort(),J.sort(),!E(H,J)))return!1;for(let oe=0;oe<H.length;oe++){const pe=H[oe];if(!E(C[pe],S[pe]))return!1}}return!0}})(a||(ye.NotebookCell=a={}));var s;(function(h){function $(I,E,C,S){return{uri:I,notebookType:E,version:C,cells:S}}h.create=$;function b(I){const E=I;return e.objectLiteral(E)&&e.string(E.uri)&&t.integer.is(E.version)&&e.typedArray(E.cells,a.is)}h.is=b})(s||(ye.NotebookDocument=s={}));var o;(function(h){h.method="notebookDocument/sync",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.RegistrationType(h.method)})(o||(ye.NotebookDocumentSyncRegistrationType=o={}));var l;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(l||(ye.DidOpenNotebookDocumentNotification=l={}));var u;(function(h){function $(I){const E=I;return e.objectLiteral(E)&&t.uinteger.is(E.start)&&t.uinteger.is(E.deleteCount)&&(E.cells===void 0||e.typedArray(E.cells,a.is))}h.is=$;function b(I,E,C){const S={start:I,deleteCount:E};return C!==void 0&&(S.cells=C),S}h.create=b})(u||(ye.NotebookCellArrayChange=u={}));var c;(function(h){h.method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(c||(ye.DidChangeNotebookDocumentNotification=c={}));var f;(function(h){h.method="notebookDocument/didSave",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(f||(ye.DidSaveNotebookDocumentNotification=f={}));var p;return(function(h){h.method="notebookDocument/didClose",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(p||(ye.DidCloseNotebookDocumentNotification=p={})),ye}var na={},Rp;function Cb(){if(Rp)return na;Rp=1,Object.defineProperty(na,"__esModule",{value:!0}),na.InlineCompletionRequest=void 0;const t=$e();var e;return(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(na.InlineCompletionRequest=e={})),na}var vp;function Sb(){return vp||(vp=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=$e(),r=sf,n=of(),i=ib();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=ab();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=sb();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=ob();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=lb();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const u=ub();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const c=cb();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return c.DeclarationRequest}});const f=fb();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const p=db();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return p.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return p.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return p.WorkDoneProgressCancelNotification}});const h=pb();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const $=hb();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return $.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return $.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return $.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return $.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return $.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return $.SemanticTokensRegistrationType}});const b=mb();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return b.ShowDocumentRequest}});const I=gb();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return I.LinkedEditingRangeRequest}});const E=yb();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return E.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return E.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return E.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return E.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return E.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return E.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return E.WillDeleteFilesRequest}});const C=Tb();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return C.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return C.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return C.MonikerRequest}});const S=Rb();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return S.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySupertypesRequest}});const P=vb();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return P.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return P.InlineValueRefreshRequest}});const V=$b();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return V.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return V.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return V.InlayHintRefreshRequest}});const H=Ab();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return H.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return H.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return H.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return H.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return H.DiagnosticRefreshRequest}});const J=Eb();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return J.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return J.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return J.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return J.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return J.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return J.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidCloseNotebookDocumentNotification}});const oe=Cb();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return oe.InlineCompletionRequest}});var pe;(function(d){function be(_e){const K=_e;return n.string(K)||n.string(K.language)||n.string(K.scheme)||n.string(K.pattern)}d.is=be})(pe||(t.TextDocumentFilter=pe={}));var he;(function(d){function be(_e){const K=_e;return n.objectLiteral(K)&&(n.string(K.notebookType)||n.string(K.scheme)||n.string(K.pattern))}d.is=be})(he||(t.NotebookDocumentFilter=he={}));var N;(function(d){function be(_e){const K=_e;return n.objectLiteral(K)&&(n.string(K.notebook)||he.is(K.notebook))&&(K.language===void 0||n.string(K.language))}d.is=be})(N||(t.NotebookCellTextDocumentFilter=N={}));var T;(function(d){function be(_e){if(!Array.isArray(_e))return!1;for(let K of _e)if(!n.string(K)&&!pe.is(K)&&!N.is(K))return!1;return!0}d.is=be})(T||(t.DocumentSelector=T={}));var g;(function(d){d.method="client/registerCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(g||(t.RegistrationRequest=g={}));var w;(function(d){d.method="client/unregisterCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(w||(t.UnregistrationRequest=w={}));var y;(function(d){d.Create="create",d.Rename="rename",d.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var R;(function(d){d.Abort="abort",d.Transactional="transactional",d.TextOnlyTransactional="textOnlyTransactional",d.Undo="undo"})(R||(t.FailureHandlingKind=R={}));var A;(function(d){d.UTF8="utf-8",d.UTF16="utf-16",d.UTF32="utf-32"})(A||(t.PositionEncodingKind=A={}));var L;(function(d){function be(_e){const K=_e;return K&&n.string(K.id)&&K.id.length>0}d.hasId=be})(L||(t.StaticRegistrationOptions=L={}));var D;(function(d){function be(_e){const K=_e;return K&&(K.documentSelector===null||T.is(K.documentSelector))}d.is=be})(D||(t.TextDocumentRegistrationOptions=D={}));var x;(function(d){function be(K){const m=K;return n.objectLiteral(m)&&(m.workDoneProgress===void 0||n.boolean(m.workDoneProgress))}d.is=be;function _e(K){const m=K;return m&&n.boolean(m.workDoneProgress)}d.hasWorkDoneProgress=_e})(x||(t.WorkDoneProgressOptions=x={}));var U;(function(d){d.method="initialize",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(U||(t.InitializeRequest=U={}));var F;(function(d){d.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var ae;(function(d){d.method="initialized",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ae||(t.InitializedNotification=ae={}));var q;(function(d){d.method="shutdown",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType0(d.method)})(q||(t.ShutdownRequest=q={}));var ne;(function(d){d.method="exit",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType0(d.method)})(ne||(t.ExitNotification=ne={}));var Ge;(function(d){d.method="workspace/didChangeConfiguration",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Ge||(t.DidChangeConfigurationNotification=Ge={}));var Ae;(function(d){d.Error=1,d.Warning=2,d.Info=3,d.Log=4,d.Debug=5})(Ae||(t.MessageType=Ae={}));var me;(function(d){d.method="window/showMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(me||(t.ShowMessageNotification=me={}));var Le;(function(d){d.method="window/showMessageRequest",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(Le||(t.ShowMessageRequest=Le={}));var ze;(function(d){d.method="window/logMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(ze||(t.LogMessageNotification=ze={}));var Ie;(function(d){d.method="telemetry/event",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Ie||(t.TelemetryEventNotification=Ie={}));var ee;(function(d){d.None=0,d.Full=1,d.Incremental=2})(ee||(t.TextDocumentSyncKind=ee={}));var lt;(function(d){d.method="textDocument/didOpen",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(lt||(t.DidOpenTextDocumentNotification=lt={}));var Ee;(function(d){function be(K){let m=K;return m!=null&&typeof m.text=="string"&&m.range!==void 0&&(m.rangeLength===void 0||typeof m.rangeLength=="number")}d.isIncremental=be;function _e(K){let m=K;return m!=null&&typeof m.text=="string"&&m.range===void 0&&m.rangeLength===void 0}d.isFull=_e})(Ee||(t.TextDocumentContentChangeEvent=Ee={}));var St;(function(d){d.method="textDocument/didChange",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(St||(t.DidChangeTextDocumentNotification=St={}));var En;(function(d){d.method="textDocument/didClose",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(En||(t.DidCloseTextDocumentNotification=En={}));var _i;(function(d){d.method="textDocument/didSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(_i||(t.DidSaveTextDocumentNotification=_i={}));var Ni;(function(d){d.Manual=1,d.AfterDelay=2,d.FocusOut=3})(Ni||(t.TextDocumentSaveReason=Ni={}));var ki;(function(d){d.method="textDocument/willSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ki||(t.WillSaveTextDocumentNotification=ki={}));var Ii;(function(d){d.method="textDocument/willSaveWaitUntil",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Ii||(t.WillSaveTextDocumentWaitUntilRequest=Ii={}));var wt;(function(d){d.method="workspace/didChangeWatchedFiles",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(wt||(t.DidChangeWatchedFilesNotification=wt={}));var Pi;(function(d){d.Created=1,d.Changed=2,d.Deleted=3})(Pi||(t.FileChangeType=Pi={}));var Za;(function(d){function be(_e){const K=_e;return n.objectLiteral(K)&&(r.URI.is(K.baseUri)||r.WorkspaceFolder.is(K.baseUri))&&n.string(K.pattern)}d.is=be})(Za||(t.RelativePattern=Za={}));var Qa;(function(d){d.Create=1,d.Change=2,d.Delete=4})(Qa||(t.WatchKind=Qa={}));var es;(function(d){d.method="textDocument/publishDiagnostics",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(es||(t.PublishDiagnosticsNotification=es={}));var ts;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.TriggerForIncompleteCompletions=3})(ts||(t.CompletionTriggerKind=ts={}));var Oi;(function(d){d.method="textDocument/completion",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Oi||(t.CompletionRequest=Oi={}));var Li;(function(d){d.method="completionItem/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Li||(t.CompletionResolveRequest=Li={}));var Zt;(function(d){d.method="textDocument/hover",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zt||(t.HoverRequest=Zt={}));var xi;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.ContentChange=3})(xi||(t.SignatureHelpTriggerKind=xi={}));var rs;(function(d){d.method="textDocument/signatureHelp",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(rs||(t.SignatureHelpRequest=rs={}));var ns;(function(d){d.method="textDocument/definition",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ns||(t.DefinitionRequest=ns={}));var Di;(function(d){d.method="textDocument/references",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Di||(t.ReferencesRequest=Di={}));var Mi;(function(d){d.method="textDocument/documentHighlight",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Mi||(t.DocumentHighlightRequest=Mi={}));var is;(function(d){d.method="textDocument/documentSymbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(is||(t.DocumentSymbolRequest=is={}));var as;(function(d){d.method="textDocument/codeAction",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(as||(t.CodeActionRequest=as={}));var ss;(function(d){d.method="codeAction/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ss||(t.CodeActionResolveRequest=ss={}));var os;(function(d){d.method="workspace/symbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(os||(t.WorkspaceSymbolRequest=os={}));var ls;(function(d){d.method="workspaceSymbol/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ls||(t.WorkspaceSymbolResolveRequest=ls={}));var us;(function(d){d.method="textDocument/codeLens",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(us||(t.CodeLensRequest=us={}));var bt;(function(d){d.method="codeLens/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(bt||(t.CodeLensResolveRequest=bt={}));var cs;(function(d){d.method="workspace/codeLens/refresh",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType0(d.method)})(cs||(t.CodeLensRefreshRequest=cs={}));var fs;(function(d){d.method="textDocument/documentLink",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(fs||(t.DocumentLinkRequest=fs={}));var zr;(function(d){d.method="documentLink/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(zr||(t.DocumentLinkResolveRequest=zr={}));var ds;(function(d){d.method="textDocument/formatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ds||(t.DocumentFormattingRequest=ds={}));var Cn;(function(d){d.method="textDocument/rangeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Cn||(t.DocumentRangeFormattingRequest=Cn={}));var ps;(function(d){d.method="textDocument/rangesFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ps||(t.DocumentRangesFormattingRequest=ps={}));var Qt;(function(d){d.method="textDocument/onTypeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Qt||(t.DocumentOnTypeFormattingRequest=Qt={}));var Nr;(function(d){d.Identifier=1})(Nr||(t.PrepareSupportDefaultBehavior=Nr={}));var hs;(function(d){d.method="textDocument/rename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(hs||(t.RenameRequest=hs={}));var ms;(function(d){d.method="textDocument/prepareRename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ms||(t.PrepareRenameRequest=ms={}));var kr;(function(d){d.method="workspace/executeCommand",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(kr||(t.ExecuteCommandRequest=kr={}));var Fi;(function(d){d.method="workspace/applyEdit",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType("workspace/applyEdit")})(Fi||(t.ApplyWorkspaceEditRequest=Fi={}))})(Tl)),Tl}var ia={},$p;function wb(){if($p)return ia;$p=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.createProtocolConnection=void 0;const t=wi();function e(r,n,i,a){return t.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,t.createMessageConnection)(r,n,i,a)}return ia.createProtocolConnection=e,ia}var Ap;function bb(){return Ap||(Ap=1,(function(t){var e=Vr&&Vr.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=Vr&&Vr.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(wi(),t),r(sf,t),r($e(),t),r(Sb(),t);var n=wb();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return n.createProtocolConnection}});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(Vr)),Vr}var Ep;function _b(){return Ep||(Ep=1,(function(t){var e=Br&&Br.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=Br&&Br.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const n=Xd();r(Xd(),t),r(bb(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(Br)),Br}var bs=_b(),va;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(va||(va={}));class Nb{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new xa,this.documentPhaseListeners=new xa,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Y.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=ve.CancellationToken.None){for(const i of e){const a=i.uri.toString();if(i.state===Y.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,Y.IndexedReferences);else if(typeof r.validation=="object"){const s=this.findMissingValidationCategories(i,r);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),i.state=Y.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=Y.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=ve.CancellationToken.None){this.currentState=Y.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const c of u)i.push(c.uri),this.cleanUpDeleted(c)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Y.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Y.Changed)}const s=Te(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Y.ComputedScopes)),await this.emitUpdate(a,i),await Qe(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state<Y.Validated||!this.buildState.get(l.uri.toString())?.completed||this.resultsAreIncomplete(l,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=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 Te(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const 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),va.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Y.Changed:case Y.Parsed:this.indexManager.removeContent(e.uri);case Y.IndexedContent:e.localSymbols=void 0;case Y.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Y.Linked:this.indexManager.removeReferences(e.uri);case Y.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Y.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Y.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Y.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Y.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Y.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Y.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Y.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Y.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a?.result})}}async runCancelable(e,r,n,i){for(const s of e)s.state<r&&(await Qe(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));const a=e.filter(s=>s.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),va.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),va.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=ve.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Wn);if(this.currentState>=e&&e>i.state)return Promise.reject(new bs.ResponseError(bs.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Y[i.state]}, requiring ${Y[e]}, but workspace state is already ${Y[this.currentState]}. Returning undefined.`))}else return Promise.reject(new bs.ResponseError(bs.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{dt.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Wn)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Wn):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Wn)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Qe(n),await s(e,n)}catch(o){if(!Jo(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Qe(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Te(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}}class kb{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new xw,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=mr(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{dt.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Te(i)}allElements(e,r){let n=Te(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(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=ve.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=ve.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class Ib{constructor(e){this.initialBuildOptions={},this._ready=new af,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=ve.CancellationToken.None){const n=await this.performStartup(e);await Qe(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Te(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Lt.parse(e.uri)}async traverseFolder(e,r){try{const 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){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=dt.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class Pb{buildUnexpectedCharactersMessage(e,r,n,i,a){return Yl.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Yl.buildUnableToPopLexerModeMessage(e)}}const Ob={mode:"full"};class Lb{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=Cp(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new nt(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Ob){const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Cp(e))return e;const r=Km(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function xb(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function Km(t){return t&&"modes"in t&&"defaultMode"in t}function Cp(t){return!xb(t)&&!Km(t)}function Db(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=re.create(0,0));const a=Vm(t),s=lf(n),o=Gb({lines:a,position:i,options:s});return Bb({index:0,tokens:o,position:i})}function Mb(t,e){const r=lf(e),n=Vm(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!s?.exec(i)&&!!o?.exec(a)}function Vm(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(oy)}const Sp=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Fb=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Gb(t){const e=[];let r=t.position.line,n=t.position.character;for(let i=0;i<t.lines.length;i++){const a=i===0,s=i===t.lines.length-1;let o=t.lines[i],l=0;if(a&&t.options.start){const c=t.options.start?.exec(o);c&&(l=c.index+c[0].length)}else{const c=t.options.line?.exec(o);c&&(l=c.index+c[0].length)}if(s){const c=t.options.end?.exec(o);c&&(o=o.substring(0,c.index))}if(o=o.substring(0,qb(o)),cc(o,l)>=o.length){if(e.length>0){const c=re.create(r,n);e.push({type:"break",content:"",range:X.create(c,c)})}}else{Sp.lastIndex=l;const c=Sp.exec(o);if(c){const f=c[0],p=c[1],h=re.create(r,n+l),$=re.create(r,n+l+f.length);e.push({type:"tag",content:p,range:X.create(h,$)}),l+=f.length,l=cc(o,l)}if(l<o.length){const f=o.substring(l),p=Array.from(f.matchAll(Fb));e.push(...zb(p,f,r,n+l))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function zb(t,e,r,n){const i=[];if(t.length===0){const a=re.create(r,n),s=re.create(r,n+e.length);i.push({type:"text",content:e,range:X.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:X.create(re.create(r,a+n),re.create(r,l+n))});let c=u.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:X.create(re.create(r,a+c+n),re.create(r,a+c+f.length+n))}),c+=f.length,o.length===4){c+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:X.create(re.create(r,a+c+n),re.create(r,a+c+p.length+n))})}else i.push({type:"text",content:"",range:X.create(re.create(r,a+c+n),re.create(r,a+c+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:X.create(re.create(r,a+n),re.create(r,a+n+s.length))})}return i}const Ub=/\S/,jb=/\s*$/;function cc(t,e){const r=t.substring(e).match(Ub);return r?e+r.index:t.length}function qb(t){const e=t.match(jb);if(e&&typeof e.index=="number")return e.index}function Bb(t){const e=re.create(t.position.line,t.position.character);if(t.tokens.length===0)return new wp([],X.create(e,e));const r=[];for(;t.index<t.tokens.length;){const a=Wb(t,r[r.length-1]);a&&r.push(a)}const n=r[0]?.range.start??e,i=r[r.length-1]?.range.end??e;return new wp(r,X.create(n,i))}function Wb(t,e){const r=t.tokens[t.index];if(r.type==="tag")return Ym(t,!1);if(r.type==="text"||r.type==="inline-tag")return Hm(t);Kb(r,e),t.index++}function Kb(t,e){if(e){const r=new Jm("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Hm(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(Vb(t)),n=e,e=t.tokens[t.index];return new fc(i,X.create(r.range.start,n.range.end))}function Vb(t){return t.tokens[t.index].type==="inline-tag"?Ym(t,!0):Xm(t)}function Ym(t,e){const r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){const a=Xm(t);return new vl(n,new fc([a],a.range),e,X.create(r.range.start,a.range.end))}else{const a=Hm(t);return new vl(n,a,e,X.create(r.range.start,a.range.end))}else{const a=r.range;return new vl(n,new fc([],a),e,a)}}function Xm(t){const e=t.tokens[t.index++];return new Jm(e.content,e.range)}function lf(t){if(!t)return lf({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:Rl(e,!0),end:Rl(r,!1),line:Rl(n,!0)}}function Rl(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?ko(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class wp{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(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=bp(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=bp(r)+i}return r.trim()}}class vl{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
152
+ ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Hb(this.name,r,e??{});if(typeof a=="string")return a}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} — ${r}`:this.content.inlines.length>1&&(i=`${i}
153
+ ${r}`),this.inline?`{${i}}`:i}}function Hb(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){const n=e.indexOf(" ");let i=e;if(n>0){const s=cc(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)??Yb(e,i)}}function Yb(t,e){try{return Lt.parse(t,!0),`[${e}](${t})`}catch{return t}}class fc{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
154
+ `)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
155
+ `)}return r}}class Jm{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function bp(t){return t.endsWith(`
156
+ `)?`
157
+ `:`
158
+
159
+ `}class Xb{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Mb(r))return Db(r).toMarkdown({renderLink:(i,a)=>this.documentationLinkRenderer(e,i,a),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=mr(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}}class Jb{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Fw(e)?e.$comment:ry(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}}class Zb{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class Qb{constructor(){this.previousTokenSource=new ve.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Ew();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=ve.CancellationToken.None){const i=new af,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const 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{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Jo(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class e_{constructor(e){this.grammarElementIdMap=new Ld,this.tokenTypeIdMap=new Ld,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){const r=new Map,n=new Map;for(const i of gr(e))r.set(i,{});if(e.$cstNode)for(const i of zl(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ye(o)?s.push(this.dehydrateAstNode(o,r)):It(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ye(a)?n[i]=this.dehydrateAstNode(a,r):It(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Wp(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),$a(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Bp(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){const 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){const r=new Map,n=new Map;for(const a of gr(e))r.set(a,{});let i;if(e.$cstNode)for(const a of zl(e.$cstNode)){let s;"fullText"in a?(s=new Nm(a.fullText),i=s):"content"in a?s=new tf:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ye(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):It(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ye(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):It(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);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){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),$a(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new nc(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}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(const r of gr(this.grammar))Og(r)&&this.grammarElementIdMap.set(r,e++)}}function Yt(t){return{documentation:{CommentProvider:e=>new Jb(e),DocumentationProvider:e=>new Xb(e)},parser:{AsyncParser:e=>new Zb(e),GrammarConfig:e=>Ny(e),LangiumParser:e=>Rw(e),CompletionParser:e=>Tw(e),ValueConverter:()=>new Fm,TokenBuilder:()=>new Mm,Lexer:e=>new Lb(e),ParserErrorMessageProvider:()=>new Pm,LexerErrorMessageProvider:()=>new Pb},workspace:{AstNodeLocator:()=>new Hw,AstNodeDescriptionProvider:e=>new Kw(e),ReferenceDescriptionProvider:e=>new Vw(e)},references:{Linker:e=>new _w(e),NameProvider:()=>new kw,ScopeProvider:e=>new Mw(e),ScopeComputation:e=>new Pw(e),References:e=>new Iw(e)},serializer:{Hydrator:e=>new e_(e),JsonSerializer:e=>new Gw(e)},validation:{DocumentValidator:e=>new qw(e),ValidationRegistry:e=>new Uw(e)},shared:()=>t.shared}}function Xt(t){return{ServiceRegistry:e=>new zw(e),workspace:{LangiumDocuments:e=>new bw(e),LangiumDocumentFactory:e=>new ww(e),DocumentBuilder:e=>new Nb(e),IndexManager:e=>new kb(e),WorkspaceManager:e=>new Ib(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Qb,ConfigurationProvider:e=>new Xw(e)},profilers:{}}}var _p;(function(t){t.merge=(e,r)=>Da(Da({},e),r)})(_p||(_p={}));function Oe(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(Da,{});return Zm(u)}const t_=Symbol("isProxy");function Zm(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===t_?!0:kp(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(kp(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const Np=Symbol();function kp(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]===Np)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){const i=r[e];t[e]=Np;try{t[e]=typeof i=="function"?i(n):Zm(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function Da(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Da(i,n):t[r]=Da({},n)}else t[r]=n}return t}class r_{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[]}}const Jt={fileSystemProvider:()=>new r_},n_={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},i_={AstReflection:()=>new Jp};function a_(){const t=Oe(Xt(Jt),i_),e=Oe(Yt({shared:t}),n_);return t.ServiceRegistry.register(e),e}function wr(t){const e=a_(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Lt.parse(`memory:/${r.name??"grammar"}.langium`)),r}var s_=Object.defineProperty,k=(t,e)=>s_(t,"name",{value:e,configurable:!0}),dc;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(dc||(dc={}));var pc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(pc||(pc={}));var hc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(hc||(hc={}));var mc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(mc||(mc={}));var gc;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(gc||(gc={}));var yc;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(yc||(yc={}));var Tc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Tc||(Tc={}));var Rc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(Rc||(Rc={}));var vc;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \t]+[A-Za-z(][A-Za-z0-9_()&]*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(vc||(vc={}));({...dc.Terminals,...pc.Terminals,...hc.Terminals,...mc.Terminals,...gc.Terminals,...yc.Terminals,...Rc.Terminals,...Tc.Terminals,...vc.Terminals});var _s={$type:"Accelerator",name:"name",x:"x",y:"y"},Ns={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},aa={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},$l={$type:"Annotations",x:"x",y:"y"},cr={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function o_(t){return Ct.isInstance(t,cr.$type)}k(o_,"isArchitecture");var ks={$type:"Axis",label:"label",name:"name"},Zs={$type:"Branch",name:"name",order:"order"};function l_(t){return Ct.isInstance(t,Zs.$type)}k(l_,"isBranch");var Ip={$type:"Checkout",branch:"branch"},Is={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Al={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Gn={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function u_(t){return Ct.isInstance(t,Gn.$type)}k(u_,"isCommit");var Zr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},Ps={$type:"Curve",entries:"entries",label:"label",name:"name"},Os={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Pp={$type:"Decorator",strategy:"strategy"},_n={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Gt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},El={$type:"Entry",axis:"axis",value:"value"},Op={$type:"Evolution",stages:"stages"},Ls={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},Cl={$type:"Evolve",component:"component",target:"target"},sn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function c_(t){return Ct.isInstance(t,sn.$type)}k(c_,"isGitGraph");var sa={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ta={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function f_(t){return Ct.isInstance(t,Ta.$type)}k(f_,"isInfo");var oa={$type:"Item",classSelector:"classSelector",name:"name"},Sl={$type:"Junction",id:"id",in:"in"},la={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},xs={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Qr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},zn={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function d_(t){return Ct.isInstance(t,zn.$type)}k(d_,"isMerge");var Ds={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},wl={$type:"Option",name:"name",value:"value"},Un={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function p_(t){return Ct.isInstance(t,Un.$type)}k(p_,"isPacket");var jn={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function h_(t){return Ct.isInstance(t,jn.$type)}k(h_,"isPacketBlock");var on={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function m_(t){return Ct.isInstance(t,on.$type)}k(m_,"isPie");var Qs={$type:"PieSection",label:"label",value:"value"};function g_(t){return Ct.isInstance(t,Qs.$type)}k(g_,"isPieSection");var bl={$type:"Pipeline",components:"components",parent:"parent"},Ms={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},en={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},_l={$type:"Section",classSelector:"classSelector",name:"name"},Nn={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Nl={$type:"Size",height:"height",width:"width"},kn={$type:"Statement"},qn={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function y_(t){return Ct.isInstance(t,qn.$type)}k(y_,"isTreemap");var kl={$type:"TreemapRow",indent:"indent",item:"item"},Il={$type:"TreeNode",indent:"indent",name:"name"},ua={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},qe={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function T_(t){return Ct.isInstance(t,qe.$type)}k(T_,"isWardley");var Hn,Qm=(Hn=class extends qp{constructor(){super(...arguments),this.types={Accelerator:{name:_s.$type,properties:{name:{name:_s.name},x:{name:_s.x},y:{name:_s.y}},superTypes:[]},Anchor:{name:Ns.$type,properties:{evolution:{name:Ns.evolution},name:{name:Ns.name},visibility:{name:Ns.visibility}},superTypes:[]},Annotation:{name:aa.$type,properties:{number:{name:aa.number},text:{name:aa.text},x:{name:aa.x},y:{name:aa.y}},superTypes:[]},Annotations:{name:$l.$type,properties:{x:{name:$l.x},y:{name:$l.y}},superTypes:[]},Architecture:{name:cr.$type,properties:{accDescr:{name:cr.accDescr},accTitle:{name:cr.accTitle},edges:{name:cr.edges,defaultValue:[]},groups:{name:cr.groups,defaultValue:[]},junctions:{name:cr.junctions,defaultValue:[]},services:{name:cr.services,defaultValue:[]},title:{name:cr.title}},superTypes:[]},Axis:{name:ks.$type,properties:{label:{name:ks.label},name:{name:ks.name}},superTypes:[]},Branch:{name:Zs.$type,properties:{name:{name:Zs.name},order:{name:Zs.order}},superTypes:[kn.$type]},Checkout:{name:Ip.$type,properties:{branch:{name:Ip.branch}},superTypes:[kn.$type]},CherryPicking:{name:Is.$type,properties:{id:{name:Is.id},parent:{name:Is.parent},tags:{name:Is.tags,defaultValue:[]}},superTypes:[kn.$type]},ClassDefStatement:{name:Al.$type,properties:{className:{name:Al.className},styleText:{name:Al.styleText}},superTypes:[]},Commit:{name:Gn.$type,properties:{id:{name:Gn.id},message:{name:Gn.message},tags:{name:Gn.tags,defaultValue:[]},type:{name:Gn.type}},superTypes:[kn.$type]},Component:{name:Zr.$type,properties:{decorator:{name:Zr.decorator},evolution:{name:Zr.evolution},inertia:{name:Zr.inertia,defaultValue:!1},label:{name:Zr.label},name:{name:Zr.name},visibility:{name:Zr.visibility}},superTypes:[]},Curve:{name:Ps.$type,properties:{entries:{name:Ps.entries,defaultValue:[]},label:{name:Ps.label},name:{name:Ps.name}},superTypes:[]},Deaccelerator:{name:Os.$type,properties:{name:{name:Os.name},x:{name:Os.x},y:{name:Os.y}},superTypes:[]},Decorator:{name:Pp.$type,properties:{strategy:{name:Pp.strategy}},superTypes:[]},Direction:{name:_n.$type,properties:{accDescr:{name:_n.accDescr},accTitle:{name:_n.accTitle},dir:{name:_n.dir},statements:{name:_n.statements,defaultValue:[]},title:{name:_n.title}},superTypes:[sn.$type]},Edge:{name:Gt.$type,properties:{lhsDir:{name:Gt.lhsDir},lhsGroup:{name:Gt.lhsGroup,defaultValue:!1},lhsId:{name:Gt.lhsId},lhsInto:{name:Gt.lhsInto,defaultValue:!1},rhsDir:{name:Gt.rhsDir},rhsGroup:{name:Gt.rhsGroup,defaultValue:!1},rhsId:{name:Gt.rhsId},rhsInto:{name:Gt.rhsInto,defaultValue:!1},title:{name:Gt.title}},superTypes:[]},Entry:{name:El.$type,properties:{axis:{name:El.axis,referenceType:ks.$type},value:{name:El.value}},superTypes:[]},Evolution:{name:Op.$type,properties:{stages:{name:Op.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:Ls.$type,properties:{boundary:{name:Ls.boundary},name:{name:Ls.name},secondName:{name:Ls.secondName}},superTypes:[]},Evolve:{name:Cl.$type,properties:{component:{name:Cl.component},target:{name:Cl.target}},superTypes:[]},GitGraph:{name:sn.$type,properties:{accDescr:{name:sn.accDescr},accTitle:{name:sn.accTitle},statements:{name:sn.statements,defaultValue:[]},title:{name:sn.title}},superTypes:[]},Group:{name:sa.$type,properties:{icon:{name:sa.icon},id:{name:sa.id},in:{name:sa.in},title:{name:sa.title}},superTypes:[]},Info:{name:Ta.$type,properties:{accDescr:{name:Ta.accDescr},accTitle:{name:Ta.accTitle},title:{name:Ta.title}},superTypes:[]},Item:{name:oa.$type,properties:{classSelector:{name:oa.classSelector},name:{name:oa.name}},superTypes:[]},Junction:{name:Sl.$type,properties:{id:{name:Sl.id},in:{name:Sl.in}},superTypes:[]},Label:{name:la.$type,properties:{negX:{name:la.negX,defaultValue:!1},negY:{name:la.negY,defaultValue:!1},offsetX:{name:la.offsetX},offsetY:{name:la.offsetY}},superTypes:[]},Leaf:{name:xs.$type,properties:{classSelector:{name:xs.classSelector},name:{name:xs.name},value:{name:xs.value}},superTypes:[oa.$type]},Link:{name:Qr.$type,properties:{arrow:{name:Qr.arrow},from:{name:Qr.from},fromPort:{name:Qr.fromPort},linkLabel:{name:Qr.linkLabel},to:{name:Qr.to},toPort:{name:Qr.toPort}},superTypes:[]},Merge:{name:zn.$type,properties:{branch:{name:zn.branch},id:{name:zn.id},tags:{name:zn.tags,defaultValue:[]},type:{name:zn.type}},superTypes:[kn.$type]},Note:{name:Ds.$type,properties:{evolution:{name:Ds.evolution},text:{name:Ds.text},visibility:{name:Ds.visibility}},superTypes:[]},Option:{name:wl.$type,properties:{name:{name:wl.name},value:{name:wl.value,defaultValue:!1}},superTypes:[]},Packet:{name:Un.$type,properties:{accDescr:{name:Un.accDescr},accTitle:{name:Un.accTitle},blocks:{name:Un.blocks,defaultValue:[]},title:{name:Un.title}},superTypes:[]},PacketBlock:{name:jn.$type,properties:{bits:{name:jn.bits},end:{name:jn.end},label:{name:jn.label},start:{name:jn.start}},superTypes:[]},Pie:{name:on.$type,properties:{accDescr:{name:on.accDescr},accTitle:{name:on.accTitle},sections:{name:on.sections,defaultValue:[]},showData:{name:on.showData,defaultValue:!1},title:{name:on.title}},superTypes:[]},PieSection:{name:Qs.$type,properties:{label:{name:Qs.label},value:{name:Qs.value}},superTypes:[]},Pipeline:{name:bl.$type,properties:{components:{name:bl.components,defaultValue:[]},parent:{name:bl.parent}},superTypes:[]},PipelineComponent:{name:Ms.$type,properties:{evolution:{name:Ms.evolution},label:{name:Ms.label},name:{name:Ms.name}},superTypes:[]},Radar:{name:en.$type,properties:{accDescr:{name:en.accDescr},accTitle:{name:en.accTitle},axes:{name:en.axes,defaultValue:[]},curves:{name:en.curves,defaultValue:[]},options:{name:en.options,defaultValue:[]},title:{name:en.title}},superTypes:[]},Section:{name:_l.$type,properties:{classSelector:{name:_l.classSelector},name:{name:_l.name}},superTypes:[oa.$type]},Service:{name:Nn.$type,properties:{icon:{name:Nn.icon},iconText:{name:Nn.iconText},id:{name:Nn.id},in:{name:Nn.in},title:{name:Nn.title}},superTypes:[]},Size:{name:Nl.$type,properties:{height:{name:Nl.height},width:{name:Nl.width}},superTypes:[]},Statement:{name:kn.$type,properties:{},superTypes:[]},TreeNode:{name:Il.$type,properties:{indent:{name:Il.indent},name:{name:Il.name}},superTypes:[]},TreeView:{name:ua.$type,properties:{accDescr:{name:ua.accDescr},accTitle:{name:ua.accTitle},nodes:{name:ua.nodes,defaultValue:[]},title:{name:ua.title}},superTypes:[]},Treemap:{name:qn.$type,properties:{accDescr:{name:qn.accDescr},accTitle:{name:qn.accTitle},title:{name:qn.title},TreemapRows:{name:qn.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:kl.$type,properties:{indent:{name:kl.indent},item:{name:kl.item}},superTypes:[]},Wardley:{name:qe.$type,properties:{accDescr:{name:qe.accDescr},accelerators:{name:qe.accelerators,defaultValue:[]},accTitle:{name:qe.accTitle},anchors:{name:qe.anchors,defaultValue:[]},annotation:{name:qe.annotation,defaultValue:[]},annotations:{name:qe.annotations,defaultValue:[]},components:{name:qe.components,defaultValue:[]},deaccelerators:{name:qe.deaccelerators,defaultValue:[]},evolution:{name:qe.evolution},evolves:{name:qe.evolves,defaultValue:[]},links:{name:qe.links,defaultValue:[]},notes:{name:qe.notes,defaultValue:[]},pipelines:{name:qe.pipelines,defaultValue:[]},size:{name:qe.size},title:{name:qe.title}},superTypes:[]}}}},k(Hn,"MermaidAstReflection"),Hn),Ct=new Qm,Lp,R_=k(()=>Lp??(Lp=wr(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),xp,v_=k(()=>xp??(xp=wr(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Dp,$_=k(()=>Dp??(Dp=wr(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Mp,A_=k(()=>Mp??(Mp=wr(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Fp,E_=k(()=>Fp??(Fp=wr(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Gp,C_=k(()=>Gp??(Gp=wr(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),zp,S_=k(()=>zp??(zp=wr(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Up,w_=k(()=>Up??(Up=wr(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n * Converted from treemap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),jp,b_=k(()=>jp??(jp=wr(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \\\\t]+[A-Za-z(][A-Za-z0-9_()&]*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),__={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},N_={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},k_={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},I_={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},P_={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},O_={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},L_={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},x_={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},D_={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},br={AstReflection:k(()=>new Qm,"AstReflection")},M_={Grammar:k(()=>R_(),"Grammar"),LanguageMetaData:k(()=>__,"LanguageMetaData"),parser:{}},F_={Grammar:k(()=>v_(),"Grammar"),LanguageMetaData:k(()=>N_,"LanguageMetaData"),parser:{}},G_={Grammar:k(()=>$_(),"Grammar"),LanguageMetaData:k(()=>k_,"LanguageMetaData"),parser:{}},z_={Grammar:k(()=>A_(),"Grammar"),LanguageMetaData:k(()=>I_,"LanguageMetaData"),parser:{}},U_={Grammar:k(()=>E_(),"Grammar"),LanguageMetaData:k(()=>P_,"LanguageMetaData"),parser:{}},j_={Grammar:k(()=>C_(),"Grammar"),LanguageMetaData:k(()=>O_,"LanguageMetaData"),parser:{}},q_={Grammar:k(()=>S_(),"Grammar"),LanguageMetaData:k(()=>L_,"LanguageMetaData"),parser:{}},B_={Grammar:k(()=>w_(),"Grammar"),LanguageMetaData:k(()=>x_,"LanguageMetaData"),parser:{}},W_={Grammar:k(()=>b_(),"Grammar"),LanguageMetaData:k(()=>D_,"LanguageMetaData"),parser:{}},K_=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,V_=/accTitle[\t ]*:([^\n\r]*)/,H_=/title([\t ][^\n\r]*|)/,Y_={ACC_DESCR:K_,ACC_TITLE:V_,TITLE:H_},Yn,bi=(Yn=class extends Fm{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=Y_[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
160
+ `)}}},k(Yn,"AbstractMermaidValueConverter"),Yn),Xn,Zo=(Xn=class extends bi{runCustomConverter(e,r,n){}},k(Xn,"CommonValueConverter"),Xn),Jn,_r=(Jn=class extends Mm{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},k(Jn,"AbstractMermaidTokenBuilder"),Jn),Zn;Zn=class extends _r{},k(Zn,"CommonTokenBuilder");var Qn,X_=(Qn=class extends _r{constructor(){super(["treemap"])}},k(Qn,"TreemapTokenBuilder"),Qn),J_=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,ei,Z_=(ei=class extends bi{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=J_.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},k(ei,"TreemapValueConverter"),ei);function eg(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}k(eg,"registerValidationChecks");var ti,Q_=(ti=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},k(ti,"TreemapValidator"),ti),tg={parser:{TokenBuilder:k(()=>new X_,"TokenBuilder"),ValueConverter:k(()=>new Z_,"ValueConverter")},validation:{TreemapValidator:k(()=>new Q_,"TreemapValidator")}};function rg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),q_,tg);return e.ServiceRegistry.register(r),eg(r),{shared:e,Treemap:r}}k(rg,"createTreemapServices");var ri,eN=(ri=class extends bi{runCustomConverter(e,r,n){if(e.name.toUpperCase()==="LINK_LABEL")return r.substring(1).trim()}},k(ri,"WardleyValueConverter"),ri),ng={parser:{ValueConverter:k(()=>new eN,"ValueConverter")}};function ig(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),W_,ng);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}k(ig,"createWardleyServices");var ni,tN=(ni=class extends _r{constructor(){super(["gitGraph"])}},k(ni,"GitGraphTokenBuilder"),ni),ag={parser:{TokenBuilder:k(()=>new tN,"TokenBuilder"),ValueConverter:k(()=>new Zo,"ValueConverter")}};function sg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),F_,ag);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}k(sg,"createGitGraphServices");var ii,rN=(ii=class extends _r{constructor(){super(["info","showInfo"])}},k(ii,"InfoTokenBuilder"),ii),og={parser:{TokenBuilder:k(()=>new rN,"TokenBuilder"),ValueConverter:k(()=>new Zo,"ValueConverter")}};function lg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),G_,og);return e.ServiceRegistry.register(r),{shared:e,Info:r}}k(lg,"createInfoServices");var ai,nN=(ai=class extends _r{constructor(){super(["packet"])}},k(ai,"PacketTokenBuilder"),ai),ug={parser:{TokenBuilder:k(()=>new nN,"TokenBuilder"),ValueConverter:k(()=>new Zo,"ValueConverter")}};function cg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),z_,ug);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}k(cg,"createPacketServices");var si,iN=(si=class extends _r{constructor(){super(["pie","showData"])}},k(si,"PieTokenBuilder"),si),oi,aN=(oi=class extends bi{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},k(oi,"PieValueConverter"),oi),fg={parser:{TokenBuilder:k(()=>new iN,"TokenBuilder"),ValueConverter:k(()=>new aN,"ValueConverter")}};function dg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),U_,fg);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}k(dg,"createPieServices");var li,sN=(li=class extends bi{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return r?.length||0;if(e.name==="STRING2")return r.substring(1,r.length-1)}},k(li,"TreeViewValueConverter"),li),ui,oN=(ui=class extends _r{constructor(){super(["treeView-beta"])}},k(ui,"TreeViewTokenBuilder"),ui),pg={parser:{TokenBuilder:k(()=>new oN,"TokenBuilder"),ValueConverter:k(()=>new sN,"ValueConverter")}};function hg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),B_,pg);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}k(hg,"createTreeViewServices");var ci,lN=(ci=class extends _r{constructor(){super(["architecture"])}},k(ci,"ArchitectureTokenBuilder"),ci),fi,uN=(fi=class extends bi{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},k(fi,"ArchitectureValueConverter"),fi),mg={parser:{TokenBuilder:k(()=>new lN,"TokenBuilder"),ValueConverter:k(()=>new uN,"ValueConverter")}};function gg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),M_,mg);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}k(gg,"createArchitectureServices");var di,cN=(di=class extends _r{constructor(){super(["radar-beta"])}},k(di,"RadarTokenBuilder"),di),yg={parser:{TokenBuilder:k(()=>new cN,"TokenBuilder"),ValueConverter:k(()=>new Zo,"ValueConverter")}};function Tg(t=Jt){const e=Oe(Xt(t),br),r=Oe(Yt({shared:e}),j_,yg);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}k(Tg,"createRadarServices");var Nt={},fN={info:k(async()=>{const{createInfoServices:t}=await er(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>hN);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;Nt.info=e},"info"),packet:k(async()=>{const{createPacketServices:t}=await er(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>mN);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;Nt.packet=e},"packet"),pie:k(async()=>{const{createPieServices:t}=await er(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>gN);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;Nt.pie=e},"pie"),treeView:k(async()=>{const{createTreeViewServices:t}=await er(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>yN);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;Nt.treeView=e},"treeView"),architecture:k(async()=>{const{createArchitectureServices:t}=await er(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>TN);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;Nt.architecture=e},"architecture"),gitGraph:k(async()=>{const{createGitGraphServices:t}=await er(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>RN);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;Nt.gitGraph=e},"gitGraph"),radar:k(async()=>{const{createRadarServices:t}=await er(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>vN);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;Nt.radar=e},"radar"),treemap:k(async()=>{const{createTreemapServices:t}=await er(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>$N);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;Nt.treemap=e},"treemap"),wardley:k(async()=>{const{createWardleyServices:t}=await er(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>AN);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;Nt.wardley=e},"wardley")};async function dN(t,e){const r=fN[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Nt[t]||await r();const i=Nt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new pN(i);return i.value}k(dN,"parse");var pi,pN=(pi=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(`
161
+ `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(`
162
+ `);super(`Parsing failed: ${r} ${n}`),this.result=e}},k(pi,"MermaidParseError"),pi);const hN=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:og,createInfoServices:lg},Symbol.toStringTag,{value:"Module"})),mN=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:ug,createPacketServices:cg},Symbol.toStringTag,{value:"Module"})),gN=Object.freeze(Object.defineProperty({__proto__:null,PieModule:fg,createPieServices:dg},Symbol.toStringTag,{value:"Module"})),yN=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:pg,createTreeViewServices:hg},Symbol.toStringTag,{value:"Module"})),TN=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:mg,createArchitectureServices:gg},Symbol.toStringTag,{value:"Module"})),RN=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:ag,createGitGraphServices:sg},Symbol.toStringTag,{value:"Module"})),vN=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:yg,createRadarServices:Tg},Symbol.toStringTag,{value:"Module"})),$N=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:tg,createTreemapServices:rg},Symbol.toStringTag,{value:"Module"})),AN=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:ng,createWardleyServices:ig},Symbol.toStringTag,{value:"Module"}));export{dN as p};