orbitchat 3.7.1 → 3.7.2

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 (96) hide show
  1. package/dist/assets/ChartRenderer-D0AWpQRu.js +78 -0
  2. package/dist/assets/MermaidRenderer-BbPt4jtD.js +313 -0
  3. package/dist/assets/MusicRenderer-Brav4mm2.js +18 -0
  4. package/dist/assets/SVGRenderer-Ct8XMIcE.js +6 -0
  5. package/dist/assets/_baseUniq-mJPwzBOI.js +1 -0
  6. package/dist/assets/architectureDiagram-Q4EWVU46-CZuqFwTR.js +36 -0
  7. package/dist/assets/{blockDiagram-WCTKOSBZ-OMFbT-zL.js → blockDiagram-DXYQGD6D-DaC_VKzI.js} +6 -6
  8. package/dist/assets/c4Diagram-AHTNJAMY-CJePgNba.js +10 -0
  9. package/dist/assets/channel-CX3imDlU.js +1 -0
  10. package/dist/assets/{chunk-4BX2VUAB-Buu8ixXv.js → chunk-4BX2VUAB-LD_Hd6_z.js} +1 -1
  11. package/dist/assets/chunk-4TB4RGXK-BGO2PowE.js +206 -0
  12. package/dist/assets/{chunk-55IACEB6-DbeU332v.js → chunk-55IACEB6-0YS5Dbzd.js} +1 -1
  13. package/dist/assets/{chunk-KX2RTZJC-B5ikf2wh.js → chunk-EDXVE4YY-BaUXHlqA.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-BAD8J6zQ.js → chunk-FMBD7UC4-CXSeyusx.js} +1 -1
  15. package/dist/assets/chunk-OYMX7WX6-BJqKAaXp.js +231 -0
  16. package/dist/assets/{chunk-QZHKN3VN-BxbbMXal.js → chunk-QZHKN3VN-3-SvIa7S.js} +1 -1
  17. package/dist/assets/{chunk-JSJVCQXG-CaklpesZ.js → chunk-YZCP3GAM-Cm0anOcW.js} +1 -1
  18. package/dist/assets/classDiagram-6PBFFD2Q-o2YNBl67.js +1 -0
  19. package/dist/assets/classDiagram-v2-HSJHXN6E-o2YNBl67.js +1 -0
  20. package/dist/assets/clone-EE9raDlI.js +1 -0
  21. package/dist/assets/{cose-bilkent-S5V4N54A-DawRCVCV.js → cose-bilkent-S5V4N54A-4fUnkROm.js} +1 -1
  22. package/dist/assets/{cytoscape.esm-CyJtwmzi.js → cytoscape.esm-BiciSPf8.js} +4 -4
  23. package/dist/assets/dagre-KV5264BT-DUWGBIgm.js +4 -0
  24. package/dist/assets/diagram-5BDNPKRD-C9_Rqs6o.js +10 -0
  25. package/dist/assets/diagram-G4DWMVQ6-DJgL3XtB.js +24 -0
  26. package/dist/assets/diagram-MMDJMWI5-DJyz-Y76.js +43 -0
  27. package/dist/assets/diagram-TYMM5635-DRXfDOY1.js +24 -0
  28. package/dist/assets/erDiagram-SMLLAGMA-ltzBzX-J.js +85 -0
  29. package/dist/assets/flowDiagram-DWJPFMVM-CuSvL41f.js +162 -0
  30. package/dist/assets/ganttDiagram-T4ZO3ILL-D695mEJV.js +292 -0
  31. package/dist/assets/gitGraphDiagram-UUTBAWPF-BaBzMGpC.js +106 -0
  32. package/dist/assets/graph-CXZA4XaC.js +1 -0
  33. package/dist/assets/{index-Bb88CEAr.js → index-B8QgKg2_.js} +40 -40
  34. package/dist/assets/index-BO4rLId3.css +1 -0
  35. package/dist/assets/index-C1TQE8f6.js +615 -0
  36. package/dist/assets/infoDiagram-42DDH7IO-C554WkLo.js +2 -0
  37. package/dist/assets/{ishikawaDiagram-PHBUUO56-Du0o-6Uv.js → ishikawaDiagram-UXIWVN3A-D1ixBTTi.js} +2 -2
  38. package/dist/assets/journeyDiagram-VCZTEJTY-Rk6UiBUm.js +139 -0
  39. package/dist/assets/{kanban-definition-K7BYSVSG-CAXJ4k6J.js → kanban-definition-6JOO6SKY-BLc8Saxe.js} +6 -6
  40. package/dist/assets/layout-a0Clawsj.js +1 -0
  41. package/dist/assets/min-B5vChzpW.js +1 -0
  42. package/dist/assets/mindmap-definition-QFDTVHPH-CGYrptTT.js +96 -0
  43. package/dist/assets/pieDiagram-DEJITSTG-DwV0tEAW.js +30 -0
  44. package/dist/assets/purify.es-BlZidd4c.js +2 -0
  45. package/dist/assets/{quadrantDiagram-337W2JSQ-DesNYo4P.js → quadrantDiagram-34T5L4WZ-DvHIwgsa.js} +1 -1
  46. package/dist/assets/requirementDiagram-MS252O5E-DgSgWjaP.js +84 -0
  47. package/dist/assets/{sankeyDiagram-WA2Y5GQK-BKfpwmcQ.js → sankeyDiagram-XADWPNL6-k3HRQmAt.js} +1 -1
  48. package/dist/assets/sequenceDiagram-FGHM5R23-BLd2_BAi.js +157 -0
  49. package/dist/assets/stateDiagram-FHFEXIEX-DDDK8elV.js +1 -0
  50. package/dist/assets/stateDiagram-v2-QKLJ7IA2-Dts2YAxm.js +1 -0
  51. package/dist/assets/timeline-definition-GMOUNBTQ-Dj2EEEZe.js +120 -0
  52. package/dist/assets/{vennDiagram-LZ73GAT5-BU7WoILH.js → vennDiagram-DHZGUBPP-C8NSdF_G.js} +5 -5
  53. package/dist/assets/wardley-RL74JXVD-BQtHLuaO.js +162 -0
  54. package/dist/assets/wardleyDiagram-NUSXRM2D-Dt3gXCVo.js +20 -0
  55. package/dist/assets/xychartDiagram-5P7HB3ND-BKUiyZNZ.js +7 -0
  56. package/dist/index.html +2 -2
  57. package/dist/sitemap.xml +8 -20
  58. package/package.json +2 -2
  59. package/dist/assets/ChartRenderer-SjxcbqcB.js +0 -78
  60. package/dist/assets/MermaidRenderer-CJ6oqOaF.js +0 -259
  61. package/dist/assets/MusicRenderer-CGcrvGbN.js +0 -18
  62. package/dist/assets/SVGRenderer-DMO1XuDI.js +0 -6
  63. package/dist/assets/_basePickBy-D6kOdKxs.js +0 -1
  64. package/dist/assets/_baseUniq-DJdp6dOC.js +0 -1
  65. package/dist/assets/architectureDiagram-2XIMDMQ5-DqNjzGsn.js +0 -36
  66. package/dist/assets/c4Diagram-IC4MRINW-B9v6F-c_.js +0 -10
  67. package/dist/assets/channel-DwUfMnky.js +0 -1
  68. package/dist/assets/chunk-NQ4KR5QH-BcbMd4mm.js +0 -220
  69. package/dist/assets/chunk-WL4C6EOR-DElQSHwB.js +0 -189
  70. package/dist/assets/classDiagram-VBA2DB6C-C_Apy6at.js +0 -1
  71. package/dist/assets/classDiagram-v2-RAHNMMFH-C_Apy6at.js +0 -1
  72. package/dist/assets/clone-CEphPa77.js +0 -1
  73. package/dist/assets/dagre-KLK3FWXG-BmMlFeE2.js +0 -4
  74. package/dist/assets/diagram-E7M64L7V-Cs74MQEF.js +0 -24
  75. package/dist/assets/diagram-IFDJBPK2-9QV5ymek.js +0 -43
  76. package/dist/assets/diagram-P4PSJMXO-BL2tj5xx.js +0 -24
  77. package/dist/assets/erDiagram-INFDFZHY-BQv7meJG.js +0 -70
  78. package/dist/assets/flowDiagram-PKNHOUZH-DCqIcqOS.js +0 -162
  79. package/dist/assets/ganttDiagram-A5KZAMGK-CncKmf1H.js +0 -292
  80. package/dist/assets/gitGraphDiagram-K3NZZRJ6-BiNgBgUL.js +0 -65
  81. package/dist/assets/graph-DPr6Bckz.js +0 -1
  82. package/dist/assets/index-I5aUUwG5.js +0 -618
  83. package/dist/assets/index-Iwp3pMca.css +0 -1
  84. package/dist/assets/infoDiagram-LFFYTUFH-BFYuft6E.js +0 -2
  85. package/dist/assets/journeyDiagram-4ABVD52K-Bn0-BkAI.js +0 -139
  86. package/dist/assets/layout--T9Dyzc0.js +0 -1
  87. package/dist/assets/mindmap-definition-YRQLILUH-BNy8j9xK.js +0 -68
  88. package/dist/assets/pieDiagram-SKSYHLDU-DSj-XSAz.js +0 -30
  89. package/dist/assets/purify.es-Bc-0F0ao.js +0 -2
  90. package/dist/assets/requirementDiagram-Z7DCOOCP-Bar-SpuL.js +0 -73
  91. package/dist/assets/sequenceDiagram-2WXFIKYE-DcwF2Fu7.js +0 -145
  92. package/dist/assets/stateDiagram-RAJIS63D-B9eynNzx.js +0 -1
  93. package/dist/assets/stateDiagram-v2-FVOUBMTO-IaaFnyD6.js +0 -1
  94. package/dist/assets/timeline-definition-YZTLITO2-tQ5jILjS.js +0 -61
  95. package/dist/assets/treemap-KZPCXAKY-D7P8fXnT.js +0 -162
  96. package/dist/assets/xychartDiagram-JWTSCODW-99qUfPL4.js +0 -7
@@ -0,0 +1,162 @@
1
+ var Np=Object.defineProperty;var _p=(t,e,r)=>e in t?Np(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Qt=(t,e,r)=>_p(t,typeof e!="symbol"?e+"":e,r);import{c as rt,b as Ip,_ as _t}from"./index-C1TQE8f6.js";import{m as Gt,f as Pp,d as Op}from"./min-B5vChzpW.js";import{b as Lp,l as xp,c as Dp,m as Mp,r as Gc,n as Xs}from"./_baseUniq-mJPwzBOI.js";import{aP as Fp}from"./MermaidRenderer-BbPt4jtD.js";function Gp(t,e){return Lp(Gt(t,e))}function jp(t,e){return t&&t.length?xp(t,Dp(e)):[]}function Fe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ft(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function tr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function zp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ii(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class vd{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.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 Fe(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 _i(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Ed(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Ad(t){return _i(t)&&typeof t.fullText=="string"}class Le{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 Le(()=>({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 Ye})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Up(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 Le(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ye:{done:!1,value:e(i)}})}filter(e){return new Le(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ye})}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 Le(()=>({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(Xa(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ye})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Le(()=>({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(Xa(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ye})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Le(()=>{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 Le(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ye:this.nextFn(r.state)))}distinct(e){return new Le(()=>({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 Ye})}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 Up(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Xa(t){return!!t&&typeof t[Symbol.iterator]=="function"}const $d=new Le(()=>{},()=>Ye),Ye=Object.freeze({done:!0,value:void 0});function ue(...t){if(t.length===1){const e=t[0];if(e instanceof Le)return e;if(Xa(e))return new Le(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Le(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ye)}return t.length>1?new Le(()=>({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++];Xa(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ye}):$d}class mc extends Le{constructor(e,r,n){super(()=>({iterators:n!=null&&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 Ye})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Co;(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})(Co||(Co={}));function So(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Fe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&So(i,e))}):Fe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&So(n,e)))}function Cs(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function jt(t){const r=La(t).$document;if(!r)throw new Error("AST node has no document.");return r}function La(t){for(;t.$container;)t=t.$container;return t}function jc(t){return ft(t)?t.ref?[t.ref]:[]:tr(t)?t.items.map(e=>e.ref):[]}function gc(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Le(()=>({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(Fe(a)){if(n.keyIndex++,zc(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(Fe(o)&&zc(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ye})}function Wi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e))}function zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e),{includeRoot:!0})}function zc(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?fm(r,e):!1}function Ya(t){return new Le(()=>({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(ft(n)||tr(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(ft(a)||tr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ye})}function Bp(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]=Cd(i.defaultValue))}function Cd(t){return Array.isArray(t)?[...t.map(Cd)]:t}const Xe={$type:"AbstractElement",cardinality:"cardinality"};function Wp(t){return Y.isInstance(t,Xe.$type)}const xa={$type:"AbstractParserRule"};function Ki(t){return Y.isInstance(t,xa.$type)}const ga={$type:"AbstractRule"},lt={$type:"AbstractType"},Rr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ss(t){return Y.isInstance(t,Rr.$type)}const Da={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Sd(t){return Y.isInstance(t,Da.$type)}const Uc={$type:"ArrayLiteral",elements:"elements"},Bc={$type:"ArrayType",elementType:"elementType"},vr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function kr(t){return Y.isInstance(t,vr.$type)}const wo={$type:"BooleanLiteral",true:"true"};function Kp(t){return Y.isInstance(t,wo.$type)}const Er={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Vp(t){return Y.isInstance(t,Er.$type)}const Mr={$type:"Condition"},Ma={$type:"Conjunction",left:"left",right:"right"};function qp(t){return Y.isInstance(t,Ma.$type)}const Ar={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function ws(t){return Y.isInstance(t,Ar.$type)}const Fa={$type:"Disjunction",left:"left",right:"right"};function Hp(t){return Y.isInstance(t,Fa.$type)}const ko={$type:"EndOfFile",cardinality:"cardinality"};function Xp(t){return Y.isInstance(t,ko.$type)}const pr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Wc={$type:"GrammarImport",path:"path"},Br={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function yc(t){return Y.isInstance(t,Br.$type)}const bo={$type:"InferredType",name:"name"};function wd(t){return Y.isInstance(t,bo.$type)}const Lt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ja(t){return Y.isInstance(t,Lt.$type)}const Ys={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Kc={$type:"InfixRuleOperators",precedences:"precedences"},Ri={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Yp(t){return Y.isInstance(t,Ri.$type)}const vi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function br(t){return Y.isInstance(t,vi.$type)}const ya={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Wr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Jp(t){return Y.isInstance(t,Wr.$type)}const No={$type:"Negation",value:"value"};function Zp(t){return Y.isInstance(t,No.$type)}const Vc={$type:"NumberLiteral",value:"value"},Ta={$type:"Parameter",name:"name"},_o={$type:"ParameterReference",parameter:"parameter"};function Qp(t){return Y.isInstance(t,_o.$type)}const gt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Kt(t){return Y.isInstance(t,gt.$type)}const Js={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Kr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function em(t){return Y.isInstance(t,Kr.$type)}const Io={$type:"ReturnType",name:"name"};function tm(t){return Y.isInstance(t,Io.$type)}const Vr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Nr(t){return Y.isInstance(t,Vr.$type)}const Ei={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rm(t){return Y.isInstance(t,Ei.$type)}const qc={$type:"StringLiteral",value:"value"},qr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function nm(t){return Y.isInstance(t,qr.$type)}const et={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Hr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function im(t){return Y.isInstance(t,Hr.$type)}const er={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Vt(t){return Y.isInstance(t,er.$type)}const Xr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function am(t){return Y.isInstance(t,Xr.$type)}const Ga={$type:"Type",name:"name",type:"type"};function sm(t){return Y.isInstance(t,Ga.$type)}const ai={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},si={$type:"TypeDefinition"},Hc={$type:"UnionType",types:"types"},ja={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function kd(t){return Y.isInstance(t,ja.$type)}const Yr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function om(t){return Y.isInstance(t,Yr.$type)}const oi={$type:"ValueLiteral"},Ai={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lm(t){return Y.isInstance(t,Ai.$type)}class bd extends vd{constructor(){super(...arguments),this.types={AbstractElement:{name:Xe.$type,properties:{cardinality:{name:Xe.cardinality}},superTypes:[]},AbstractParserRule:{name:xa.$type,properties:{},superTypes:[ga.$type,lt.$type]},AbstractRule:{name:ga.$type,properties:{},superTypes:[]},AbstractType:{name:lt.$type,properties:{},superTypes:[]},Action:{name:Rr.$type,properties:{cardinality:{name:Rr.cardinality},feature:{name:Rr.feature},inferredType:{name:Rr.inferredType},operator:{name:Rr.operator},type:{name:Rr.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Alternatives:{name:Da.$type,properties:{cardinality:{name:Da.cardinality},elements:{name:Da.elements,defaultValue:[]}},superTypes:[Xe.$type]},ArrayLiteral:{name:Uc.$type,properties:{elements:{name:Uc.elements,defaultValue:[]}},superTypes:[oi.$type]},ArrayType:{name:Bc.$type,properties:{elementType:{name:Bc.elementType}},superTypes:[si.$type]},Assignment:{name:vr.$type,properties:{cardinality:{name:vr.cardinality},feature:{name:vr.feature},operator:{name:vr.operator},predicate:{name:vr.predicate},terminal:{name:vr.terminal}},superTypes:[Xe.$type]},BooleanLiteral:{name:wo.$type,properties:{true:{name:wo.true,defaultValue:!1}},superTypes:[Mr.$type,oi.$type]},CharacterRange:{name:Er.$type,properties:{cardinality:{name:Er.cardinality},left:{name:Er.left},lookahead:{name:Er.lookahead},parenthesized:{name:Er.parenthesized,defaultValue:!1},right:{name:Er.right}},superTypes:[et.$type]},Condition:{name:Mr.$type,properties:{},superTypes:[]},Conjunction:{name:Ma.$type,properties:{left:{name:Ma.left},right:{name:Ma.right}},superTypes:[Mr.$type]},CrossReference:{name:Ar.$type,properties:{cardinality:{name:Ar.cardinality},deprecatedSyntax:{name:Ar.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ar.isMulti,defaultValue:!1},terminal:{name:Ar.terminal},type:{name:Ar.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Disjunction:{name:Fa.$type,properties:{left:{name:Fa.left},right:{name:Fa.right}},superTypes:[Mr.$type]},EndOfFile:{name:ko.$type,properties:{cardinality:{name:ko.cardinality}},superTypes:[Xe.$type]},Grammar:{name:pr.$type,properties:{imports:{name:pr.imports,defaultValue:[]},interfaces:{name:pr.interfaces,defaultValue:[]},isDeclared:{name:pr.isDeclared,defaultValue:!1},name:{name:pr.name},rules:{name:pr.rules,defaultValue:[]},types:{name:pr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Wc.$type,properties:{path:{name:Wc.path}},superTypes:[]},Group:{name:Br.$type,properties:{cardinality:{name:Br.cardinality},elements:{name:Br.elements,defaultValue:[]},guardCondition:{name:Br.guardCondition},predicate:{name:Br.predicate}},superTypes:[Xe.$type]},InferredType:{name:bo.$type,properties:{name:{name:bo.name}},superTypes:[lt.$type]},InfixRule:{name:Lt.$type,properties:{call:{name:Lt.call},dataType:{name:Lt.dataType},inferredType:{name:Lt.inferredType},name:{name:Lt.name},operators:{name:Lt.operators},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:lt.$type}},superTypes:[xa.$type]},InfixRuleOperatorList:{name:Ys.$type,properties:{associativity:{name:Ys.associativity},operators:{name:Ys.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Kc.$type,properties:{precedences:{name:Kc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Ri.$type,properties:{attributes:{name:Ri.attributes,defaultValue:[]},name:{name:Ri.name},superTypes:{name:Ri.superTypes,defaultValue:[],referenceType:lt.$type}},superTypes:[lt.$type]},Keyword:{name:vi.$type,properties:{cardinality:{name:vi.cardinality},predicate:{name:vi.predicate},value:{name:vi.value}},superTypes:[Xe.$type]},NamedArgument:{name:ya.$type,properties:{calledByName:{name:ya.calledByName,defaultValue:!1},parameter:{name:ya.parameter,referenceType:Ta.$type},value:{name:ya.value}},superTypes:[]},NegatedToken:{name:Wr.$type,properties:{cardinality:{name:Wr.cardinality},lookahead:{name:Wr.lookahead},parenthesized:{name:Wr.parenthesized,defaultValue:!1},terminal:{name:Wr.terminal}},superTypes:[et.$type]},Negation:{name:No.$type,properties:{value:{name:No.value}},superTypes:[Mr.$type]},NumberLiteral:{name:Vc.$type,properties:{value:{name:Vc.value}},superTypes:[oi.$type]},Parameter:{name:Ta.$type,properties:{name:{name:Ta.name}},superTypes:[]},ParameterReference:{name:_o.$type,properties:{parameter:{name:_o.parameter,referenceType:Ta.$type}},superTypes:[Mr.$type]},ParserRule:{name:gt.$type,properties:{dataType:{name:gt.dataType},definition:{name:gt.definition},entry:{name:gt.entry,defaultValue:!1},fragment:{name:gt.fragment,defaultValue:!1},inferredType:{name:gt.inferredType},name:{name:gt.name},parameters:{name:gt.parameters,defaultValue:[]},returnType:{name:gt.returnType,referenceType:lt.$type}},superTypes:[xa.$type]},ReferenceType:{name:Js.$type,properties:{isMulti:{name:Js.isMulti,defaultValue:!1},referenceType:{name:Js.referenceType}},superTypes:[si.$type]},RegexToken:{name:Kr.$type,properties:{cardinality:{name:Kr.cardinality},lookahead:{name:Kr.lookahead},parenthesized:{name:Kr.parenthesized,defaultValue:!1},regex:{name:Kr.regex}},superTypes:[et.$type]},ReturnType:{name:Io.$type,properties:{name:{name:Io.name}},superTypes:[]},RuleCall:{name:Vr.$type,properties:{arguments:{name:Vr.arguments,defaultValue:[]},cardinality:{name:Vr.cardinality},predicate:{name:Vr.predicate},rule:{name:Vr.rule,referenceType:ga.$type}},superTypes:[Xe.$type]},SimpleType:{name:Ei.$type,properties:{primitiveType:{name:Ei.primitiveType},stringType:{name:Ei.stringType},typeRef:{name:Ei.typeRef,referenceType:lt.$type}},superTypes:[si.$type]},StringLiteral:{name:qc.$type,properties:{value:{name:qc.value}},superTypes:[oi.$type]},TerminalAlternatives:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},elements:{name:qr.elements,defaultValue:[]},lookahead:{name:qr.lookahead},parenthesized:{name:qr.parenthesized,defaultValue:!1}},superTypes:[et.$type]},TerminalElement:{name:et.$type,properties:{cardinality:{name:et.cardinality},lookahead:{name:et.lookahead},parenthesized:{name:et.parenthesized,defaultValue:!1}},superTypes:[Xe.$type]},TerminalGroup:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality},elements:{name:Hr.elements,defaultValue:[]},lookahead:{name:Hr.lookahead},parenthesized:{name:Hr.parenthesized,defaultValue:!1}},superTypes:[et.$type]},TerminalRule:{name:er.$type,properties:{definition:{name:er.definition},fragment:{name:er.fragment,defaultValue:!1},hidden:{name:er.hidden,defaultValue:!1},name:{name:er.name},type:{name:er.type}},superTypes:[ga.$type]},TerminalRuleCall:{name:Xr.$type,properties:{cardinality:{name:Xr.cardinality},lookahead:{name:Xr.lookahead},parenthesized:{name:Xr.parenthesized,defaultValue:!1},rule:{name:Xr.rule,referenceType:er.$type}},superTypes:[et.$type]},Type:{name:Ga.$type,properties:{name:{name:Ga.name},type:{name:Ga.type}},superTypes:[lt.$type]},TypeAttribute:{name:ai.$type,properties:{defaultValue:{name:ai.defaultValue},isOptional:{name:ai.isOptional,defaultValue:!1},name:{name:ai.name},type:{name:ai.type}},superTypes:[]},TypeDefinition:{name:si.$type,properties:{},superTypes:[]},UnionType:{name:Hc.$type,properties:{types:{name:Hc.types,defaultValue:[]}},superTypes:[si.$type]},UnorderedGroup:{name:ja.$type,properties:{cardinality:{name:ja.cardinality},elements:{name:ja.elements,defaultValue:[]}},superTypes:[Xe.$type]},UntilToken:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality},lookahead:{name:Yr.lookahead},parenthesized:{name:Yr.parenthesized,defaultValue:!1},terminal:{name:Yr.terminal}},superTypes:[et.$type]},ValueLiteral:{name:oi.$type,properties:{},superTypes:[]},Wildcard:{name:Ai.$type,properties:{cardinality:{name:Ai.cardinality},lookahead:{name:Ai.lookahead},parenthesized:{name:Ai.parenthesized,defaultValue:!1}},superTypes:[et.$type]}}}}const Y=new bd;function Po(t){return new mc(t,e=>_i(e)?e.content:[],{includeRoot:!0})}function cm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Oo(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Za(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var Mt;(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"})(Mt||(Mt={}));function um(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Mt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Mt.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?Mt.Inside:r?Mt.OverlapBack:n?Mt.OverlapFront:Mt.Outside}function fm(t,e){return um(t,e)>Mt.After}const dm=/^[\w\p{L}]$/u;function hm(t,e){if(t){const r=pm(t,!0);if(r&&Xc(r,e))return r;if(Ad(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Xc(a,e))return a}}}}function Xc(t,e){return Ed(t)&&e.includes(t.tokenType.name)}function pm(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 Nd extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function Vi(t,e="Error: Got unexpected value."){throw new Error(e)}function U(t){return t.charCodeAt(0)}function Zs(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function li(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Fr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function mm(){throw Error("Internal Error - Should never get here!")}function Yc(t){return t.type==="Character"}const Qa=[];for(let t=U("0");t<=U("9");t++)Qa.push(t);const es=[U("_")].concat(Qa);for(let t=U("a");t<=U("z");t++)es.push(t);for(let t=U("A");t<=U("Z");t++)es.push(t);const Jc=[U(" "),U("\f"),U(`
2
+ `),U("\r"),U(" "),U("\v"),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U("\u2028"),U("\u2029"),U(" "),U(" "),U(" "),U("\uFEFF")],gm=/[0-9a-fA-F]/,Ra=/[0-9]/,ym=/[1-9]/;class _d{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":li(n,"global");break;case"i":li(n,"ignoreCase");break;case"m":li(n,"multiLine");break;case"u":li(n,"unicode");break;case"y":li(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}}Fr(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return mm()}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;Fr(r);break}if(!(e===!0&&r===void 0)&&Fr(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()),Fr(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[U(`
3
+ `),U("\r"),U("\u2028"),U("\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=Qa;break;case"D":e=Qa,r=!0;break;case"s":e=Jc;break;case"S":e=Jc,r=!0;break;case"w":e=es;break;case"W":e=es,r=!0;break}if(Fr(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=U("\f");break;case"n":e=U(`
4
+ `);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(Fr(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:U("\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:U(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:U(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,Yc(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,Yc(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else Zs(n.value,e),e.push(U("-")),Zs(i.value,e)}else Zs(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:U("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}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(ym.test(e)===!1)throw Error("Expecting a positive integer");for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ra.test(e)===!1)throw Error("Expecting an integer");for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){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:U(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Ra.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
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(gm.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 ks{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 Tm=/\r?\n/gm,Rm=new _d;class vm extends ks{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=bs(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 Qs=new vm;function Em(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Qs.reset(t),Qs.visit(Rm.pattern(t)),Qs.multiline}catch{return!1}}const Am=`\f
12
+ \r \v              \u2028\u2029   \uFEFF`.split("");function Id(t){const e=typeof t=="string"?new RegExp(t):t;return Am.some(r=>e.test(r))}function bs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $m(t,e){const r=Cm(t),n=e.match(r);return!!n&&n[0].length>0}function Cm(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(c){a+=r.substr(n,c),n+=c}function l(c){a+="(?:"+r.substr(n,c)+"|$)",n+=c}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 Sm(t){return t.rules.find(e=>Kt(e)&&e.entry)}function wm(t){return t.rules.filter(e=>Vt(e)&&e.hidden)}function Pd(t,e){const r=new Set,n=Sm(t);if(!n)return new Set(t.rules);const i=[n].concat(wm(t));for(const s of i)Od(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Vt(s)&&s.hidden)&&a.add(s);return a}function Od(t,e,r){e.add(t.name),Wi(t).forEach(n=>{if(Nr(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&Od(i,e,r)}})}function km(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=xd(t.type.ref);return e==null?void 0:e.terminal}}function bm(t){return t.hidden&&!Id(Rc(t))}function Nm(t,e){return!t||!e?[]:Tc(t,e,t.astNode,!0)}function Ld(t,e,r){if(!t||!e)return;const n=Tc(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 Tc(t,e,r,n){if(!n){const i=Cs(t.grammarSource,kr);if(i&&i.feature===e)return[t]}return _i(t)&&t.astNode===r?t.content.flatMap(i=>Tc(i,e,r,!1)):[]}function _m(t,e,r){if(!t)return;const n=Im(t,e,t==null?void 0: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 Im(t,e,r){if(t.astNode!==r)return[];if(br(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Po(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?br(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Pm(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=Cs(t.grammarSource,kr);if(n)return n;t=t.container}}function xd(t){let e=t;return wd(e)&&(Ss(e.$container)?e=e.$container.$container:Ki(e.$container)?e=e.$container:Vi(e.$container)),Dd(t,e,new Map)}function Dd(t,e,r){var i;function n(a,s){let o;return Cs(a,kr)||(o=Dd(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of Wi(e)){if(kr(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Nr(a)&&Kt(a.rule.ref))return n(a,a.rule.ref);if(rm(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}function Md(t){return Fd(t,new Set)}function Fd(t,e){if(e.has(t))return!0;e.add(t);for(const r of Wi(t))if(Nr(r)){if(!r.rule.ref||Kt(r.rule.ref)&&!Fd(r.rule.ref,e)||Ja(r.rule.ref))return!1}else{if(kr(r))return!1;if(Ss(r))return!1}return!!t.definition}function Gd(t){if(!Vt(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 Ii(t){if(Ki(t))return Kt(t)&&Md(t)?t.name:Gd(t)??t.name;if(Yp(t)||sm(t)||tm(t))return t.name;if(Ss(t)){const e=Om(t);if(e)return e}else if(wd(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Om(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Ii(t.type.ref)}function Lm(t){var e;return Vt(t)?((e=t.type)==null?void 0:e.name)??"string":Gd(t)??t.name}function Rc(t){const e={s:!1,i:!1,u:!1},r=Un(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const vc=/[\s\S]/.source;function Un(t,e){var r;if(nm(t))return xm(t);if(im(t))return Dm(t);if(Vp(t))return Gm(t);if(am(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Ut(Un(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Jp(t))return Fm(t);if(om(t))return Mm(t);if(em(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Ut(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(lm(t))return Ut(vc,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}function xm(t){return Ut(t.elements.map(e=>Un(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Dm(t){return Ut(t.elements.map(e=>Un(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Mm(t){return Ut(`${vc}*?${Un(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Fm(t){return Ut(`(?!${Un(t.terminal)})${vc}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Gm(t){return t.right?Ut(`[${eo(t.left)}-${eo(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Ut(eo(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function eo(t){return bs(t.value)}function Ut(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function jm(t){const e=[],r=t.Grammar;for(const n of r.rules)Vt(n)&&bm(n)&&Em(Rc(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:dm}}function Lo(t){console&&console.error&&console.error(`Error: ${t}`)}function jd(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function zd(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Ud(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function zm(t){return Um(t)?t.LABEL:t.name}function Um(t){return typeof t.LABEL=="string"&&t.LABEL!==""}class $t{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(r=>{r.accept(e)})}}class ze extends $t{constructor(e){super([]),this.idx=1,Object.assign(this,Ct(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Bn extends $t{constructor(e){super(e.definition),this.orgText="",Object.assign(this,Ct(e))}}class Ke extends $t{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,Ct(e))}}let De=class extends $t{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Ct(e))}};class Ze extends $t{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Ct(e))}}class Qe extends $t{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Ct(e))}}class Te extends $t{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Ct(e))}}class Ve extends $t{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Ct(e))}}class qe extends $t{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,Ct(e))}}class se{constructor(e){this.idx=1,Object.assign(this,Ct(e))}accept(e){e.visit(this)}}function Bm(t){return t.map(za)}function za(t){function e(r){return r.map(za)}if(t instanceof ze){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof Ke)return{type:"Alternative",definition:e(t.definition)};if(t instanceof De)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ze)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Qe)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:za(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ve)return{type:"RepetitionWithSeparator",idx:t.idx,separator:za(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Te)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof qe)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof se){const r={type:"Terminal",name:t.terminalType.name,label:zm(t.terminalType),idx:t.idx};typeof t.label=="string"&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=n instanceof RegExp?n.source:n),r}else{if(t instanceof Bn)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function Ct(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}class Wn{visit(e){const r=e;switch(r.constructor){case ze:return this.visitNonTerminal(r);case Ke:return this.visitAlternative(r);case De:return this.visitOption(r);case Ze:return this.visitRepetitionMandatory(r);case Qe:return this.visitRepetitionMandatoryWithSeparator(r);case Ve:return this.visitRepetitionWithSeparator(r);case Te:return this.visitRepetition(r);case qe:return this.visitAlternation(r);case se:return this.visitTerminal(r);case Bn: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 Wm(t){return t instanceof Ke||t instanceof De||t instanceof Te||t instanceof Ze||t instanceof Qe||t instanceof Ve||t instanceof se||t instanceof Bn}function ts(t,e=[]){return t instanceof De||t instanceof Te||t instanceof Ve?!0:t instanceof qe?t.definition.some(n=>ts(n,e)):t instanceof ze&&e.includes(t)?!1:t instanceof $t?(t instanceof ze&&e.push(t),t.definition.every(n=>ts(n,e))):!1}function Km(t){return t instanceof qe}function yt(t){if(t instanceof ze)return"SUBRULE";if(t instanceof De)return"OPTION";if(t instanceof qe)return"OR";if(t instanceof Ze)return"AT_LEAST_ONE";if(t instanceof Qe)return"AT_LEAST_ONE_SEP";if(t instanceof Ve)return"MANY_SEP";if(t instanceof Te)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}class Ns{walk(e,r=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof ze)this.walkProdRef(n,a,r);else if(n instanceof se)this.walkTerminal(n,a,r);else if(n instanceof Ke)this.walkFlat(n,a,r);else if(n instanceof De)this.walkOption(n,a,r);else if(n instanceof Ze)this.walkAtLeastOne(n,a,r);else if(n instanceof Qe)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Ve)this.walkManySep(n,a,r);else if(n instanceof Te)this.walkMany(n,a,r);else if(n instanceof qe)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 De({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=Zc(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new De({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=Zc(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);e.definition.forEach(a=>{const s=new Ke({definition:[a]});this.walk(s,i)})}}function Zc(t,e,r){return[new De({definition:[new se({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function qi(t){if(t instanceof ze)return qi(t.referencedRule);if(t instanceof se)return Hm(t);if(Wm(t))return Vm(t);if(Km(t))return qm(t);throw Error("non exhaustive match")}function Vm(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=ts(a),e=e.concat(qi(a)),n=n+1,i=r.length>n;return[...new Set(e)]}function qm(t){const e=t.definition.map(r=>qi(r));return[...new Set(e.flat())]}function Hm(t){return[t.terminalType]}const Bd="_~IN~_";class Xm extends Ns{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=Jm(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ke({definition:a}),o=qi(s);this.follows[i]=o}}function Ym(t){const e={};return t.forEach(r=>{const n=new Xm(r).startWalking();Object.assign(e,n)}),e}function Jm(t,e){return t.name+e+Bd}let Ua={};const Zm=new _d;function _s(t){const e=t.toString();if(Ua.hasOwnProperty(e))return Ua[e];{const r=Zm.pattern(e);return Ua[e]=r,r}}function Qm(){Ua={}}const Wd="Complement Sets are not supported for first char optimization",rs=`Unable to use "first char" lexer optimizations:
13
+ `;function eg(t,e=!1){try{const r=_s(t);return xo(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Wd)e&&jd(`${rs} 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.`),Lo(`${rs}
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 xo(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)xo(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":va(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Wd);s.value.forEach(l=>{if(typeof l=="number")va(l,e,r);else{const c=l;if(r===!0)for(let u=c.from;u<=c.to;u++)va(u,e,r);else{for(let u=c.from;u<=c.to&&u<Ci;u++)va(u,e,r);if(c.to>=Ci){const u=c.from>=Ci?c.from:Ci,d=c.to,p=or(u),g=or(d);for(let A=p;A<=g;A++)e[A]=A}}}});break;case"Group":xo(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"&&Do(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function va(t,e,r){const n=or(t);e[n]=n,r===!0&&tg(t,e)}function tg(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=or(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=or(i.charCodeAt(0));e[a]=a}}}function Qc(t,e){return t.value.find(r=>{if(typeof r=="number")return e.includes(r);{const n=r;return e.find(i=>n.from<=i&&i<=n.to)!==void 0}})}function Do(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(Do):Do(t.value):!1}class rg extends ks{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?Qc(e,this.targetCharCodes)===void 0&&(this.found=!0):Qc(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ec(t,e){if(e instanceof RegExp){const r=_s(e),n=new rg(t);return n.visit(r),n.found}else{for(const r of e){const n=r.charCodeAt(0);if(t.includes(n))return!0}return!1}}const _r="PATTERN",$i="defaultMode",Ea="modes";function ng(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(L,N)=>N()},e);const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{kg()});let n;r("Reject Lexer.NA",()=>{n=t.filter(L=>L[_r]!==We.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=n.map(L=>{const N=L[_r];if(N instanceof RegExp){const x=N.source;return x.length===1&&x!=="^"&&x!=="$"&&x!=="."&&!N.ignoreCase?x:x.length===2&&x[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(x[1])?x[1]:eu(N)}else{if(typeof N=="function")return i=!0,{exec:N};if(typeof N=="object")return i=!0,N;if(typeof N=="string"){if(N.length===1)return N;{const x=N.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),q=new RegExp(x);return eu(q)}}else throw Error("non exhaustive match")}})});let s,o,l,c,u;r("misc mapping",()=>{s=n.map(L=>L.tokenTypeIdx),o=n.map(L=>{const N=L.GROUP;if(N!==We.SKIPPED){if(typeof N=="string")return N;if(N===void 0)return!1;throw Error("non exhaustive match")}}),l=n.map(L=>{const N=L.LONGER_ALT;if(N)return Array.isArray(N)?N.map(q=>n.indexOf(q)):[n.indexOf(N)]}),c=n.map(L=>L.PUSH_MODE),u=n.map(L=>Object.hasOwn(L,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const L=qd(e.lineTerminatorCharacters);d=n.map(N=>!1),e.positionTracking!=="onlyOffset"&&(d=n.map(N=>Object.hasOwn(N,"LINE_BREAKS")?!!N.LINE_BREAKS:Vd(N,L)===!1&&Ec(L,N.PATTERN)))});let p,g,A,w;r("Misc Mapping #2",()=>{p=n.map(Kd),g=a.map(Cg),A=n.reduce((L,N)=>{const x=N.GROUP;return typeof x=="string"&&x!==We.SKIPPED&&(L[x]=[]),L},{}),w=a.map((L,N)=>({pattern:a[N],longerAlt:l[N],canLineTerminator:d[N],isCustom:p[N],short:g[N],group:o[N],push:c[N],pop:u[N],tokenTypeIdx:s[N],tokenType:n[N]}))});let I=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=n.reduce((L,N,x)=>{if(typeof N.PATTERN=="string"){const q=N.PATTERN.charCodeAt(0),Z=or(q);to(L,Z,w[x])}else if(Array.isArray(N.START_CHARS_HINT)){let q;N.START_CHARS_HINT.forEach(Z=>{const Q=typeof Z=="string"?Z.charCodeAt(0):Z,he=or(Q);q!==he&&(q=he,to(L,he,w[x]))})}else if(N.PATTERN instanceof RegExp)if(N.PATTERN.unicode)I=!1,e.ensureOptimizations&&Lo(`${rs} Unable to analyze < ${N.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 q=eg(N.PATTERN,e.ensureOptimizations);q.length===0&&(I=!1),q.forEach(Z=>{to(L,Z,w[x])})}else e.ensureOptimizations&&Lo(`${rs} TokenType: <${N.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 L},[])}),{emptyGroups:A,patternIdxToConfig:w,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:I}}function ig(t,e){let r=[];const n=sg(t);r=r.concat(n.errors);const i=og(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(ag(a)),r=r.concat(mg(a)),r=r.concat(gg(a,e)),r=r.concat(yg(a)),r}function ag(t){let e=[];const r=t.filter(n=>n[_r]instanceof RegExp);return e=e.concat(cg(r)),e=e.concat(dg(r)),e=e.concat(hg(r)),e=e.concat(pg(r)),e=e.concat(ug(r)),e}function sg(t){const e=t.filter(i=>!Object.hasOwn(i,_r)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Re.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function og(t){const e=t.filter(i=>{const a=i[_r];return!(a instanceof RegExp)&&typeof a!="function"&&!Object.hasOwn(a,"exec")&&typeof a!="string"}),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Re.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}const lg=/[^\\][$]/;function cg(t){class e extends ks{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=_s(a),o=new e;return o.visit(s),o.found}catch{return lg.test(a.source)}}).map(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:Re.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function ug(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Re.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const fg=/[^\\[][\^]|^\^/;function dg(t){class e extends ks{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=_s(a),o=new e;return o.visit(s),o.found}catch{return fg.test(a.source)}}).map(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:Re.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function hg(t){return t.filter(n=>{const i=n[_r];return i instanceof RegExp&&(i.multiline||i.global)}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Re.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function pg(t){const e=[];let r=t.map(a=>t.reduce((s,o)=>(a.PATTERN.source===o.PATTERN.source&&!e.includes(o)&&o.PATTERN!==We.NA&&(e.push(o),s.push(o)),s),[]));return r=r.filter(Boolean),r.filter(a=>a.length>1).map(a=>{const s=a.map(l=>l.name);return{message:`The same RegExp pattern ->${a[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Re.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function mg(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;const i=n.GROUP;return i!==We.SKIPPED&&i!==We.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Re.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function gg(t,e){return t.filter(i=>i.PUSH_MODE!==void 0&&!e.includes(i.PUSH_MODE)).map(i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Re.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function yg(t){const e=[],r=t.reduce((n,i,a)=>{const s=i.PATTERN;return s===We.NA||(typeof s=="string"?n.push({str:s,idx:a,tokenType:i}):s instanceof RegExp&&Rg(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return t.forEach((n,i)=>{r.forEach(({str:a,idx:s,tokenType:o})=>{if(i<s&&Tg(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:Re.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function Tg(t,e){if(e instanceof RegExp){if(vg(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(typeof e=="function")return e(t,0,[],{});if(Object.hasOwn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function Rg(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function vg(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function eu(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function Eg(t,e,r){const n=[];return Object.hasOwn(t,$i)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+$i+`> property in its definition
34
+ `,type:Re.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Ea)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ea+`> property in its definition
35
+ `,type:Re.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Ea)&&Object.hasOwn(t,$i)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${$i}: <${t.defaultMode}>which does not exist
36
+ `,type:Re.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Ea)&&Object.keys(t.modes).forEach(i=>{const a=t.modes[i];a.forEach((s,o)=>{s===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${o}>
37
+ `,type:Re.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,"LONGER_ALT")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(c=>{c!==void 0&&!a.includes(c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${s.name}> outside of mode <${i}>
38
+ `,type:Re.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function Ag(t,e,r){const n=[];let i=!1;const s=Object.values(t.modes||{}).flat().filter(Boolean).filter(l=>l[_r]!==We.NA),o=qd(r);return e&&s.forEach(l=>{const c=Vd(l,o);if(c!==!1){const d={message:wg(l,c),type:c.issue,tokenType:l};n.push(d)}else Object.hasOwn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Ec(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:Re.NO_LINE_BREAKS_FLAGS}),n}function $g(t){const e={};return Object.keys(t).forEach(n=>{const i=t[n];if(Array.isArray(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Kd(t){const e=t.PATTERN;if(e instanceof RegExp)return!1;if(typeof e=="function")return!0;if(Object.hasOwn(e,"exec"))return!0;if(typeof e=="string")return!1;throw Error("non exhaustive match")}function Cg(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}const Sg={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 Vd(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{Ec(e,t.PATTERN)}catch(r){return{issue:Re.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(Kd(t))return{issue:Re.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function wg(t,e){if(e.issue===Re.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===Re.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 qd(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function to(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const Ci=256;let Ba=[];function or(t){return t<Ci?t:Ba[t]}function kg(){if(Ba.length===0){Ba=new Array(65536);for(let t=0;t<65536;t++)Ba[t]=t>255?255+~~(t/255):t}}function Hi(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ns(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let tu=1;const Hd={};function Xi(t){const e=bg(t);Ng(e),Ig(e),_g(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function bg(t){let e=[...t],r=t,n=!0;for(;n;){r=r.map(a=>a.CATEGORIES).flat().filter(Boolean);const i=r.filter(a=>!e.includes(a));e=e.concat(i),i.length===0?n=!1:r=i}return e}function Ng(t){t.forEach(e=>{Yd(e)||(Hd[tu]=e,e.tokenTypeIdx=tu++),ru(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ru(e)||(e.CATEGORIES=[]),Pg(e)||(e.categoryMatches=[]),Og(e)||(e.categoryMatchesMap={})})}function _g(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(Hd[r].tokenTypeIdx)})})}function Ig(t){t.forEach(e=>{Xd([],e)})}function Xd(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{const n=t.concat(e);n.includes(r)||Xd(n,r)})}function Yd(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function ru(t){return Object.hasOwn(t??{},"CATEGORIES")}function Pg(t){return Object.hasOwn(t??{},"categoryMatches")}function Og(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function Lg(t){return Object.hasOwn(t??{},"tokenTypeIdx")}const Mo={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 Re;(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"})(Re||(Re={}));const Si={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Mo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Si);class We{constructor(e,r=Si){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}=zd(a),c=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${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=Object.assign({},Si,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===Si.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Sg;else if(this.config.lineTerminatorCharacters===Si.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),Array.isArray(e)?i={modes:{defaultMode:[...e]},defaultMode:$i}:(a=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eg(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Ag(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([o,l])=>{i.modes[o]=l.filter(c=>c!==void 0)});const s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([o,l])=>{this.TRACE_INIT(`Mode: <${o}> processing`,()=>{if(this.modes.push(o),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ig(l,s))}),this.lexerDefinitionErrors.length===0){Xi(l);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=ng(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[o]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[o]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[o]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const l=this.lexerDefinitionErrors.map(c=>c.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+l)}this.lexerDefinitionWarning.forEach(o=>{jd(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=o=>o),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Object.entries(this.canModeBeOptimized).reduce((l,[c,u])=>(u===!1&&l.push(c),l),[]);if(r.ensureOptimizations&&o.length>0)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",()=>{Qm()}),this.TRACE_INIT("toFastProperties",()=>{Ud(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const i=this.lexerDefinitionErrors.map(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,c,u,d,p,g,A,w,I,b;const L=e,N=L.length;let x=0,q=0;const Z=this.hasCustom?0:Math.floor(e.length/10),Q=new Array(Z),he=[];let ve=this.trackStartLines?1:void 0,oe=this.trackStartLines?1:void 0;const S=$g(this.emptyGroups),R=this.trackStartLines,m=this.config.lineTerminatorsPattern;let $=0,y=[],T=[];const E=[],P=[];Object.freeze(P);let D=!1;const O=z=>{if(E.length===1&&z.tokenType.PUSH_MODE===void 0){const ee=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(z);he.push({offset:z.startOffset,line:z.startLine,column:z.startColumn,length:z.image.length,message:ee})}else{E.pop();const ee=E.at(-1);y=this.patternIdxToConfig[ee],T=this.charCodeToPatternIdxToConfig[ee],$=y.length;const Ie=this.canModeBeOptimized[ee]&&this.config.safeMode===!1;T&&Ie?D=!0:D=!1}};function j(z){E.push(z),T=this.charCodeToPatternIdxToConfig[z],y=this.patternIdxToConfig[z],$=y.length,$=y.length;const ee=this.canModeBeOptimized[z]&&this.config.safeMode===!1;T&&ee?D=!0:D=!1}j.call(this,r);let F;const re=this.config.recoveryEnabled;for(;x<N;){l=null,d=-1;const z=L.charCodeAt(x);let ee;if(D){const pe=or(z),le=T[pe];ee=le!==void 0?le:P}else ee=y;const Ie=ee.length;for(n=0;n<Ie;n++){F=ee[n];const pe=F.pattern;c=null;const le=F.short;if(le!==!1?z===le&&(d=1,l=pe):F.isCustom===!0?(b=pe.exec(L,x,Q,S),b!==null?(l=b[0],d=l.length,b.payload!==void 0&&(c=b.payload)):l=null):(pe.lastIndex=x,d=this.matchLength(pe,e,x)),d!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(x,x+d);const be=o.length;for(a=0;a<be;a++){const Pe=y[o[a]],Ce=Pe.pattern;if(u=null,Pe.isCustom===!0?(b=Ce.exec(L,x,Q,S),b!==null?(s=b[0],b.payload!==void 0&&(u=b.payload)):s=null):(Ce.lastIndex=x,s=this.match(Ce,e,x)),s&&s.length>l.length){l=s,d=s.length,c=u,F=Pe;break}}}break}}if(d!==-1){if(p=F.group,p!==void 0&&(l=l!==null?l:e.substring(x,x+d),g=F.tokenTypeIdx,A=this.createTokenInstance(l,x,g,F.tokenType,ve,oe,d),this.handlePayload(A,c),p===!1?q=this.addToken(Q,q,A):S[p].push(A)),R===!0&&F.canLineTerminator===!0){let pe=0,le,be;m.lastIndex=0;do l=l!==null?l:e.substring(x,x+d),le=m.test(l),le===!0&&(be=m.lastIndex-1,pe++);while(le===!0);pe!==0?(ve=ve+pe,oe=d-be,this.updateTokenEndLineColumnLocation(A,p,be,pe,ve,oe,d)):oe=this.computeNewColumn(oe,d)}else oe=this.computeNewColumn(oe,d);x=x+d,this.handleModes(F,O,j,A)}else{const pe=x,le=ve,be=oe;let Pe=re===!1;for(;Pe===!1&&x<N;)for(x++,i=0;i<$;i++){const Ce=y[i],X=Ce.pattern,He=Ce.short;if(He!==!1?L.charCodeAt(x)===He&&(Pe=!0):Ce.isCustom===!0?Pe=X.exec(L,x,Q,S)!==null:(X.lastIndex=x,Pe=X.exec(e)!==null),Pe===!0)break}if(w=x-pe,oe=this.computeNewColumn(oe,w),I=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(L,pe,w,le,be,E.at(-1)),he.push({offset:pe,line:le,column:be,length:w,message:I}),re===!1)break}}return this.hasCustom||(Q.length=q),{tokens:Q,groups:S,errors:he}}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,c;r!==void 0&&(l=n===o-1,c=l?-1:0,i===1&&l===!0||(e.endLine=a+c,e.endColumn=s-1+-c))}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}}We.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.";We.NA=/NOT_APPLICABLE/;function an(t){return Jd(t)?t.LABEL:t.name}function Jd(t){return typeof t.LABEL=="string"&&t.LABEL!==""}const xg="parent",nu="categories",iu="label",au="group",su="push_mode",ou="pop_mode",lu="longer_alt",cu="line_breaks",uu="start_chars_hint";function Zd(t){return Dg(t)}function Dg(t){const e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,xg))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,nu)&&(r.CATEGORIES=t[nu]),Xi([r]),Object.hasOwn(t,iu)&&(r.LABEL=t[iu]),Object.hasOwn(t,au)&&(r.GROUP=t[au]),Object.hasOwn(t,ou)&&(r.POP_MODE=t[ou]),Object.hasOwn(t,su)&&(r.PUSH_MODE=t[su]),Object.hasOwn(t,lu)&&(r.LONGER_ALT=t[lu]),Object.hasOwn(t,cu)&&(r.LINE_BREAKS=t[cu]),Object.hasOwn(t,uu)&&(r.START_CHARS_HINT=t[uu]),r}const lr=Zd({name:"EOF",pattern:We.NA});Xi([lr]);function Ac(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 Qd(t,e){return Hi(t,e)}const rn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Jd(t)?`--> ${an(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: '`+e[0].image+"'";if(n)return a+n+o;{const d=`one of these possible Token sequences:
59
+ ${t.reduce((p,g)=>p.concat(g),[]).map(p=>`[${p.map(g=>an(g)).join(", ")}]`).map((p,g)=>` ${g+1}. ${p}`).join(`
60
+ `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
61
+ but found: '`+e[0].image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
62
+ <${t.map(c=>`[${c.map(u=>an(u)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(rn);const Mg={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},Sr={buildDuplicateFoundError(t,e){function r(u){return u instanceof se?u.terminalType.name:u instanceof ze?u.nonTerminalName:""}const n=t.name,i=e[0],a=i.idx,s=yt(i),o=r(i),l=a>0;let c=`->${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 c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
67
+ `),c},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=t.prefixPath.map(i=>an(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=t.prefixPath.map(a=>an(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=yt(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=t.leftRecursionPath.map(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 Bn?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Fg(t,e){const r=new Gg(t,e);return r.resolveRefs(),r.errors}class Gg extends Wn{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){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:Ue.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class jg extends Ns{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class zg extends jg{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 Ke({definition:i});this.possibleTokTypes=qi(a),this.found=!0}}}class Is extends Ns{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 Ug extends Is{walkMany(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class fu extends Is{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class Bg extends Is{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class du extends Is{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function Fo(t,e,r=[]){r=[...r];let n=[],i=0;function a(o){return o.concat(t.slice(i+1))}function s(o){const l=Fo(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof Ke)return s(o.definition);if(o instanceof ze)return s(o.definition);if(o instanceof De)n=s(o.definition);else if(o instanceof Ze){const l=o.definition.concat([new Te({definition:o.definition})]);return s(l)}else if(o instanceof Qe){const l=[new Ke({definition:o.definition}),new Te({definition:[new se({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof Ve){const l=o.definition.concat([new Te({definition:[new se({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof Te){const l=o.definition.concat([new Te({definition:o.definition})]);n=s(l)}else{if(o instanceof qe)return o.definition.forEach(l=>{l.definition.length!==0&&(n=s(l.definition))}),n;if(o instanceof se)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function Wg(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-n-1,u=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});d.length!==0;){const p=d.pop();if(p===s){o&&d.at(-1).idx<=c&&d.pop();continue}const g=p.def,A=p.idx,w=p.ruleStack,I=p.occurrenceStack;if(g.length===0)continue;const b=g[0];if(b===i){const L={idx:A,def:g.slice(1),ruleStack:w.slice(0,-1),occurrenceStack:I.slice(0,-1)};d.push(L)}else if(b instanceof se)if(A<l-1){const L=A+1,N=e[L];if(r(N,b.terminalType)){const x={idx:L,def:g.slice(1),ruleStack:w,occurrenceStack:I};d.push(x)}}else if(A===l-1)u.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:w,occurrenceStack:I}),o=!0;else throw Error("non exhaustive match");else if(b instanceof ze){const L=[...w];L.push(b.nonTerminalName);const N=[...I];N.push(b.idx);const x={idx:A,def:b.definition.concat(a,g.slice(1)),ruleStack:L,occurrenceStack:N};d.push(x)}else if(b instanceof De){const L={idx:A,def:g.slice(1),ruleStack:w,occurrenceStack:I};d.push(L),d.push(s);const N={idx:A,def:b.definition.concat(g.slice(1)),ruleStack:w,occurrenceStack:I};d.push(N)}else if(b instanceof Ze){const L=new Te({definition:b.definition,idx:b.idx}),N=b.definition.concat([L],g.slice(1)),x={idx:A,def:N,ruleStack:w,occurrenceStack:I};d.push(x)}else if(b instanceof Qe){const L=new se({terminalType:b.separator}),N=new Te({definition:[L].concat(b.definition),idx:b.idx}),x=b.definition.concat([N],g.slice(1)),q={idx:A,def:x,ruleStack:w,occurrenceStack:I};d.push(q)}else if(b instanceof Ve){const L={idx:A,def:g.slice(1),ruleStack:w,occurrenceStack:I};d.push(L),d.push(s);const N=new se({terminalType:b.separator}),x=new Te({definition:[N].concat(b.definition),idx:b.idx}),q=b.definition.concat([x],g.slice(1)),Z={idx:A,def:q,ruleStack:w,occurrenceStack:I};d.push(Z)}else if(b instanceof Te){const L={idx:A,def:g.slice(1),ruleStack:w,occurrenceStack:I};d.push(L),d.push(s);const N=new Te({definition:b.definition,idx:b.idx}),x=b.definition.concat([N],g.slice(1)),q={idx:A,def:x,ruleStack:w,occurrenceStack:I};d.push(q)}else if(b instanceof qe)for(let L=b.definition.length-1;L>=0;L--){const N=b.definition[L],x={idx:A,def:N.definition.concat(g.slice(1)),ruleStack:w,occurrenceStack:I};d.push(x),d.push(s)}else if(b instanceof Ke)d.push({idx:A,def:b.definition.concat(g.slice(1)),ruleStack:w,occurrenceStack:I});else if(b instanceof Bn)d.push(Kg(b,A,w,I));else throw Error("non exhaustive match")}return u}function Kg(t,e,r,n){const i=[...r];i.push(t.name);const a=[...n];return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var fe;(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"})(fe||(fe={}));function $c(t){if(t instanceof De||t==="Option")return fe.OPTION;if(t instanceof Te||t==="Repetition")return fe.REPETITION;if(t instanceof Ze||t==="RepetitionMandatory")return fe.REPETITION_MANDATORY;if(t instanceof Qe||t==="RepetitionMandatoryWithSeparator")return fe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Ve||t==="RepetitionWithSeparator")return fe.REPETITION_WITH_SEPARATOR;if(t instanceof qe||t==="Alternation")return fe.ALTERNATION;throw Error("non exhaustive match")}function hu(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=$c(n);return a===fe.ALTERNATION?Ps(e,r,i):Os(e,r,a,i)}function Vg(t,e,r,n,i,a){const s=Ps(t,e,r),o=rh(s)?ns:Hi;return a(s,n,o,i)}function qg(t,e,r,n,i,a){const s=Os(t,e,i,r),o=rh(s)?ns:Hi;return a(s[0],o,n)}function Hg(t,e,r,n){const i=t.length,a=t.every(s=>s.every(o=>o.length===1));if(e)return function(s){const o=s.map(l=>l.GATE);for(let l=0;l<i;l++){const c=t[l],u=c.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let p=0;p<u;p++){const g=c[p],A=g.length;for(let w=0;w<A;w++){const I=this.LA_FAST(w+1);if(r(I,g[w])===!1)continue e}return l}}};if(a&&!n){const o=t.map(l=>l.flat()).reduce((l,c,u)=>(c.forEach(d=>{d.tokenTypeIdx in l||(l[d.tokenTypeIdx]=u),d.categoryMatches.forEach(p=>{Object.hasOwn(l,p)||(l[p]=u)})}),l),{});return function(){const l=this.LA_FAST(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 c=0;c<l;c++){const u=o[c],d=u.length;for(let p=0;p<d;p++){const g=this.LA_FAST(p+1);if(r(g,u[p])===!1)continue e}return s}}}}function Xg(t,e,r){const n=t.every(a=>a.length===1),i=t.length;if(n&&!r){const a=t.flat();if(a.length===1&&a[0].categoryMatches.length===0){const o=a[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===o}}else{const s=a.reduce((o,l,c)=>(o[l.tokenTypeIdx]=!0,l.categoryMatches.forEach(u=>{o[u]=!0}),o),[]);return function(){const o=this.LA_FAST(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 c=this.LA_FAST(l+1);if(e(c,s[l])===!1)continue e}return!0}return!1}}class Yg extends Ns{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,fe.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,fe.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,fe.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,fe.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,fe.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class eh extends Wn{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,fe.OPTION)}visitRepetition(e){this.checkIsTarget(e,fe.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,fe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,fe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,fe.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,fe.ALTERNATION)}}function pu(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function ro(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 Jg(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 th(t,e){const r=t.map(s=>Fo([s],1)),n=pu(r.length),i=r.map(s=>{const o={};return s.forEach(l=>{ro(l.partialPath).forEach(u=>{o[u]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=pu(o.length);for(let l=0;l<o.length;l++){const c=o[l];for(let u=0;u<c.length;u++){const d=c[u].partialPath,p=c[u].suffixDef,g=ro(d);if(Jg(i,g,l)||p.length===0||d.length===e){const w=n[l];if(Go(w,d)===!1){w.push(d);for(let I=0;I<g.length;I++){const b=g[I];i[l][b]=!0}}}else{const w=Fo(p,s+1,d);a[l]=a[l].concat(w),w.forEach(I=>{ro(I.partialPath).forEach(L=>{i[l][L]=!0})})}}}}return n}function Ps(t,e,r,n){const i=new eh(t,fe.ALTERNATION,n);return e.accept(i),th(i.result,r)}function Os(t,e,r,n){const i=new eh(t,r);e.accept(i);const a=i.result,o=new Yg(e,t,r).startWalking(),l=new Ke({definition:a}),c=new Ke({definition:o});return th([l,c],n)}function Go(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 Zg(t,e){return t.length<e.length&&t.every((r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function rh(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function Qg(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:Ue.CUSTOM_LOOKAHEAD_VALIDATION},r))}function ey(t,e,r,n){const i=t.flatMap(l=>ty(l,r)),a=hy(t,e,r),s=t.flatMap(l=>cy(l,r)),o=t.flatMap(l=>iy(l,t,n,r));return i.concat(a,s,o)}function ty(t,e){const r=new ny;t.accept(r);const n=r.allProductions,i=Object.groupBy(n,ry),a=Object.fromEntries(Object.entries(i).filter(([o,l])=>l.length>1));return Object.values(a).map(o=>{const l=o[0],c=e.buildDuplicateFoundError(t,o),u=yt(l),d={message:c,type:Ue.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:l.idx},p=nh(l);return p&&(d.parameter=p),d})}function ry(t){return`${yt(t)}_#_${t.idx}_#_${nh(t)}`}function nh(t){return t instanceof se?t.terminalType.name:t instanceof ze?t.nonTerminalName:""}class ny extends Wn{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 iy(t,e,r,n){const i=[];if(e.reduce((s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Ue.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function ay(t,e,r){const n=[];let i;return e.includes(t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Ue.INVALID_RULE_OVERRIDE,ruleName:t})),n}function ih(t,e,r,n=[]){const i=[],a=Wa(e.definition);if(a.length===0)return[];{const s=t.name;a.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ue.LEFT_RECURSION,ruleName:s});const l=n.concat([t]),u=a.filter(d=>!l.includes(d)).flatMap(d=>{const p=[...n];return p.push(d),ih(t,d,r,p)});return i.concat(u)}}function Wa(t){let e=[];if(t.length===0)return e;const r=t[0];if(r instanceof ze)e.push(r.referencedRule);else if(r instanceof Ke||r instanceof De||r instanceof Ze||r instanceof Qe||r instanceof Ve||r instanceof Te)e=e.concat(Wa(r.definition));else if(r instanceof qe)e=r.definition.map(a=>Wa(a.definition)).flat();else if(!(r instanceof se))throw Error("non exhaustive match");const n=ts(r),i=t.length>1;if(n&&i){const a=t.slice(1);return e.concat(Wa(a))}else return e}class Cc extends Wn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function sy(t,e){const r=new Cc;return t.accept(r),r.alternations.flatMap(a=>a.definition.slice(0,-1).flatMap((o,l)=>Wg([o],[],Hi,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Ue.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]))}function oy(t,e,r){const n=new Cc;t.accept(n);let i=n.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{const o=s.idx,l=s.maxLookahead||e,c=Ps(o,t,l,s),u=fy(c,s,t,r),d=dy(c,s,t,r);return u.concat(d)})}class ly extends Wn{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 cy(t,e){const r=new Cc;return t.accept(r),r.alternations.flatMap(a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Ue.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function uy(t,e,r){const n=[];return t.forEach(i=>{const a=new ly;i.accept(a),a.allProductions.forEach(o=>{const l=$c(o),c=o.maxLookahead||e,u=o.idx;if(Os(u,i,l,c)[0].flat().length===0){const g=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:g,type:Ue.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function fy(t,e,r,n){const i=[];return t.reduce((o,l,c)=>(e.definition[c].ignoreAmbiguities===!0||l.forEach(u=>{const d=[c];t.forEach((p,g)=>{c!==g&&Go(p,u)&&e.definition[g].ignoreAmbiguities!==!0&&d.push(g)}),d.length>1&&!Go(i,u)&&(i.push(u),o.push({alts:d,path:u}))}),o),[]).map(o=>{const l=o.alts.map(u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Ue.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function dy(t,e,r,n){const i=t.reduce((s,o,l)=>{const c=o.map(u=>({idx:l,path:u}));return s.concat(c)},[]);return i.flatMap(s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,c=s.path;return i.filter(p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<l&&Zg(p.path,c)).map(p=>{const g=[p.idx+1,l+1],A=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:g,prefixPath:p.path}),type:Ue.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:A,alternatives:g}})})}function hy(t,e,r){const n=[],i=e.map(a=>a.name);return t.forEach(a=>{const s=a.name;if(i.includes(s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:Ue.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function py(t){const e=Object.assign({errMsgProvider:Mg},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),Fg(r,e.errMsgProvider)}function my(t){var e;const r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Sr;return ey(t.rules,t.tokenTypes,r,t.grammarName)}const ah="MismatchedTokenException",sh="NoViableAltException",oh="EarlyExitException",lh="NotAllInputParsedException",ch=[ah,sh,oh,lh];Object.freeze(ch);function is(t){return ch.includes(t.name)}class Ls 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 uh extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ah}}class gy extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sh}}class yy extends Ls{constructor(e,r){super(e,r),this.name=lh}}class Ty extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=oh}}const no={},fh="InRuleRecoveryException";class Ry extends Error{constructor(e){super(e),this.name=fh}}class vy{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Bt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Ey)}getTokenToInsert(e){const r=Ac(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 c=this.LA_FAST(1);let u=this.LA_FAST(1);const d=()=>{const p=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:p,ruleName:this.getCurrRuleFullName()}),A=new uh(g,c,this.LA(0));A.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(A)};for(;!l;)if(this.tokenMatcher(u,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(u,a)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA_FAST(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getNextPossibleTokenTypes(e){const r=e.ruleStack[0],i=this.getGAstProductions()[r];return new zg(i,e).startWalking()}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 Ry("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||r.length===0)return!1;const n=this.LA_FAST(1);return r.find(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();return this.getFollowSetFromFollowKey(r).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA_FAST(1),n=2;for(;;){const i=e.find(a=>Qd(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return no;const e=this.currRuleShortName,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,n=this.RULE_STACK_IDX+1,i=new Array(n);for(let a=0;a<n;a++)a===0?i[a]=no:i[a]={ruleName:this.shortRuleNameToFullName(e[a]),idxInCallingRule:r[a],inRule:this.shortRuleNameToFullName(e[a-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(r=>this.getFollowSetFromFollowKey(r)).flat()}getFollowSetFromFollowKey(e){if(e===no)return[lr];const r=e.ruleName+e.idxInCallingRule+Bd+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,lr)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA_FAST(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return r.slice(0,-1)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,r=new Array(e);for(let n=0;n<e;n++)r[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return r}}function Ey(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(),g=this.getGAstProductions()[p];l=new a(g,i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,u=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK_IDX===0&&d&&c===void 0&&(c=lr,u=1),!(c===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,u,s)&&this.tryInRepetitionRecovery(t,e,r,c)}const Ay=4,fr=8,dh=1<<fr,hh=2<<fr,jo=3<<fr,zo=4<<fr,Uo=5<<fr,Ka=6<<fr;function io(t,e,r){return r|e|t}class Sc{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:Bt.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(r.length===0){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 e.flatMap(r=>ih(r,r,Sr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>sy(r,Sr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>oy(n,r,Sr))}validateSomeNonEmptyLookaheadPath(e,r){return uy(e,r,Sr)}buildLookaheadForAlternation(e){return Vg(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Hg)}buildLookaheadForOptional(e){return qg(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,$c(e.prodType),Xg)}}class $y{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Bt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Bt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new Sc({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){e.forEach(r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Sy(r);n.forEach(c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${yt(c)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=io(this.fullRuleNameToShort[r.name],dh,c.idx);this.setLaFuncCache(p,d)})}),i.forEach(c=>{this.computeLookaheadFunc(r,c.idx,jo,"Repetition",c.maxLookahead,yt(c))}),a.forEach(c=>{this.computeLookaheadFunc(r,c.idx,hh,"Option",c.maxLookahead,yt(c))}),s.forEach(c=>{this.computeLookaheadFunc(r,c.idx,zo,"RepetitionMandatory",c.maxLookahead,yt(c))}),o.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Ka,"RepetitionMandatoryWithSeparator",c.maxLookahead,yt(c))}),l.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Uo,"RepetitionWithSeparator",c.maxLookahead,yt(c))})})})}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=io(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){return io(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class Cy extends Wn{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 Aa=new Cy;function Sy(t){Aa.reset(),t.accept(Aa);const e=Aa.dslMethods;return Aa.reset(),e}function mu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function gu(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 wy(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function ky(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const by="name";function ph(t,e){Object.defineProperty(t,by,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Ny(t,e){const r=Object.keys(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 c=s[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function _y(t,e){const r=function(){};ph(r,t+"BaseSemantics");const n={visit:function(i,a){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,a)},validateVisitor:function(){const i=Py(this,e);if(i.length!==0){const a=i.map(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 Iy(t,e,r){const n=function(){};ph(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return e.forEach(a=>{i[a]=Ny}),n.prototype=i,n.prototype.constructor=n,n}var Bo;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Bo||(Bo={}));function Py(t,e){return Oy(t,e)}function Oy(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Bo.MISSING_METHOD,methodName:i})).filter(Boolean)}class Ly{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Bt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gu,this.setNodeLocationFromNode=gu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=mu,this.setNodeLocationFromNode=mu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA_FAST(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];wy(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];ky(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){const e=_y(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){const e=Iy(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}}class xy{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):wn}LA_FAST(e){const r=this.currIdx+e;return this.tokVector[r]}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?wn:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}}class Dy{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=ss){if(this.definedRulesNames.includes(e)){const s={message:Sr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ue.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=ss){const i=ay(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){var n;const i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);const a=this.saveRecogState();try{return i.apply(this,r),!0}catch(s){if(is(s))return!1;throw s}finally{this.reloadRecogState(a),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Bm(Object.values(this.gastProductionsCache))}}class My{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ns,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
94
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
95
+ For Further details.`);if(Array.isArray(e)){if(e.length===0)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(Array.isArray(e))this.tokensMap=e.reduce((a,s)=>(a[s.name]=s,a),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Lg)){const a=Object.values(e.modes).flat(),s=[...new Set(a)];this.tokensMap=s.reduce((o,l)=>(o[l.name]=l,o),{})}else if(typeof e=="object"&&e!==null)this.tokensMap=Object.assign({},e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=lr;const i=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(a=>{var s;return((s=a.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?ns:Hi,Xi(Object.values(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
100
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:ss.resyncEnabled,a=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:ss.recoveryValueFunc,s=this.ruleShortNameIdx<<Ay+fr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...d){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,d);const p=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(p),p}catch(p){return this.invokeRuleCatch(p,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...d){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,d)}catch(p){return this.invokeRuleCatch(p,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...d){this.onBeforeParse(e);try{return o.apply(this,d)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:r,coreRule:o})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK_IDX===0,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(is(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(hh,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(zo,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,fe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,zo,e,Bg)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Ka,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_FAST(1),a);for(;this.tokenMatcher(this.LA_FAST(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,du],o,Ka,e,du)}else throw this.raiseEarlyExitException(e,fe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(jo,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,jo,e,Ug,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Uo,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_FAST(1),a);for(;this.tokenMatcher(this.LA_FAST(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,fu],o,Uo,e,fu)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Ka,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(dh,r),i=Array.isArray(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.coreRule.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 is(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_FAST(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 uh(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===fh?n:a}}else throw n}saveRecogState(){const e=this.errors,r=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const r=e.RULE_STACK;for(let n=0;n<r.length;n++)this.RULE_STACK[n]=r[n];this.RULE_STACK_IDX=r.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),lr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let r=0;r<this.maxLookahead+1;r++)this.tokVector.push(wn)}onAfterParse(e){if(this.isAtEndOfInput()===!1){const r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new yy(n,r))}for(;this.tokVector.at(-1)===wn;)this.tokVector.pop()}}class Fy{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Bt.errorMessageProvider}SAVE_ERROR(e){if(is(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=Os(e,a,r,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Ty(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Ps(e,i,this.maxLookahead),s=[];for(let c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));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 gy(l,this.LA(1),o))}}const xs={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(xs);const yu=!0,Tu=Math.pow(2,fr)-1,mh=Zd({name:"RECORDING_PHASE_TOKEN",pattern:We.NA});Xi([mh]);const gh=Ac(mh,`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(gh);const Gy={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 jy{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 wn}topLevelRuleRecord(e,r){try{const n=new Bn({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 ci.call(this,De,e,r)}atLeastOneInternalRecord(e,r){ci.call(this,Ze,r,e)}atLeastOneSepFirstInternalRecord(e,r){ci.call(this,Qe,r,e,yu)}manyInternalRecord(e,r){ci.call(this,Te,r,e)}manySepFirstInternalRecord(e,r){ci.call(this,Ve,r,e,yu)}orInternalRecord(e,r){return zy.call(this,e,r)}subruleInternalRecord(e,r,n){if(as(r),!e||!Object.hasOwn(e,"ruleName")){const o=new Error(`<SUBRULE${Ru(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=this.recordingProdStack.at(-1),a=e.ruleName,s=new ze({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Gy:xs}consumeInternalRecord(e,r,n){if(as(r),!Yd(e)){const s=new Error(`<CONSUME${Ru(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=this.recordingProdStack.at(-1),a=new se({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),gh}}function ci(t,e,r,n=!1){as(r);const i=this.recordingProdStack.at(-1),a=typeof e=="function"?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Object.hasOwn(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),xs}function zy(t,e){as(e);const r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,a=new qe({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Object.hasOwn(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=i.some(o=>typeof o.GATE=="function");return a.hasPredicates=s,r.definition.push(a),i.forEach(o=>{const l=new Ke({definition:[]});a.definition.push(l),Object.hasOwn(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Object.hasOwn(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),xs}function Ru(t){return t===0?"":`${t}`}function as(t){if(t<0||t>Tu){const e=new Error(`Invalid DSL Method idx value: <${t}>
107
+ Idx value must be a none negative value smaller than ${Tu+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class Uy{initPerformanceTracer(e){if(Object.hasOwn(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=Bt.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}=zd(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 By(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 wn=Ac(lr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(wn);const Bt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:rn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ss=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Ue;(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"})(Ue||(Ue={}));function vu(t=void 0){return function(){return t}}class Yi{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",()=>{Ud(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(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=py({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){const i=my({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Sr,grammarName:r}),a=Qg({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Ym(Object.values(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:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!Yi.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map(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.initGastRecorder(r),n.initPerformanceTracer(r),Object.hasOwn(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=Object.hasOwn(r,"skipValidations")?r.skipValidations:Bt.skipValidations}}Yi.DEFER_DEFINITION_ERRORS_HANDLING=!1;By(Yi,[vy,$y,Ly,xy,My,Dy,Fy,jy,Uy]);class Wy extends Yi{constructor(e,r=Bt){const n=Object.assign({},r);n.outputCst=!1,super(e,n)}}function kn(t,e,r){return`${t.name}_${e}_${r}`}const cr=1,Ky=2,yh=4,Th=5,Ji=7,Vy=8,qy=9,Hy=10,Xy=11,Rh=12;class wc{constructor(e){this.target=e}isEpsilon(){return!1}}class kc extends wc{constructor(e,r){super(e),this.tokenType=r}}class vh extends wc{constructor(e){super(e)}isEpsilon(){return!0}}class bc extends wc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function Yy(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Jy(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Or(e,i,i);a!==void 0&&lT(e,i,a)}return e}function Jy(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=_e(t,i,void 0,{type:Ky}),s=_e(t,i,void 0,{type:Ji});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function Eh(t,e,r){return r instanceof se?Nc(t,e,r.terminalType,r):r instanceof ze?oT(t,e,r):r instanceof qe?rT(t,e,r):r instanceof De?nT(t,e,r):r instanceof Te?Zy(t,e,r):r instanceof Ve?Qy(t,e,r):r instanceof Ze?eT(t,e,r):r instanceof Qe?tT(t,e,r):Or(t,e,r)}function Zy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Kn(t,e,n,r,Or(t,e,r));return $h(t,e,r,i)}function Qy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Kn(t,e,n,r,Or(t,e,r)),a=Nc(t,e,r.separator,r);return $h(t,e,r,i,a)}function eT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Kn(t,e,n,r,Or(t,e,r));return Ah(t,e,r,i)}function tT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Kn(t,e,n,r,Or(t,e,r)),a=Nc(t,e,r.separator,r);return Ah(t,e,r,i,a)}function rT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Gt(r.definition,s=>Eh(t,e,s));return Kn(t,e,n,r,...i)}function nT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Kn(t,e,n,r,Or(t,e,r));return iT(t,e,r,i)}function Or(t,e,r){const n=Mp(Gt(r.definition,i=>Eh(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:sT(t,n)}function Ah(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Xy});dr(t,o);const l=_e(t,e,r,{type:Rh});return a.loopback=o,l.loopback=o,t.decisionMap[kn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Se(s,o),i===void 0?(Se(o,a),Se(o,l)):(Se(o,l),Se(o,i.left),Se(i.right,a)),{left:a,right:l}}function $h(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Hy});dr(t,o);const l=_e(t,e,r,{type:Rh}),c=_e(t,e,r,{type:qy});return o.loopback=c,l.loopback=c,Se(o,a),Se(o,l),Se(s,c),i!==void 0?(Se(c,l),Se(c,i.left),Se(i.right,a)):Se(c,o),t.decisionMap[kn(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function iT(t,e,r,n){const i=n.left,a=n.right;return Se(i,a),t.decisionMap[kn(e,"Option",r.idx)]=i,n}function dr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Kn(t,e,r,n,...i){const a=_e(t,e,n,{type:Vy,start:r});r.end=a;for(const o of i)o!==void 0?(Se(r,o.left),Se(o.right,a)):Se(r,a);const s={left:r,right:a};return t.decisionMap[kn(e,aT(n),n.idx)]=r,s}function aT(t){if(t instanceof qe)return"Alternation";if(t instanceof De)return"Option";if(t instanceof Te)return"Repetition";if(t instanceof Ve)return"RepetitionWithSeparator";if(t instanceof Ze)return"RepetitionMandatory";if(t instanceof Qe)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function sT(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 bc,c=o,u=e[a+1].left;s.left.type===cr&&s.right.type===cr&&o!==void 0&&(l&&c.followState===s.right||o.target===s.right)?(l?c.followState=u:o.target=u,cT(t,s.right)):Se(s.right,u)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Nc(t,e,r,n){const i=_e(t,e,n,{type:cr}),a=_e(t,e,n,{type:cr});return _c(i,new kc(a,r)),{left:i,right:a}}function oT(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=_e(t,e,r,{type:cr}),s=_e(t,e,r,{type:cr}),o=new bc(i,n,s);return _c(a,o),{left:a,right:s}}function lT(t,e,r){const n=t.ruleToStartState.get(e);Se(n,r.left);const i=t.ruleToStopState.get(e);return Se(r.right,i),{left:n,right:i}}function Se(t,e){const r=new vh(e);_c(t,r)}function _e(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 _c(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function cT(t,e){t.states.splice(t.states.indexOf(e),1)}const os={};class Wo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Ch(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return Gt(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function Ch(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function uT(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 Sh{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 Eu=new Sh;class fT extends Sc{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=Yy(e.rules),this.dfas=dT(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=kn(n,"Alternation",r),u=this.atn.decisionMap[l].decision,d=Gt(hu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>Gt(p,g=>g[0]));if(Au(d,!1)&&!a){const p=Gc(d,(g,A,w)=>(Xs(A,I=>{I&&(g[I.tokenTypeIdx]=w,Xs(I.categoryMatches,b=>{g[b]=w}))}),g),{});return i?function(g){var A;const w=this.LA_FAST(1),I=p[w.tokenTypeIdx];if(g!==void 0&&I!==void 0){const b=(A=g[I])===null||A===void 0?void 0:A.GATE;if(b!==void 0&&b.call(this)===!1)return}return I}:function(){const g=this.LA_FAST(1);return p[g.tokenTypeIdx]}}else return i?function(p){const g=new Sh,A=p===void 0?0:p.length;for(let I=0;I<A;I++){const b=p==null?void 0:p[I].GATE;g.set(I,b===void 0||b.call(this))}const w=ao.call(this,s,u,g,o);return typeof w=="number"?w:void 0}:function(){const p=ao.call(this,s,u,Eu,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=kn(n,i,r),u=this.atn.decisionMap[l].decision,d=Gt(hu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>Gt(p,g=>g[0]));if(Au(d)&&d[0][0]&&!a){const p=d[0],g=Pp(p);if(g.length===1&&Fp(g[0].categoryMatches)){const w=g[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===w}}else{const A=Gc(g,(w,I)=>(I!==void 0&&(w[I.tokenTypeIdx]=!0,Xs(I.categoryMatches,b=>{w[b]=!0})),w),{});return function(){const w=this.LA_FAST(1);return A[w.tokenTypeIdx]===!0}}}return function(){const p=ao.call(this,s,u,Eu,o);return typeof p=="object"?!1:p===0}}}function Au(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 dT(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=uT(t.decisionStates[n],n);return r}function ao(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=$T(i.atnStartState);a=kh(i,wh(o)),i.start=a}return hT.apply(this,[i,a,r,n])}function hT(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA_FAST(a++);for(;;){let l=RT(i,o);if(l===void 0&&(l=pT.apply(this,[t,i,o,a,r,n])),l===os)return TT(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function pT(t,e,r,n,i,a){const s=vT(e.configs,r,i);if(s.size===0)return $u(t,e,r,os),os;let o=wh(s);const l=AT(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(kT(s)){const c=Op(s.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,mT.apply(this,[t,n,s.alts,a])}return o=$u(t,e,r,o),o}function mT(t,e,r,n){const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=gT({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function gT(t){const e=Gt(t.prefixPath,i=>an(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${yT(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 yT(t){if(t instanceof ze)return"SUBRULE";if(t instanceof De)return"OPTION";if(t instanceof qe)return"OR";if(t instanceof Ze)return"AT_LEAST_ONE";if(t instanceof Qe)return"AT_LEAST_ONE_SEP";if(t instanceof Ve)return"MANY_SEP";if(t instanceof Te)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}function TT(t,e,r){const n=Gp(e.configs.elements,a=>a.state.transitions),i=jp(n.filter(a=>a instanceof kc).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function RT(t,e){return t.edges[e.tokenTypeIdx]}function vT(t,e,r){const n=new Wo,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ji){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const c=s.state.transitions[l],u=ET(c,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Wo;for(const s of n.elements)ls(s,a)}if(i.length>0&&!ST(a))for(const s of i)a.add(s);return a}function ET(t,e){if(t instanceof kc&&Qd(e,t.tokenType))return t.target}function AT(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 wh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function $u(t,e,r,n){return n=kh(t,n),e.edges[r.tokenTypeIdx]=n,n}function kh(t,e){if(e===os)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 $T(t){const e=new Wo,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};ls(a,e)}return e}function ls(t,e){const r=t.state;if(r.type===Ji){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};ls(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=CT(t,a);s!==void 0&&ls(s,e)}}function CT(t,e){if(e instanceof vh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof bc){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function ST(t){for(const e of t.elements)if(e.state.type===Ji)return!0;return!1}function wT(t){for(const e of t.elements)if(e.state.type!==Ji)return!1;return!0}function kT(t){if(wT(t))return!0;const e=bT(t.elements);return NT(e)&&!_T(e)}function bT(t){const e=new Map;for(const r of t){const n=Ch(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function NT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function _T(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Ko;(function(t){function e(r){return typeof r=="string"}t.is=e})(Ko||(Ko={}));var cs;(function(t){function e(r){return typeof r=="string"}t.is=e})(cs||(cs={}));var Vo;(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})(Vo||(Vo={}));var Pi;(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})(Pi||(Pi={}));var J;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Pi.MAX_VALUE),i===Number.MAX_VALUE&&(i=Pi.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})(J||(J={}));var V;(function(t){function e(n,i,a,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(a)&&v.uinteger(s))return{start:J.create(n,i),end:J.create(a,s)};if(J.is(n)&&J.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)&&J.is(i.start)&&J.is(i.end)}t.is=r})(V||(V={}));var Oi;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&V.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(Oi||(Oi={}));var qo;(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)&&V.is(i.targetRange)&&v.string(i.targetUri)&&V.is(i.targetSelectionRange)&&(V.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(qo||(qo={}));var us;(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})(us||(us={}));var Ho;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&V.is(i.range)&&us.is(i.color)}t.is=r})(Ho||(Ho={}));var Xo;(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)||vt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,vt.is))}t.is=r})(Xo||(Xo={}));var Yo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Yo||(Yo={}));var Jo;(function(t){function e(n,i,a,s,o,l){const c={startLine:n,endLine:i};return v.defined(a)&&(c.startCharacter=a),v.defined(s)&&(c.endCharacter=s),v.defined(o)&&(c.kind=o),v.defined(l)&&(c.collapsedText=l),c}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})(Jo||(Jo={}));var fs;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Oi.is(i.location)&&v.string(i.message)}t.is=r})(fs||(fs={}));var Zo;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Zo||(Zo={}));var Qo;(function(t){t.Unnecessary=1,t.Deprecated=2})(Qo||(Qo={}));var el;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(el||(el={}));var Li;(function(t){function e(n,i,a,s,o,l){let c={range:n,message:i};return v.defined(a)&&(c.severity=a),v.defined(s)&&(c.code=s),v.defined(o)&&(c.source=o),v.defined(l)&&(c.relatedInformation=l),c}t.create=e;function r(n){var i;let a=n;return v.defined(a)&&V.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,fs.is))}t.is=r})(Li||(Li={}));var Ir;(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})(Ir||(Ir={}));var vt;(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)&&V.is(s.range)}t.is=i})(vt||(vt={}));var wr;(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})(wr||(wr={}));var xe;(function(t){function e(r){const n=r;return v.string(n)}t.is=e})(xe||(xe={}));var Ft;(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 vt.is(s)&&(wr.is(s.annotationId)||xe.is(s.annotationId))}t.is=i})(Ft||(Ft={}));var xi;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Di.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(xi||(xi={}));var bn;(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||xe.is(i.annotationId))}t.is=r})(bn||(bn={}));var Nn;(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||xe.is(i.annotationId))}t.is=r})(Nn||(Nn={}));var _n;(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||xe.is(i.annotationId))}t.is=r})(_n||(_n={}));var ds;(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)?bn.is(i)||Nn.is(i)||_n.is(i):xi.is(i)))}t.is=e})(ds||(ds={}));class $a{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=vt.insert(e,r):xe.is(n)?(a=n,i=Ft.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=Ft.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=vt.replace(e,r):xe.is(n)?(a=n,i=Ft.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=Ft.replace(e,r,a)),this.edits.push(i),a!==void 0)return a}delete(e,r){let n,i;if(r===void 0?n=vt.del(e):xe.is(r)?(i=r,n=Ft.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=Ft.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 Cu{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(xe.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 IT{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Cu(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(xi.is(r)){const n=new $a(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new $a(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(Di.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 $a(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 $a(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Cu,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;wr.is(r)||xe.is(r)?i=r:n=r;let a,s;if(i===void 0?a=bn.create(e,n):(s=xe.is(i)?i:this._changeAnnotations.manage(i),a=bn.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;wr.is(n)||xe.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Nn.create(e,r,i):(o=xe.is(a)?a:this._changeAnnotations.manage(a),s=Nn.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;wr.is(r)||xe.is(r)?i=r:n=r;let a,s;if(i===void 0?a=_n.create(e,n):(s=xe.is(i)?i:this._changeAnnotations.manage(i),a=_n.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var tl;(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})(tl||(tl={}));var rl;(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})(rl||(rl={}));var Di;(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})(Di||(Di={}));var nl;(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})(nl||(nl={}));var hs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(hs||(hs={}));var In;(function(t){function e(r){const n=r;return v.objectLiteral(r)&&hs.is(n.kind)&&v.string(n.value)}t.is=e})(In||(In={}));var il;(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})(il||(il={}));var al;(function(t){t.PlainText=1,t.Snippet=2})(al||(al={}));var sl;(function(t){t.Deprecated=1})(sl||(sl={}));var ol;(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)&&V.is(i.insert)&&V.is(i.replace)}t.is=r})(ol||(ol={}));var ll;(function(t){t.asIs=1,t.adjustIndentation=2})(ll||(ll={}));var cl;(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})(cl||(cl={}));var ul;(function(t){function e(r){return{label:r}}t.create=e})(ul||(ul={}));var fl;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(fl||(fl={}));var Mi;(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})(Mi||(Mi={}));var dl;(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(In.is(n.contents)||Mi.is(n.contents)||v.typedArray(n.contents,Mi.is))&&(r.range===void 0||V.is(r.range))}t.is=e})(dl||(dl={}));var hl;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(hl||(hl={}));var pl;(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})(pl||(pl={}));var ml;(function(t){t.Text=1,t.Read=2,t.Write=3})(ml||(ml={}));var gl;(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(gl||(gl={}));var yl;(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})(yl||(yl={}));var Tl;(function(t){t.Deprecated=1})(Tl||(Tl={}));var Rl;(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})(Rl||(Rl={}));var vl;(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})(vl||(vl={}));var El;(function(t){function e(n,i,a,s,o,l){let c={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(c.children=l),c}t.create=e;function r(n){let i=n;return i&&v.string(i.name)&&v.number(i.kind)&&V.is(i.range)&&V.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})(El||(El={}));var Al;(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"})(Al||(Al={}));var Fi;(function(t){t.Invoked=1,t.Automatic=2})(Fi||(Fi={}));var $l;(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,Li.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Fi.Invoked||i.triggerKind===Fi.Automatic)}t.is=r})($l||($l={}));var Cl;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Ir.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,Li.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ir.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||ds.is(i.edit))}t.is=r})(Cl||(Cl={}));var Sl;(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)&&V.is(i.range)&&(v.undefined(i.command)||Ir.is(i.command))}t.is=r})(Sl||(Sl={}));var wl;(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})(wl||(wl={}));var kl;(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)&&V.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(kl||(kl={}));var bl;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&V.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(bl||(bl={}));var Nl;(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"})(Nl||(Nl={}));var _l;(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"})(_l||(_l={}));var Il;(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})(Il||(Il={}));var Pl;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&V.is(i.range)&&v.string(i.text)}t.is=r})(Pl||(Pl={}));var Ol;(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&&V.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(Ol||(Ol={}));var Ll;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&V.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Ll||(Ll={}));var xl;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return v.defined(i)&&V.is(n.stoppedLocation)}t.is=r})(xl||(xl={}));var ps;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(ps||(ps={}));var ms;(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)||In.is(i.tooltip))&&(i.location===void 0||Oi.is(i.location))&&(i.command===void 0||Ir.is(i.command))}t.is=r})(ms||(ms={}));var Dl;(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)&&J.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,ms.is))&&(i.kind===void 0||ps.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,vt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||In.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Dl||(Dl={}));var Ml;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Ml||(Ml={}));var Fl;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(Fl||(Fl={}));var Gl;(function(t){function e(r){return{items:r}}t.create=e})(Gl||(Gl={}));var jl;(function(t){t.Invoked=0,t.Automatic=1})(jl||(jl={}));var zl;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(zl||(zl={}));var Ul;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Ul||(Ul={}));var Bl;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&cs.is(n.uri)&&v.string(n.name)}t.is=e})(Bl||(Bl={}));const PT=[`
117
+ `,`\r
118
+ `,"\r"];var Wl;(function(t){function e(a,s,o,l){return new OT(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,(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=o.length;for(let u=l.length-1;u>=0;u--){let d=l[u],p=a.offsetAt(d.range.start),g=a.offsetAt(d.range.end);if(g<=c)o=o.substring(0,p)+d.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");c=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),c=a.slice(o);i(l,s),i(c,s);let u=0,d=0,p=0;for(;u<l.length&&d<c.length;)s(l[u],c[d])<=0?a[p++]=l[u++]:a[p++]=c[d++];for(;u<l.length;)a[p++]=l[u++];for(;d<c.length;)a[p++]=c[d++];return a}})(Wl||(Wl={}));let OT=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 J.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 J.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(g){return typeof g<"u"}t.defined=r;function n(g){return typeof g>"u"}t.undefined=n;function i(g){return g===!0||g===!1}t.boolean=i;function a(g){return e.call(g)==="[object String]"}t.string=a;function s(g){return e.call(g)==="[object Number]"}t.number=s;function o(g,A,w){return e.call(g)==="[object Number]"&&A<=g&&g<=w}t.numberRange=o;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=l;function c(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=c;function u(g){return e.call(g)==="[object Function]"}t.func=u;function d(g){return g!==null&&typeof g=="object"}t.objectLiteral=d;function p(g,A){return Array.isArray(g)&&g.every(A)}t.typedArray=p})(v||(v={}));const LT=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Ft},get ChangeAnnotation(){return wr},get ChangeAnnotationIdentifier(){return xe},get CodeAction(){return Cl},get CodeActionContext(){return $l},get CodeActionKind(){return Al},get CodeActionTriggerKind(){return Fi},get CodeDescription(){return el},get CodeLens(){return Sl},get Color(){return us},get ColorInformation(){return Ho},get ColorPresentation(){return Xo},get Command(){return Ir},get CompletionItem(){return ul},get CompletionItemKind(){return il},get CompletionItemLabelDetails(){return cl},get CompletionItemTag(){return sl},get CompletionList(){return fl},get CreateFile(){return bn},get DeleteFile(){return _n},get Diagnostic(){return Li},get DiagnosticRelatedInformation(){return fs},get DiagnosticSeverity(){return Zo},get DiagnosticTag(){return Qo},get DocumentHighlight(){return gl},get DocumentHighlightKind(){return ml},get DocumentLink(){return kl},get DocumentSymbol(){return El},get DocumentUri(){return Ko},EOL:PT,get FoldingRange(){return Jo},get FoldingRangeKind(){return Yo},get FormattingOptions(){return wl},get Hover(){return dl},get InlayHint(){return Dl},get InlayHintKind(){return ps},get InlayHintLabelPart(){return ms},get InlineCompletionContext(){return Ul},get InlineCompletionItem(){return Fl},get InlineCompletionList(){return Gl},get InlineCompletionTriggerKind(){return jl},get InlineValueContext(){return xl},get InlineValueEvaluatableExpression(){return Ll},get InlineValueText(){return Pl},get InlineValueVariableLookup(){return Ol},get InsertReplaceEdit(){return ol},get InsertTextFormat(){return al},get InsertTextMode(){return ll},get Location(){return Oi},get LocationLink(){return qo},get MarkedString(){return Mi},get MarkupContent(){return In},get MarkupKind(){return hs},get OptionalVersionedTextDocumentIdentifier(){return Di},get ParameterInformation(){return hl},get Position(){return J},get Range(){return V},get RenameFile(){return Nn},get SelectedCompletionInfo(){return zl},get SelectionRange(){return bl},get SemanticTokenModifiers(){return _l},get SemanticTokenTypes(){return Nl},get SemanticTokens(){return Il},get SignatureInformation(){return pl},get StringValue(){return Ml},get SymbolInformation(){return Rl},get SymbolKind(){return yl},get SymbolTag(){return Tl},get TextDocument(){return Wl},get TextDocumentEdit(){return xi},get TextDocumentIdentifier(){return tl},get TextDocumentItem(){return nl},get TextEdit(){return vt},get URI(){return cs},get VersionedTextDocumentIdentifier(){return rl},WorkspaceChange:IT,get WorkspaceEdit(){return ds},get WorkspaceFolder(){return Bl},get WorkspaceSymbol(){return vl},get integer(){return Vo},get uinteger(){return Pi}},Symbol.toStringTag,{value:"Module"}));class xT{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Nh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Ic;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Kl(e.startOffset,e.image.length,Oo(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 Kl(a.startOffset,a.image.length,Oo(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==null?void 0:n.content.length)===0&&this.removeNode(n)}}class bh{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.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 Kl extends bh{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 Ic extends bh{constructor(){super(...arguments),this.content=new Pc(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.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:J.create(0,0),end:J.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 Pc extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Pc.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 Nh extends Ic{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Vl=Symbol("Datatype");function so(t){return t.$type===Vl}const Su="​",_h=t=>t.endsWith(Su)?t:t+Su;class Ih{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new jT(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Oh(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 DT extends Ih{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new xT,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;Ja(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(_h(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Kt(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 Ja(e)?Ii(e):e.fragment?void 0:Md(e)?Vl:Ii(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,So(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===Vl?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),c=this.current;if(o){const u=br(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,l)}else if(so(c)){let u=i.image;br(n)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}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(so(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)):so(e)?this.converter.convert(e.value,e.$cstNode):(Bp(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 w=0;w<i.length;w++){const I=i[w],b=r.get(I)??{precedence:1/0,rightAssoc:!1};b.precedence>s?(s=b.precedence,a=w):b.precedence===s&&(b.rightAssoc||(a=w))}const o=i.slice(0,a),l=i.slice(a+1),c=n.slice(0,a+1),u=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:l},g=this.constructInfix(d,r),A=this.constructInfix(p,r);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[a],right:A}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Cs(e,kr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&ws(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 MT{buildMismatchTokenMessage(e){return rn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return rn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return rn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return rn.buildEarlyExitMessage(e)}}class Ph extends MT{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 FT extends Ih{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(_h(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 GT={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Ph};class Oh extends Wy{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...GT,lookaheadStrategy:n?new Sc({maxLookahead:r.maxLookahead}):new fT({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 jT extends Oh{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 Lh(t,e,r){return zT({parser:e,tokens:r,ruleNames:new Map},t),e}function zT(t,e){const r=Pd(e,!1),n=ue(e.rules).filter(Kt).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,Pr(s,a.definition))}const i=ue(e.rules).filter(Ja).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,UT(t,a))}function UT(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(Vt(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(g=>g.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}},c={...a,$container:s};s.elements.push(l,c);const d=n.map(g=>t.tokens[g.value]).map((g,A)=>({ALT:()=>t.parser.consume(A,g,l)}));let p;return g=>{p??(p=Oc(t,r)),t.parser.subrule(0,p,!1,a,g),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,d),t.parser.subrule(1,p,!1,c,g)}})}}function Pr(t,e,r=!1){let n;if(br(e))n=XT(t,e);else if(Ss(e))n=BT(t,e);else if(kr(e))n=Pr(t,e.terminal);else if(ws(e))n=xh(t,e);else if(Nr(e))n=WT(t,e);else if(Sd(e))n=VT(t,e);else if(kd(e))n=qT(t,e);else if(yc(e))n=HT(t,e);else if(Xp(e)){const i=t.consume++;n=()=>t.parser.consume(i,lr,e)}else throw new Nd(e.$cstNode,`Unexpected element type: ${e.$type}`);return Dh(t,r?void 0:gs(e),n,e.cardinality)}function BT(t,e){const r=Ii(e);return()=>t.parser.action(r,e)}function WT(t,e){const r=e.rule.ref;if(Ki(r)){const n=t.subrule++,i=Kt(r)&&r.fragment,a=e.arguments.length>0?KT(r,e.arguments):()=>({});let s;return o=>{s??(s=Oc(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Vt(r)){const n=t.consume++,i=ql(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Vi();else throw new Nd(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function KT(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Tt(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=>Tt(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 Tt(t){if(Hp(t)){const e=Tt(t.left),r=Tt(t.right);return n=>e(n)||r(n)}else if(qp(t)){const e=Tt(t.left),r=Tt(t.right);return n=>e(n)&&r(n)}else if(Zp(t)){const e=Tt(t.value);return r=>!e(r)}else if(Qp(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Kp(t)){const e=!!t.true;return()=>e}Vi()}function VT(t,e){if(e.elements.length===1)return Pr(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Pr(t,i,!0)},s=gs(i);s&&(a.GATE=Tt(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 qT(t,e){if(e.elements.length===1)return Pr(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Pr(t,o,!0)},c=gs(o);c&&(l.GATE=Tt(c)),r.push(l)}const n=t.or++,i=(o,l)=>{const c=l.getRuleStack().join("-");return`uGroup_${o}_${c}`},a=o=>t.parser.alternatives(n,r.map((l,c)=>{const u={ALT:()=>!0},d=t.parser;u.ALT=()=>{if(l.ALT(o),!d.isRecording()){const g=i(n,d);d.unorderedGroups.get(g)||d.unorderedGroups.set(g,[]);const A=d.unorderedGroups.get(g);typeof(A==null?void 0:A[c])>"u"&&(A[c]=!0)}};const p=l.GATE;return p?u.GATE=()=>p(o):u.GATE=()=>{const g=d.unorderedGroups.get(i(n,d));return!(g!=null&&g[c])},u})),s=Dh(t,gs(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function HT(t,e){const r=e.elements.map(n=>Pr(t,n));return n=>r.forEach(i=>i(n))}function gs(t){if(yc(t))return t.guardCondition}function xh(t,e,r=e.terminal){if(r)if(Nr(r)&&Kt(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Oc(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Nr(r)&&Vt(r.rule.ref)){const n=t.consume++,i=ql(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(br(r)){const n=t.consume++,i=ql(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 n=xd(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Ii(e.type.ref));return xh(t,e,i)}}function XT(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 Dh(t,e,r,n){const i=e&&Tt(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:vu(),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:vu(),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 Vi()}function Oc(t,e){const r=YT(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function YT(t,e){if(Ki(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Kt(n);)(yc(n)||Sd(n)||kd(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 ql(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function JT(t){const e=t.Grammar,r=t.parser.Lexer,n=new FT(t);return Lh(e,n,r.definition),n.finalize(),n}function ZT(t){const e=QT(t);return e.finalize(),e}function QT(t){const e=t.Grammar,r=t.parser.Lexer,n=new DT(t);return Lh(e,n,r.definition)}class Mh{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ue(Pd(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(Vt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Rc(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=Id(r)?We.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(Ki).flatMap(i=>Wi(i).filter(br)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&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(bs(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&$m("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class Fh{convert(e,r){let n=r.grammarSource;if(ws(n)&&(n=km(n)),Nr(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){var i;switch(e.name.toUpperCase()){case"INT":return Dt.convertInt(r);case"STRING":return Dt.convertString(r);case"ID":return Dt.convertID(r)}switch((i=Lm(e))==null?void 0:i.toLowerCase()){case"number":return Dt.convertNumber(r);case"boolean":return Dt.convertBoolean(r);case"bigint":return Dt.convertBigint(r);case"date":return Dt.convertDate(r);default:return r}}}var Dt;(function(t){function e(c){let u="";for(let d=1;d<c.length-1;d++){const p=c.charAt(d);if(p==="\\"){const g=c.charAt(++d);u+=r(g)}else u+=p}return u}t.convertString=e;function r(c){switch(c){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 c}}function n(c){return c.charAt(0)==="^"?c.substring(1):c}t.convertID=n;function i(c){return parseInt(c)}t.convertInt=i;function a(c){return BigInt(c)}t.convertBigint=a;function s(c){return new Date(c)}t.convertDate=s;function o(c){return Number(c)}t.convertNumber=o;function l(c){return c.toLowerCase()==="true"}t.convertBoolean=l})(Dt||(Dt={}));var ur={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});let Hl;function Xl(){if(Hl===void 0)throw new Error("No runtime abstraction layer installed");return Hl}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Hl=r}t.install=e})(Xl||(Xl={}));qt.default=Xl;var we={};Object.defineProperty(we,"__esModule",{value:!0});we.stringArray=we.array=we.func=we.error=we.number=we.string=we.boolean=void 0;function eR(t){return t===!0||t===!1}we.boolean=eR;function Gh(t){return typeof t=="string"||t instanceof String}we.string=Gh;function tR(t){return typeof t=="number"||t instanceof Number}we.number=tR;function rR(t){return t instanceof Error}we.error=rR;function nR(t){return typeof t=="function"}we.func=nR;function jh(t){return Array.isArray(t)}we.array=jh;function iR(t){return jh(t)&&t.every(e=>Gh(e))}we.stringArray=iR;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});var zh=Et.Emitter=Et.Event=void 0;const aR=qt;var wu;(function(t){const e={dispose(){}};t.None=function(){return e}})(wu||(Et.Event=wu={}));class sR{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,a=this._callbacks.length;i<a;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,s=n.length;a<s;a++)try{r.push(n[a].apply(i[a],e))}catch(o){(0,aR.default)().console.error(o)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class Ds{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new sR),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=Ds._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}zh=Et.Emitter=Ds;Ds._noop=function(){};var de;Object.defineProperty(ur,"__esModule",{value:!0});var Lc=ur.CancellationTokenSource=de=ur.CancellationToken=void 0;const oR=qt,lR=we,Yl=Et;var ys;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Yl.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Yl.Event.None});function e(r){const n=r;return n&&(n===t.None||n===t.Cancelled||lR.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(ys||(de=ur.CancellationToken=ys={}));const cR=Object.freeze(function(t,e){const r=(0,oR.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}});class ku{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?cR:(this._emitter||(this._emitter=new Yl.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class uR{get token(){return this._token||(this._token=new ku),this._token}cancel(){this._token?this._token.cancel():this._token=ys.Cancelled}dispose(){this._token?this._token instanceof ku&&this._token.dispose():this._token=ys.None}}Lc=ur.CancellationTokenSource=uR;function fR(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Va=0,dR=10;function hR(){return Va=performance.now(),new Lc}const nn=Symbol("OperationCancelled");function Ms(t){return t===nn}async function je(t){if(t===de.None)return;const e=performance.now();if(e-Va>=dR&&(Va=e,await fR(),Va=performance.now()),t.isCancellationRequested)throw nn}class xc{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Gi{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(Gi.isIncremental(n)){const i=Bh(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 c=this._lineOffsets;const u=bu(n.text,!1,a);if(l-o===u.length)for(let p=0,g=u.length;p<g;p++)c[p+o+1]=u[p];else u.length<1e4?c.splice(o+1,l-o,...u):this._lineOffsets=c=c.slice(0,o+1).concat(u,c.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let p=o+1+u.length,g=c.length;p<g;p++)c[p]=c[p]+d}else if(Gi.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=bu(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&&Uh(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 Jl;(function(t){function e(i,a,s,o){return new Gi(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Gi)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=Zl(a.map(pR),(u,d)=>{const p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p});let l=0;const c=[];for(const u of o){const d=i.offsetAt(u.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(s.substring(l,d)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(s.substr(l)),c.join("")}t.applyEdits=n})(Jl||(Jl={}));function Zl(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Zl(n,e),Zl(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 bu(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);Uh(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Uh(t){return t===13||t===10}function Bh(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 pR(t){const e=Bh(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Wh;(()=>{var t={975:S=>{function R(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,T){for(var E,P="",D=0,O=-1,j=0,F=0;F<=y.length;++F){if(F<y.length)E=y.charCodeAt(F);else{if(E===47)break;E=47}if(E===47){if(!(O===F-1||j===1))if(O!==F-1&&j===2){if(P.length<2||D!==2||P.charCodeAt(P.length-1)!==46||P.charCodeAt(P.length-2)!==46){if(P.length>2){var re=P.lastIndexOf("/");if(re!==P.length-1){re===-1?(P="",D=0):D=(P=P.slice(0,re)).length-1-P.lastIndexOf("/"),O=F,j=0;continue}}else if(P.length===2||P.length===1){P="",D=0,O=F,j=0;continue}}T&&(P.length>0?P+="/..":P="..",D=2)}else P.length>0?P+="/"+y.slice(O+1,F):P=y.slice(O+1,F),D=F-O-1;O=F,j=0}else E===46&&j!==-1?++j:j=-1}return P}var $={resolve:function(){for(var y,T="",E=!1,P=arguments.length-1;P>=-1&&!E;P--){var D;P>=0?D=arguments[P]:(y===void 0&&(y=process.cwd()),D=y),R(D),D.length!==0&&(T=D+"/"+T,E=D.charCodeAt(0)===47)}return T=m(T,!E),E?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(R(y),y.length===0)return".";var T=y.charCodeAt(0)===47,E=y.charCodeAt(y.length-1)===47;return(y=m(y,!T)).length!==0||T||(y="."),y.length>0&&E&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return R(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,T=0;T<arguments.length;++T){var E=arguments[T];R(E),E.length>0&&(y===void 0?y=E:y+="/"+E)}return y===void 0?".":$.normalize(y)},relative:function(y,T){if(R(y),R(T),y===T||(y=$.resolve(y))===(T=$.resolve(T)))return"";for(var E=1;E<y.length&&y.charCodeAt(E)===47;++E);for(var P=y.length,D=P-E,O=1;O<T.length&&T.charCodeAt(O)===47;++O);for(var j=T.length-O,F=D<j?D:j,re=-1,z=0;z<=F;++z){if(z===F){if(j>F){if(T.charCodeAt(O+z)===47)return T.slice(O+z+1);if(z===0)return T.slice(O+z)}else D>F&&(y.charCodeAt(E+z)===47?re=z:z===0&&(re=0));break}var ee=y.charCodeAt(E+z);if(ee!==T.charCodeAt(O+z))break;ee===47&&(re=z)}var Ie="";for(z=E+re+1;z<=P;++z)z!==P&&y.charCodeAt(z)!==47||(Ie.length===0?Ie+="..":Ie+="/..");return Ie.length>0?Ie+T.slice(O+re):(O+=re,T.charCodeAt(O)===47&&++O,T.slice(O))},_makeLong:function(y){return y},dirname:function(y){if(R(y),y.length===0)return".";for(var T=y.charCodeAt(0),E=T===47,P=-1,D=!0,O=y.length-1;O>=1;--O)if((T=y.charCodeAt(O))===47){if(!D){P=O;break}}else D=!1;return P===-1?E?"/":".":E&&P===1?"//":y.slice(0,P)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');R(y);var E,P=0,D=-1,O=!0;if(T!==void 0&&T.length>0&&T.length<=y.length){if(T.length===y.length&&T===y)return"";var j=T.length-1,F=-1;for(E=y.length-1;E>=0;--E){var re=y.charCodeAt(E);if(re===47){if(!O){P=E+1;break}}else F===-1&&(O=!1,F=E+1),j>=0&&(re===T.charCodeAt(j)?--j==-1&&(D=E):(j=-1,D=F))}return P===D?D=F:D===-1&&(D=y.length),y.slice(P,D)}for(E=y.length-1;E>=0;--E)if(y.charCodeAt(E)===47){if(!O){P=E+1;break}}else D===-1&&(O=!1,D=E+1);return D===-1?"":y.slice(P,D)},extname:function(y){R(y);for(var T=-1,E=0,P=-1,D=!0,O=0,j=y.length-1;j>=0;--j){var F=y.charCodeAt(j);if(F!==47)P===-1&&(D=!1,P=j+1),F===46?T===-1?T=j:O!==1&&(O=1):T!==-1&&(O=-1);else if(!D){E=j+1;break}}return T===-1||P===-1||O===0||O===1&&T===P-1&&T===E+1?"":y.slice(T,P)},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(T,E){var P=E.dir||E.root,D=E.base||(E.name||"")+(E.ext||"");return P?P===E.root?P+D:P+"/"+D:D}(0,y)},parse:function(y){R(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var E,P=y.charCodeAt(0),D=P===47;D?(T.root="/",E=1):E=0;for(var O=-1,j=0,F=-1,re=!0,z=y.length-1,ee=0;z>=E;--z)if((P=y.charCodeAt(z))!==47)F===-1&&(re=!1,F=z+1),P===46?O===-1?O=z:ee!==1&&(ee=1):O!==-1&&(ee=-1);else if(!re){j=z+1;break}return O===-1||F===-1||ee===0||ee===1&&O===F-1&&O===j+1?F!==-1&&(T.base=T.name=j===0&&D?y.slice(1,F):y.slice(j,F)):(j===0&&D?(T.name=y.slice(1,O),T.base=y.slice(1,F)):(T.name=y.slice(j,O),T.base=y.slice(j,F)),T.ext=y.slice(O,F)),j>0?T.dir=y.slice(0,j-1):D&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,S.exports=$}},e={};function r(S){var R=e[S];if(R!==void 0)return R.exports;var m=e[S]={exports:{}};return t[S](m,m.exports,r),m.exports}r.d=(S,R)=>{for(var m in R)r.o(R,m)&&!r.o(S,m)&&Object.defineProperty(S,m,{enumerable:!0,get:R[m]})},r.o=(S,R)=>Object.prototype.hasOwnProperty.call(S,R),r.r=S=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>p,Utils:()=>oe}),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(S,R){if(!S.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${S.authority}", path: "${S.path}", query: "${S.query}", fragment: "${S.fragment}"}`);if(S.scheme&&!a.test(S.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(S.path){if(S.authority){if(!s.test(S.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(S.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",u="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{constructor(R,m,$,y,T,E=!1){Qt(this,"scheme");Qt(this,"authority");Qt(this,"path");Qt(this,"query");Qt(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||c,this.authority=R.authority||c,this.path=R.path||c,this.query=R.query||c,this.fragment=R.fragment||c):(this.scheme=function(P,D){return P||D?P:"file"}(R,E),this.authority=m||c,this.path=function(P,D){switch(P){case"https":case"http":case"file":D?D[0]!==u&&(D=u+D):D=u}return D}(this.scheme,$||c),this.query=y||c,this.fragment=T||c,l(this,E))}static isUri(R){return R instanceof p||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return L(this)}with(R){if(!R)return this;let{scheme:m,authority:$,path:y,query:T,fragment:E}=R;return m===void 0?m=this.scheme:m===null&&(m=c),$===void 0?$=this.authority:$===null&&($=c),y===void 0?y=this.path:y===null&&(y=c),T===void 0?T=this.query:T===null&&(T=c),E===void 0?E=this.fragment:E===null&&(E=c),m===this.scheme&&$===this.authority&&y===this.path&&T===this.query&&E===this.fragment?this:new A(m,$,y,T,E)}static parse(R,m=!1){const $=d.exec(R);return $?new A($[2]||c,Z($[4]||c),Z($[5]||c),Z($[7]||c),Z($[9]||c),m):new A(c,c,c,c,c)}static file(R){let m=c;if(i&&(R=R.replace(/\\/g,u)),R[0]===u&&R[1]===u){const $=R.indexOf(u,2);$===-1?(m=R.substring(2),R=u):(m=R.substring(2,$),R=R.substring($)||u)}return new A("file",m,R,c,c)}static from(R){const m=new A(R.scheme,R.authority,R.path,R.query,R.fragment);return l(m,!0),m}toString(R=!1){return N(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof p)return R;{const m=new A(R);return m._formatted=R.external,m._fsPath=R._sep===g?R.fsPath:null,m}}return R}}const g=i?1:void 0;class A extends p{constructor(){super(...arguments);Qt(this,"_formatted",null);Qt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=L(this)),this._fsPath}toString(m=!1){return m?N(this,!0):(this._formatted||(this._formatted=N(this,!1)),this._formatted)}toJSON(){const m={$mid:1};return this._fsPath&&(m.fsPath=this._fsPath,m._sep=g),this._formatted&&(m.external=this._formatted),this.path&&(m.path=this.path),this.scheme&&(m.scheme=this.scheme),this.authority&&(m.authority=this.authority),this.query&&(m.query=this.query),this.fragment&&(m.fragment=this.fragment),m}}const w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function I(S,R,m){let $,y=-1;for(let T=0;T<S.length;T++){const E=S.charCodeAt(T);if(E>=97&&E<=122||E>=65&&E<=90||E>=48&&E<=57||E===45||E===46||E===95||E===126||R&&E===47||m&&E===91||m&&E===93||m&&E===58)y!==-1&&($+=encodeURIComponent(S.substring(y,T)),y=-1),$!==void 0&&($+=S.charAt(T));else{$===void 0&&($=S.substr(0,T));const P=w[E];P!==void 0?(y!==-1&&($+=encodeURIComponent(S.substring(y,T)),y=-1),$+=P):y===-1&&(y=T)}}return y!==-1&&($+=encodeURIComponent(S.substring(y))),$!==void 0?$:S}function b(S){let R;for(let m=0;m<S.length;m++){const $=S.charCodeAt(m);$===35||$===63?(R===void 0&&(R=S.substr(0,m)),R+=w[$]):R!==void 0&&(R+=S[m])}return R!==void 0?R:S}function L(S,R){let m;return m=S.authority&&S.path.length>1&&S.scheme==="file"?`//${S.authority}${S.path}`:S.path.charCodeAt(0)===47&&(S.path.charCodeAt(1)>=65&&S.path.charCodeAt(1)<=90||S.path.charCodeAt(1)>=97&&S.path.charCodeAt(1)<=122)&&S.path.charCodeAt(2)===58?S.path[1].toLowerCase()+S.path.substr(2):S.path,i&&(m=m.replace(/\//g,"\\")),m}function N(S,R){const m=R?b:I;let $="",{scheme:y,authority:T,path:E,query:P,fragment:D}=S;if(y&&($+=y,$+=":"),(T||y==="file")&&($+=u,$+=u),T){let O=T.indexOf("@");if(O!==-1){const j=T.substr(0,O);T=T.substr(O+1),O=j.lastIndexOf(":"),O===-1?$+=m(j,!1,!1):($+=m(j.substr(0,O),!1,!1),$+=":",$+=m(j.substr(O+1),!1,!0)),$+="@"}T=T.toLowerCase(),O=T.lastIndexOf(":"),O===-1?$+=m(T,!1,!0):($+=m(T.substr(0,O),!1,!0),$+=T.substr(O))}if(E){if(E.length>=3&&E.charCodeAt(0)===47&&E.charCodeAt(2)===58){const O=E.charCodeAt(1);O>=65&&O<=90&&(E=`/${String.fromCharCode(O+32)}:${E.substr(3)}`)}else if(E.length>=2&&E.charCodeAt(1)===58){const O=E.charCodeAt(0);O>=65&&O<=90&&(E=`${String.fromCharCode(O+32)}:${E.substr(2)}`)}$+=m(E,!0,!1)}return P&&($+="?",$+=m(P,!1,!1)),D&&($+="#",$+=R?D:I(D,!1,!1)),$}function x(S){try{return decodeURIComponent(S)}catch{return S.length>3?S.substr(0,3)+x(S.substr(3)):S}}const q=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Z(S){return S.match(q)?S.replace(q,R=>x(R)):S}var Q=r(975);const he=Q.posix||Q,ve="/";var oe;(function(S){S.joinPath=function(R,...m){return R.with({path:he.join(R.path,...m)})},S.resolvePath=function(R,...m){let $=R.path,y=!1;$[0]!==ve&&($=ve+$,y=!0);let T=he.resolve($,...m);return y&&T[0]===ve&&!R.authority&&(T=T.substring(1)),R.with({path:T})},S.dirname=function(R){if(R.path.length===0||R.path===ve)return R;let m=he.dirname(R.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),R.with({path:m})},S.basename=function(R){return he.basename(R.path)},S.extname=function(R){return he.extname(R.path)}})(oe||(oe={})),Wh=n})();const{URI:ht,Utils:ui}=Wh;var Je;(function(t){t.basename=ui.basename,t.dirname=ui.dirname,t.extname=ui.extname,t.joinPath=ui.joinPath,t.resolvePath=ui.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}t.equals=r;function n(s,o){const l=typeof s=="string"?ht.parse(s).path:s.path,c=typeof o=="string"?ht.parse(o).path:o.path,u=l.split("/").filter(w=>w.length>0),d=c.split("/").filter(w=>w.length>0);if(e){const w=/^[A-Z]:$/;if(u[0]&&w.test(u[0])&&(u[0]=u[0].toLowerCase()),d[0]&&w.test(d[0])&&(d[0]=d[0].toLowerCase()),u[0]!==d[0])return c.substring(1)}let p=0;for(;p<u.length&&u[p]===d[p];p++);const g="../".repeat(u.length-p),A=d.slice(p).join("/");return g+A}t.relative=n;function i(s){return ht.parse(s.toString()).toString()}t.normalize=i;function a(s,o){let l=typeof s=="string"?s:s.path,c=typeof o=="string"?o:o.path;return c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c===l?!0:c.length<l.length||c.charAt(l.length)!=="/"?!1:c.startsWith(l)}t.contains=a})(Je||(Je={}));class mR{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return Je.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!=null&&r.parent&&r.parent.children.delete(r.name)}has(e){var r;return((r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var r;return(r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element}findNode(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:Je.joinPath(ht.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:Je.joinPath(ht.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Je.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 W;(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"})(W||(W={}));class gR{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=de.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??ht.parse(e.uri),de.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return de.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:W.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:W.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=W.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=Jl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class yR{constructor(e){this.documentTrie=new mR,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ue(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,W.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=W.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=W.Changed;return this.documentTrie.delete(r),n}}const Gr=Symbol("RefResolving");class TR{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=de.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of zt(e.parseResult.value))await je(r),Ya(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of zt(e.parseResult.value))await je(r),Ya(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Gr;try{const i=this.getCandidate(e);if(ii(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=Gr;try{const i=this.getCandidates(e),a=[];if(ii(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(Fe(this._ref))return this._ref;if(zp(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=Gr;const o=La(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<W.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o==null||o.references.push(this)}else this._ref===Gr&&a.throwCyclicReferenceError(e,r,i);return Fe(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ii(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=Gr;const o=La(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),c=[];if(ii(l))this._linkingError=l;else for(const u of l){const d=a.loadAstNode(u);d&&c.push({ref:d,$nodeDescription:u})}this._items=c,o==null||o.references.push(this)}else this._items===Gr&&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(ii(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=La(e.container).$document;n&&n.state<W.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 RR(t){return typeof t.name=="string"}class vR{getName(e){if(RR(e))return e.name}getNameNode(e){return Ld(e.$cstNode,"name")}}class ER{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=zt(e.Grammar).some(r=>ws(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Pm(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ft(i)||tr(i))return jc(i);if(Array.isArray(i)){for(const a of i)if((ft(a)||tr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return jc(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||cm(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 Ya(n))if(tr(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=>Je.equals(a.sourceUri,r.documentUri))),n.push(...i),ue(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=jt(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Za(a),local:!0})}}return n}}class ji{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Co.sum(ue(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?ue(r):$d}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 ue(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ue(this.map.keys())}values(){return ue(this.map.values()).flat()}entriesGroupedByKey(){return ue(this.map.entries())}}class Nu{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 AR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=de.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=gc,i=de.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await je(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=de.None){const n=e.parseResult.value,i=new ji;for(const a of Wi(n))await je(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 _u{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0: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 $R{constructor(e,r,n){this.elements=new ji,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0: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?ue(n).concat(this.outerScope.getElements(e)):ue(n)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Kh{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 CR extends Kh{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 SR extends Kh{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 wR extends CR{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 kR{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 wR(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=jt(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 _u(ue(e),r,n)}createScopeForNodes(e,r,n){const i=ue(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new _u(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new $R(this.indexManager.allElements(e)))}}function bR(t){return typeof t.$comment=="string"}function Iu(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class NR{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==null?void 0:r.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=jt(e),JSON.stringify(e,s,r==null?void 0: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}){var l,c,u;if(!this.ignoreProperties.has(e))if(ft(r)){const d=r.ref,p=n?r.$refText:void 0;if(d){const g=jt(d);let A="";this.currentDocument&&this.currentDocument!==g&&(o?A=o(g.uri,d):A=g.uri.toString());const w=this.astNodeLocator.getAstNodePath(d);return{$ref:`${A}#${w}`,$refText:p}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:p}}else if(tr(r)){const d=n?r.$refText:void 0,p=[];for(const g of r.items){const A=g.ref,w=jt(g.ref);let I="";this.currentDocument&&this.currentDocument!==w&&(o?I=o(w.uri,A):I=w.uri.toString());const b=this.astNodeLocator.getAstNodePath(A);p.push(`${I}#${b}`)}return{$refs:p,$refText:d}}else if(Fe(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(c=this.currentDocument)==null?void 0:c.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(u=r.$cstNode)==null?void 0:u.text),s){d??(d={...r});const p=this.commentProvider.getComment(r);p&&(d.$comment=p.replace(/\r/g,""))}return d??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=Nm(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u<c.length;u++){const d=c[u];Iu(d)?c[u]=this.reviveReference(e,l,r,d,n):Fe(d)&&this.linkNode(d,r,n,e,l,u)}else Iu(c)?e[l]=this.reviveReference(e,l,r,c,n):Fe(c)&&this.linkNode(c,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 c=this.getRefNode(n,i.$ref,a.uriConverter);if(Fe(c))return s||(s=this.nameProvider.getName(c)),{$refText:s??"",ref:c};o=c}else if(i.$refs){const c=[];for(const u of i.$refs){const d=this.getRefNode(n,u,a.uriConverter);Fe(d)&&c.push({ref:d})}if(c.length===0)l={$refText:s??"",items:c},o??(o="Could not resolve multi-reference");else return{$refText:s??"",items:c}}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):ht.parse(r),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):ht.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 _R{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0: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){var s,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const r=(o=(s=this.textDocuments)==null?void 0:s.get(e))==null?void 0:o.languageId;if(r!==void 0){const l=this.languageIdMap.get(r);if(l)return l}const n=Je.extname(e),i=Je.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 wi(t){return{code:t}}var Ql;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Ql||(Ql={}));class IR{constructor(e){this.entries=new ji,this.knownCategories=new Set(Ql.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 Vi()}}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(Ms(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=ue(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 PR=Object.freeze({validateNode:!0,validateChildren:!0});class OR{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=de.None){const i=e.parseResult,a=[];if(await je(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ut.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ut.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ut.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Ms(s))throw s;console.error("An error occurred during validation:",s)}return await je(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:oo(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:xR(o),source:this.getSource()};r.push(l)}}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=Oo(i.token);if(a){const s={severity:oo("error"),range:a,message:i.message,data:wi(ut.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ut.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=de.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=de.None){const a=this.validationRegistry.checksBefore;for(const s of a)await je(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=de.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=zt(e).iterator();for(const l of o){s.startSubTask(l.$type);const c=this.validateSingleNodeOptions(l,r);if(c.validateNode)try{const u=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of u)await d(l,n,i)}finally{s.stopSubTask(l.$type)}c.validateChildren||o.prune()}}finally{s.stop()}}else{const s=zt(e).iterator();for(const o of s){await je(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const c=this.validationRegistry.getChecks(o.$type,r.categories);for(const u of c)await u(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return PR}async validateAstAfter(e,r,n,i=de.None){const a=this.validationRegistry.checksAfter;for(const s of a)await je(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:LR(n),severity:oo(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 LR(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Ld(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=_m(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 oo(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 xR(t){switch(t){case"error":return wi(ut.LexingError);case"warning":return wi(ut.LexingWarning);case"info":return wi(ut.LexingInfo);case"hint":return wi(ut.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var ut;(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"})(ut||(ut={}));class DR{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??jt(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=Za(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Za(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class MR{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=de.None){const n=[],i=e.parseResult.value;for(const a of zt(i))await je(r),Ya(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=[];ft(r)&&r.$nodeDescription?n=[r.$nodeDescription]:tr(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=jt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Za(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Je.equals(l.documentUri,i)});return s}}class FR{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)),c=i[o];return c==null?void 0:c[l]}return i[a]},e)}}class GR{constructor(e){this._ready=new xc,this.onConfigurationSectionUpdateEmitter=new zh,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.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 ki={},Lr={},Dc={},lo={},G={},Pu;function Vh(){if(Pu)return G;Pu=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=we;var e;(function(R){R.ParseError=-32700,R.InvalidRequest=-32600,R.MethodNotFound=-32601,R.InvalidParams=-32602,R.InternalError=-32603,R.jsonrpcReservedErrorRangeStart=-32099,R.serverErrorStart=-32099,R.MessageWriteError=-32099,R.MessageReadError=-32098,R.PendingResponseRejected=-32097,R.ConnectionInactive=-32096,R.ServerNotInitialized=-32002,R.UnknownErrorCode=-32001,R.jsonrpcReservedErrorRangeEnd=-32e3,R.serverErrorEnd=-32e3})(e||(G.ErrorCodes=e={}));class r extends Error{constructor(m,$,y){super($),this.code=t.number(m)?m:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,r.prototype)}toJson(){const m={code:this.code,message:this.message};return this.data!==void 0&&(m.data=this.data),m}}G.ResponseError=r;class n{constructor(m){this.kind=m}static is(m){return m===n.auto||m===n.byName||m===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(m,$){this.method=m,this.numberOfParams=$}get parameterStructures(){return n.auto}}G.AbstractMessageSignature=i;class a extends i{constructor(m){super(m,0)}}G.RequestType0=a;class s extends i{constructor(m,$=n.auto){super(m,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.RequestType=s;class o extends i{constructor(m,$=n.auto){super(m,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.RequestType1=o;class l extends i{constructor(m){super(m,2)}}G.RequestType2=l;class c extends i{constructor(m){super(m,3)}}G.RequestType3=c;class u extends i{constructor(m){super(m,4)}}G.RequestType4=u;class d extends i{constructor(m){super(m,5)}}G.RequestType5=d;class p extends i{constructor(m){super(m,6)}}G.RequestType6=p;class g extends i{constructor(m){super(m,7)}}G.RequestType7=g;class A extends i{constructor(m){super(m,8)}}G.RequestType8=A;class w extends i{constructor(m){super(m,9)}}G.RequestType9=w;class I extends i{constructor(m,$=n.auto){super(m,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.NotificationType=I;class b extends i{constructor(m){super(m,0)}}G.NotificationType0=b;class L extends i{constructor(m,$=n.auto){super(m,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=L;class N extends i{constructor(m){super(m,2)}}G.NotificationType2=N;class x extends i{constructor(m){super(m,3)}}G.NotificationType3=x;class q extends i{constructor(m){super(m,4)}}G.NotificationType4=q;class Z extends i{constructor(m){super(m,5)}}G.NotificationType5=Z;class Q extends i{constructor(m){super(m,6)}}G.NotificationType6=Q;class he extends i{constructor(m){super(m,7)}}G.NotificationType7=he;class ve extends i{constructor(m){super(m,8)}}G.NotificationType8=ve;class oe extends i{constructor(m){super(m,9)}}G.NotificationType9=oe;var S;return function(R){function m(T){const E=T;return E&&t.string(E.method)&&(t.string(E.id)||t.number(E.id))}R.isRequest=m;function $(T){const E=T;return E&&t.string(E.method)&&T.id===void 0}R.isNotification=$;function y(T){const E=T;return E&&(E.result!==void 0||!!E.error)&&(t.string(E.id)||t.number(E.id)||E.id===null)}R.isResponse=y}(S||(G.Message=S={})),G}var It={},Ou;function qh(){if(Ou)return It;Ou=1;var t;Object.defineProperty(It,"__esModule",{value:!0}),It.LRUCache=It.LinkedMap=It.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||(It.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(){var a;return(a=this._head)==null?void 0:a.value}get last(){var a;return(a=this._tail)==null?void 0:a.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)}}It.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 It.LRUCache=n,It}var fi={},Lu;function jR(){if(Lu)return fi;Lu=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.Disposable=void 0;var t;return function(e){function r(n){return{dispose:n}}e.create=r}(t||(fi.Disposable=t={})),fi}var mr={},xu;function zR(){if(xu)return mr;xu=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.SharedArrayReceiverStrategy=mr.SharedArraySenderStrategy=void 0;const t=ur;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),c=new Int32Array(l,0,1);c[0]=e.Continue,this.buffers.set(o.id,l),o.$cancellationData=l}async sendCancellation(o,l){const c=this.buffers.get(l);if(c===void 0)return;const u=new Int32Array(c,0,1);Atomics.store(u,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}mr.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 mr.SharedArrayReceiverStrategy=a,mr}var Pt={},di={},Du;function Hh(){if(Du)return di;Du=1,Object.defineProperty(di,"__esModule",{value:!0}),di.Semaphore=void 0;const t=qt;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 di.Semaphore=e,di}var Mu;function UR(){if(Mu)return Pt;Mu=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.ReadableStreamMessageReader=Pt.AbstractMessageReader=Pt.MessageReader=void 0;const t=qt,e=we,r=Et,n=Hh();var i;(function(l){function c(u){let d=u;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}l.is=c})(i||(Pt.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(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${e.string(c.message)?c.message:"unknown"}`)}}Pt.AbstractMessageReader=a;var s;(function(l){function c(u){let d,p;const g=new Map;let A;const w=new Map;if(u===void 0||typeof u=="string")d=u??"utf-8";else{if(d=u.charset??"utf-8",u.contentDecoder!==void 0&&(p=u.contentDecoder,g.set(p.name,p)),u.contentDecoders!==void 0)for(const I of u.contentDecoders)g.set(I.name,I);if(u.contentTypeDecoder!==void 0&&(A=u.contentTypeDecoder,w.set(A.name,A)),u.contentTypeDecoders!==void 0)for(const I of u.contentTypeDecoders)w.set(I.name,I)}return A===void 0&&(A=(0,t.default)().applicationJson.decoder,w.set(A.name,A)),{charset:d,contentDecoder:p,contentDecoders:g,contentTypeDecoder:A,contentTypeDecoders:w}}l.fromOptions=c})(s||(s={}));class o extends a{constructor(c,u){super(),this.readable=c,this.options=s.fromOptions(u),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(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const u=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),u}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const p=d.get("content-length");if(!p){this.fireError(new Error(`Header must provide a Content-Length property.
122
+ ${JSON.stringify(Object.fromEntries(d))}`));return}const g=parseInt(p);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${p}`));return}this.nextMessageLength=g}const u=this.buffer.tryReadBody(this.nextMessageLength);if(u===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(u):u,p=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(p)}).catch(d=>{this.fireError(d)})}}catch(u){this.fireError(u)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,u)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:u}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Pt.ReadableStreamMessageReader=o,Pt}var Ot={},Fu;function BR(){if(Fu)return Ot;Fu=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.WriteableStreamMessageWriter=Ot.AbstractMessageWriter=Ot.MessageWriter=void 0;const t=qt,e=we,r=Hh(),n=Et,i="Content-Length: ",a=`\r
123
+ `;var s;(function(u){function d(p){let g=p;return g&&e.func(g.dispose)&&e.func(g.onClose)&&e.func(g.onError)&&e.func(g.write)}u.is=d})(s||(Ot.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(d,p,g){this.errorEmitter.fire([this.asError(d),p,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}Ot.AbstractMessageWriter=o;var l;(function(u){function d(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}}u.fromOptions=d})(l||(l={}));class c extends o{constructor(d,p){super(),this.writable=d,this.options=l.fromOptions(p),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const A=[];return A.push(i,g.byteLength.toString(),a),A.push(a),this.doWrite(d,A,g)},g=>{throw this.fireError(g),g}))}async doWrite(d,p,g){try{return await this.writable.write(p.join(""),"ascii"),this.writable.write(g)}catch(A){return this.handleError(A,d),Promise.reject(A)}}handleError(d,p){this.errorCount++,this.fireError(d,p,this.errorCount)}end(){this.writable.end()}}return Ot.WriteableStreamMessageWriter=c,Ot}var hi={},Gu;function WR(){if(Gu)return hi;Gu=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.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,c=0;e:for(;o<this._chunks.length;){const g=this._chunks[o];for(l=0;l<g.length;){switch(g[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++}c+=g.byteLength,o++}if(s!==4)return;const u=this._read(c+l),d=new Map,p=this.toString(u,"ascii").split(r);if(p.length<2)return d;for(let g=0;g<p.length-2;g++){const A=p[g],w=A.indexOf(":");if(w===-1)throw new Error(`Message header must separate key and value using ':'
125
+ ${A}`);const I=A.substr(0,w),b=A.substr(w+1).trim();d.set(a?I.toLowerCase():I,b)}return d}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 c=this._chunks[0];return this._chunks.shift(),this._totalLength-=a,this.asNative(c)}if(this._chunks[0].byteLength>a){const c=this._chunks[0],u=this.asNative(c,a);return this._chunks[0]=c.slice(a),this._totalLength-=a,u}const s=this.allocNative(a);let o=0,l=0;for(;a>0;){const c=this._chunks[l];if(c.byteLength>a){const u=c.slice(0,a);s.set(u,o),o+=a,this._chunks[l]=c.slice(a),this._totalLength-=a,a-=a}else s.set(c,o),o+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,a-=c.byteLength}return s}}return hi.AbstractMessageBuffer=n,hi}var co={},ju;function KR(){return ju||(ju=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=qt,r=we,n=Vh(),i=qh(),a=Et,s=ur;var o;(function(m){m.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(m){function $(y){return typeof y=="string"||typeof y=="number"}m.is=$})(l||(t.ProgressToken=l={}));var c;(function(m){m.type=new n.NotificationType("$/progress")})(c||(c={}));class u{constructor(){}}t.ProgressType=u;var d;(function(m){function $(y){return r.func(y)}m.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var g;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(g||(t.TraceValues=g={})),function(m){function $(T){if(!r.string(T))return m.Off;switch(T=T.toLowerCase(),T){case"off":return m.Off;case"messages":return m.Messages;case"compact":return m.Compact;case"verbose":return m.Verbose;default:return m.Off}}m.fromString=$;function y(T){switch(T){case m.Off:return"off";case m.Messages:return"messages";case m.Compact:return"compact";case m.Verbose:return"verbose";default:return"off"}}m.toString=y}(p||(t.Trace=p={}));var A;(function(m){m.Text="text",m.JSON="json"})(A||(t.TraceFormat=A={})),function(m){function $(y){return r.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=$}(A||(t.TraceFormat=A={}));var w;(function(m){m.type=new n.NotificationType("$/setTrace")})(w||(t.SetTraceNotification=w={}));var I;(function(m){m.type=new n.NotificationType("$/logTrace")})(I||(t.LogTraceNotification=I={}));var b;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(b||(t.ConnectionErrors=b={}));class L extends Error{constructor($,y){super(y),this.code=$,Object.setPrototypeOf(this,L.prototype)}}t.ConnectionError=L;var N;(function(m){function $(y){const T=y;return T&&r.func(T.cancelUndispatched)}m.is=$})(N||(t.ConnectionStrategy=N={}));var x;(function(m){function $(y){const T=y;return T&&(T.kind===void 0||T.kind==="id")&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}m.is=$})(x||(t.IdCancellationReceiverStrategy=x={}));var q;(function(m){function $(y){const T=y;return T&&T.kind==="request"&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}m.is=$})(q||(t.RequestCancellationReceiverStrategy=q={}));var Z;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new s.CancellationTokenSource}});function $(y){return x.is(y)||q.is(y)}m.is=$})(Z||(t.CancellationReceiverStrategy=Z={}));var Q;(function(m){m.Message=Object.freeze({sendCancellation(y,T){return y.sendNotification(o.type,{id:T})},cleanup(y){}});function $(y){const T=y;return T&&r.func(T.sendCancellation)&&r.func(T.cleanup)}m.is=$})(Q||(t.CancellationSenderStrategy=Q={}));var he;(function(m){m.Message=Object.freeze({receiver:Z.Message,sender:Q.Message});function $(y){const T=y;return T&&Z.is(T.receiver)&&Q.is(T.sender)}m.is=$})(he||(t.CancellationStrategy=he={}));var ve;(function(m){function $(y){const T=y;return T&&r.func(T.handleMessage)}m.is=$})(ve||(t.MessageStrategy=ve={}));var oe;(function(m){function $(y){const T=y;return T&&(he.is(T.cancellationStrategy)||N.is(T.connectionStrategy)||ve.is(T.messageStrategy))}m.is=$})(oe||(t.ConnectionOptions=oe={}));var S;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(S||(S={}));function R(m,$,y,T){const E=y!==void 0?y:t.NullLogger;let P=0,D=0,O=0;const j="2.0";let F;const re=new Map;let z;const ee=new Map,Ie=new Map;let pe,le=new i.LinkedMap,be=new Map,Pe=new Set,Ce=new Map,X=p.Off,He=A.Text,me,at=S.New;const xr=new a.Emitter,qn=new a.Emitter,Hn=new a.Emitter,Xn=new a.Emitter,Yn=new a.Emitter,st=T&&T.cancellationStrategy?T.cancellationStrategy:he.Message;function Jn(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}function Zi(h){return h===null?"res-unknown-"+(++O).toString():"res-"+h.toString()}function Qi(){return"not-"+(++D).toString()}function ea(h,C){n.Message.isRequest(C)?h.set(Jn(C.id),C):n.Message.isResponse(C)?h.set(Zi(C.id),C):h.set(Qi(),C)}function ta(h){}function Zn(){return at===S.Listening}function Qn(){return at===S.Closed}function bt(){return at===S.Disposed}function ei(){(at===S.New||at===S.Listening)&&(at=S.Closed,qn.fire(void 0))}function ra(h){xr.fire([h,void 0,void 0])}function na(h){xr.fire(h)}m.onClose(ei),m.onError(ra),$.onClose(ei),$.onError(na);function ti(){pe||le.size===0||(pe=(0,e.default)().timer.setImmediate(()=>{pe=void 0,ia()}))}function ri(h){n.Message.isRequest(h)?sa(h):n.Message.isNotification(h)?la(h):n.Message.isResponse(h)?oa(h):ca(h)}function ia(){if(le.size===0)return;const h=le.shift();try{const C=T==null?void 0:T.messageStrategy;ve.is(C)?C.handleMessage(h,ri):ri(h)}finally{ti()}}const aa=h=>{try{if(n.Message.isNotification(h)&&h.method===o.type.method){const C=h.params.id,_=Jn(C),M=le.get(_);if(n.Message.isRequest(M)){const ne=T==null?void 0:T.connectionStrategy,ie=ne&&ne.cancelUndispatched?ne.cancelUndispatched(M,ta):void 0;if(ie&&(ie.error!==void 0||ie.result!==void 0)){le.delete(_),Ce.delete(C),ie.id=M.id,hr(ie,h.method,Date.now()),$.write(ie).catch(()=>E.error("Sending response for canceled message failed."));return}}const ae=Ce.get(C);if(ae!==void 0){ae.cancel(),Dr(h);return}else Pe.add(C)}ea(le,h)}finally{ti()}};function sa(h){if(bt())return;function C(H,ce,te){const Ne={jsonrpc:j,id:h.id};H instanceof n.ResponseError?Ne.error=H.toJson():Ne.result=H===void 0?null:H,hr(Ne,ce,te),$.write(Ne).catch(()=>E.error("Sending response failed."))}function _(H,ce,te){const Ne={jsonrpc:j,id:h.id,error:H.toJson()};hr(Ne,ce,te),$.write(Ne).catch(()=>E.error("Sending response failed."))}function M(H,ce,te){H===void 0&&(H=null);const Ne={jsonrpc:j,id:h.id,result:H};hr(Ne,ce,te),$.write(Ne).catch(()=>E.error("Sending response failed."))}da(h);const ae=re.get(h.method);let ne,ie;ae&&(ne=ae.type,ie=ae.handler);const $e=Date.now();if(ie||F){const H=h.id??String(Date.now()),ce=x.is(st.receiver)?st.receiver.createCancellationTokenSource(H):st.receiver.createCancellationTokenSource(h);h.id!==null&&Pe.has(h.id)&&ce.cancel(),h.id!==null&&Ce.set(H,ce);try{let te;if(ie)if(h.params===void 0){if(ne!==void 0&&ne.numberOfParams!==0){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines ${ne.numberOfParams} params but received none.`),h.method,$e);return}te=ie(ce.token)}else if(Array.isArray(h.params)){if(ne!==void 0&&ne.parameterStructures===n.ParameterStructures.byName){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,$e);return}te=ie(...h.params,ce.token)}else{if(ne!==void 0&&ne.parameterStructures===n.ParameterStructures.byPosition){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,$e);return}te=ie(h.params,ce.token)}else F&&(te=F(h.method,h.params,ce.token));const Ne=te;te?Ne.then?Ne.then(Ge=>{Ce.delete(H),C(Ge,h.method,$e)},Ge=>{Ce.delete(H),Ge instanceof n.ResponseError?_(Ge,h.method,$e):Ge&&r.string(Ge.message)?_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${Ge.message}`),h.method,$e):_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,$e)}):(Ce.delete(H),C(te,h.method,$e)):(Ce.delete(H),M(te,h.method,$e))}catch(te){Ce.delete(H),te instanceof n.ResponseError?C(te,h.method,$e):te&&r.string(te.message)?_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${te.message}`),h.method,$e):_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,$e)}}else _(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,$e)}function oa(h){if(!bt())if(h.id===null)h.error?E.error(`Received response message without id: Error is:
126
+ ${JSON.stringify(h.error,void 0,4)}`):E.error("Received response message without id. No further error information provided.");else{const C=h.id,_=be.get(C);if(ha(h,_),_!==void 0){be.delete(C);try{if(h.error){const M=h.error;_.reject(new n.ResponseError(M.code,M.message,M.data))}else if(h.result!==void 0)_.resolve(h.result);else throw new Error("Should never happen.")}catch(M){M.message?E.error(`Response handler '${_.method}' failed with message: ${M.message}`):E.error(`Response handler '${_.method}' failed unexpectedly.`)}}}}function la(h){if(bt())return;let C,_;if(h.method===o.type.method){const M=h.params.id;Pe.delete(M),Dr(h);return}else{const M=ee.get(h.method);M&&(_=M.handler,C=M.type)}if(_||z)try{if(Dr(h),_)if(h.params===void 0)C!==void 0&&C.numberOfParams!==0&&C.parameterStructures!==n.ParameterStructures.byName&&E.error(`Notification ${h.method} defines ${C.numberOfParams} params but received none.`),_();else if(Array.isArray(h.params)){const M=h.params;h.method===c.type.method&&M.length===2&&l.is(M[0])?_({token:M[0],value:M[1]}):(C!==void 0&&(C.parameterStructures===n.ParameterStructures.byName&&E.error(`Notification ${h.method} defines parameters by name but received parameters by position`),C.numberOfParams!==h.params.length&&E.error(`Notification ${h.method} defines ${C.numberOfParams} params but received ${M.length} arguments`)),_(...M))}else C!==void 0&&C.parameterStructures===n.ParameterStructures.byPosition&&E.error(`Notification ${h.method} defines parameters by position but received parameters by name`),_(h.params);else z&&z(h.method,h.params)}catch(M){M.message?E.error(`Notification handler '${h.method}' failed with message: ${M.message}`):E.error(`Notification handler '${h.method}' failed unexpectedly.`)}else Hn.fire(h)}function ca(h){if(!h){E.error("Received empty message.");return}E.error(`Received message which is neither a response nor a notification message:
127
+ ${JSON.stringify(h,null,4)}`);const C=h;if(r.string(C.id)||r.number(C.id)){const _=C.id,M=be.get(_);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function ot(h){if(h!=null)switch(X){case p.Verbose:return JSON.stringify(h,null,4);case p.Compact:return JSON.stringify(h);default:return}}function ua(h){if(!(X===p.Off||!me))if(He===A.Text){let C;(X===p.Verbose||X===p.Compact)&&h.params&&(C=`Params: ${ot(h.params)}
128
+
129
+ `),me.log(`Sending request '${h.method} - (${h.id})'.`,C)}else Nt("send-request",h)}function fa(h){if(!(X===p.Off||!me))if(He===A.Text){let C;(X===p.Verbose||X===p.Compact)&&(h.params?C=`Params: ${ot(h.params)}
130
+
131
+ `:C=`No parameters provided.
132
+
133
+ `),me.log(`Sending notification '${h.method}'.`,C)}else Nt("send-notification",h)}function hr(h,C,_){if(!(X===p.Off||!me))if(He===A.Text){let M;(X===p.Verbose||X===p.Compact)&&(h.error&&h.error.data?M=`Error data: ${ot(h.error.data)}
134
+
135
+ `:h.result?M=`Result: ${ot(h.result)}
136
+
137
+ `:h.error===void 0&&(M=`No result returned.
138
+
139
+ `)),me.log(`Sending response '${C} - (${h.id})'. Processing request took ${Date.now()-_}ms`,M)}else Nt("send-response",h)}function da(h){if(!(X===p.Off||!me))if(He===A.Text){let C;(X===p.Verbose||X===p.Compact)&&h.params&&(C=`Params: ${ot(h.params)}
140
+
141
+ `),me.log(`Received request '${h.method} - (${h.id})'.`,C)}else Nt("receive-request",h)}function Dr(h){if(!(X===p.Off||!me||h.method===I.type.method))if(He===A.Text){let C;(X===p.Verbose||X===p.Compact)&&(h.params?C=`Params: ${ot(h.params)}
142
+
143
+ `:C=`No parameters provided.
144
+
145
+ `),me.log(`Received notification '${h.method}'.`,C)}else Nt("receive-notification",h)}function ha(h,C){if(!(X===p.Off||!me))if(He===A.Text){let _;if((X===p.Verbose||X===p.Compact)&&(h.error&&h.error.data?_=`Error data: ${ot(h.error.data)}
146
+
147
+ `:h.result?_=`Result: ${ot(h.result)}
148
+
149
+ `:h.error===void 0&&(_=`No result returned.
150
+
151
+ `)),C){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";me.log(`Received response '${C.method} - (${h.id})' in ${Date.now()-C.timerStart}ms.${M}`,_)}else me.log(`Received response ${h.id} without active response promise.`,_)}else Nt("receive-response",h)}function Nt(h,C){if(!me||X===p.Off)return;const _={isLSPMessage:!0,type:h,message:C,timestamp:Date.now()};me.log(_)}function Jt(){if(Qn())throw new L(b.Closed,"Connection is closed.");if(bt())throw new L(b.Disposed,"Connection is disposed.")}function pa(){if(Zn())throw new L(b.AlreadyListening,"Connection is already listening")}function ma(){if(!Zn())throw new Error("Call listen() first.")}function Zt(h){return h===void 0?null:h}function ni(h){if(h!==null)return h}function f(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function Ee(h,C){switch(h){case n.ParameterStructures.auto:return f(C)?ni(C):[Zt(C)];case n.ParameterStructures.byName:if(!f(C))throw new Error("Received parameters by name but param is not an object literal.");return ni(C);case n.ParameterStructures.byPosition:return[Zt(C)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function Ae(h,C){let _;const M=h.numberOfParams;switch(M){case 0:_=void 0;break;case 1:_=Ee(h.parameterStructures,C[0]);break;default:_=[];for(let ae=0;ae<C.length&&ae<M;ae++)_.push(Zt(C[ae]));if(C.length<M)for(let ae=C.length;ae<M;ae++)_.push(null);break}return _}const B={sendNotification:(h,...C)=>{Jt();let _,M;if(r.string(h)){_=h;const ne=C[0];let ie=0,$e=n.ParameterStructures.auto;n.ParameterStructures.is(ne)&&(ie=1,$e=ne);let H=C.length;const ce=H-ie;switch(ce){case 0:M=void 0;break;case 1:M=Ee($e,C[ie]);break;default:if($e===n.ParameterStructures.byName)throw new Error(`Received ${ce} parameters for 'by Name' notification parameter structure.`);M=C.slice(ie,H).map(te=>Zt(te));break}}else{const ne=C;_=h.method,M=Ae(h,ne)}const ae={jsonrpc:j,method:_,params:M};return fa(ae),$.write(ae).catch(ne=>{throw E.error("Sending notification failed."),ne})},onNotification:(h,C)=>{Jt();let _;return r.func(h)?z=h:C&&(r.string(h)?(_=h,ee.set(h,{type:void 0,handler:C})):(_=h.method,ee.set(h.method,{type:h,handler:C}))),{dispose:()=>{_!==void 0?ee.delete(_):z=void 0}}},onProgress:(h,C,_)=>{if(Ie.has(C))throw new Error(`Progress handler for token ${C} already registered`);return Ie.set(C,_),{dispose:()=>{Ie.delete(C)}}},sendProgress:(h,C,_)=>B.sendNotification(c.type,{token:C,value:_}),onUnhandledProgress:Xn.event,sendRequest:(h,...C)=>{Jt(),ma();let _,M,ae;if(r.string(h)){_=h;const H=C[0],ce=C[C.length-1];let te=0,Ne=n.ParameterStructures.auto;n.ParameterStructures.is(H)&&(te=1,Ne=H);let Ge=C.length;s.CancellationToken.is(ce)&&(Ge=Ge-1,ae=ce);const pt=Ge-te;switch(pt){case 0:M=void 0;break;case 1:M=Ee(Ne,C[te]);break;default:if(Ne===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);M=C.slice(te,Ge).map(bp=>Zt(bp));break}}else{const H=C;_=h.method,M=Ae(h,H);const ce=h.numberOfParams;ae=s.CancellationToken.is(H[ce])?H[ce]:void 0}const ne=P++;let ie;ae&&(ie=ae.onCancellationRequested(()=>{const H=st.sender.sendCancellation(B,ne);return H===void 0?(E.log(`Received no promise from cancellation strategy when cancelling id ${ne}`),Promise.resolve()):H.catch(()=>{E.log(`Sending cancellation messages for id ${ne} failed`)})}));const $e={jsonrpc:j,id:ne,method:_,params:M};return ua($e),typeof st.sender.enableCancellation=="function"&&st.sender.enableCancellation($e),new Promise(async(H,ce)=>{const te=pt=>{H(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ne=pt=>{ce(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ge={method:_,timerStart:Date.now(),resolve:te,reject:Ne};try{await $.write($e),be.set(ne,Ge)}catch(pt){throw E.error("Sending request failed."),Ge.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(h,C)=>{Jt();let _=null;return d.is(h)?(_=void 0,F=h):r.string(h)?(_=null,C!==void 0&&(_=h,re.set(h,{handler:C,type:void 0}))):C!==void 0&&(_=h.method,re.set(h.method,{type:h,handler:C})),{dispose:()=>{_!==null&&(_!==void 0?re.delete(_):F=void 0)}}},hasPendingResponse:()=>be.size>0,trace:async(h,C,_)=>{let M=!1,ae=A.Text;_!==void 0&&(r.boolean(_)?M=_:(M=_.sendNotification||!1,ae=_.traceFormat||A.Text)),X=h,He=ae,X===p.Off?me=void 0:me=C,M&&!Qn()&&!bt()&&await B.sendNotification(w.type,{value:p.toString(h)})},onError:xr.event,onClose:qn.event,onUnhandledNotification:Hn.event,onDispose:Yn.event,end:()=>{$.end()},dispose:()=>{if(bt())return;at=S.Disposed,Yn.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const C of be.values())C.reject(h);be=new Map,Ce=new Map,Pe=new Set,le=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(m.dispose)&&m.dispose()},listen:()=>{Jt(),pa(),at=S.Listening,m.listen(aa)},inspect:()=>{(0,e.default)().console.log("inspect")}};return B.onNotification(I.type,h=>{if(X===p.Off||!me)return;const C=X===p.Verbose||X===p.Compact;me.log(h.message,C?h.verbose:void 0)}),B.onNotification(c.type,h=>{const C=Ie.get(h.token);C?C(h.value):Xn.fire(h)}),B}t.createMessageConnection=R}(co)),co}var zu;function ec(){return zu||(zu=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=Vh();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=qh();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=jR();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Et;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=ur;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=zR();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=UR();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=BR();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 c=WR();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const u=KR();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const d=qt;t.RAL=d.default}(lo)),lo}Object.defineProperty(Dc,"__esModule",{value:!0});const Rt=ec();class Fs extends Rt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Fs.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}}Fs.emptyBuffer=new Uint8Array(0);class VR{constructor(e){this.socket=e,this._onData=new Rt.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Rt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class qR{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const HR=new TextEncoder,Xh=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fs(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(HR.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new VR(t),asWritableStream:t=>new qR(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){const n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){const r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){const n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function tc(){return Xh}(function(t){function e(){Rt.RAL.install(Xh)}t.install=e})(tc||(tc={}));Dc.default=tc;(function(t){var e=rt&&rt.__createBinding||(Object.create?function(l,c,u,d){d===void 0&&(d=u);var p=Object.getOwnPropertyDescriptor(c,u);(!p||("get"in p?!c.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,d,p)}:function(l,c,u,d){d===void 0&&(d=u),l[d]=c[u]}),r=rt&&rt.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Dc.default.install();const i=ec();r(ec(),t);class a extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,c,u,d){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,i.createMessageConnection)(l,c,u,d)}t.createMessageConnection=o})(Lr);var Uu=Lr,Yh={};const Mc=Ip(LT);var K={};Object.defineProperty(K,"__esModule",{value:!0});K.ProtocolNotificationType=K.ProtocolNotificationType0=K.ProtocolRequestType=K.ProtocolRequestType0=K.RegistrationType=K.MessageDirection=void 0;const Pn=Lr;var Bu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Bu||(K.MessageDirection=Bu={}));class XR{constructor(e){this.method=e}}K.RegistrationType=XR;class YR extends Pn.RequestType0{constructor(e){super(e)}}K.ProtocolRequestType0=YR;class JR extends Pn.RequestType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolRequestType=JR;class ZR extends Pn.NotificationType0{constructor(e){super(e)}}K.ProtocolNotificationType0=ZR;class QR extends Pn.NotificationType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolNotificationType=QR;var Jh={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.objectLiteral=ye.typedArray=ye.stringArray=ye.array=ye.func=ye.error=ye.number=ye.string=ye.boolean=void 0;function ev(t){return t===!0||t===!1}ye.boolean=ev;function Zh(t){return typeof t=="string"||t instanceof String}ye.string=Zh;function tv(t){return typeof t=="number"||t instanceof Number}ye.number=tv;function rv(t){return t instanceof Error}ye.error=rv;function nv(t){return typeof t=="function"}ye.func=nv;function Qh(t){return Array.isArray(t)}ye.array=Qh;function iv(t){return Qh(t)&&t.every(e=>Zh(e))}ye.stringArray=iv;function av(t,e){return Array.isArray(t)&&t.every(e)}ye.typedArray=av;function sv(t){return t!==null&&typeof t=="object"}ye.objectLiteral=sv;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ImplementationRequest=void 0;const Wu=K;var Ku;(function(t){t.method="textDocument/implementation",t.messageDirection=Wu.MessageDirection.clientToServer,t.type=new Wu.ProtocolRequestType(t.method)})(Ku||(Gs.ImplementationRequest=Ku={}));var js={};Object.defineProperty(js,"__esModule",{value:!0});js.TypeDefinitionRequest=void 0;const Vu=K;var qu;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Vu.MessageDirection.clientToServer,t.type=new Vu.ProtocolRequestType(t.method)})(qu||(js.TypeDefinitionRequest=qu={}));var On={};Object.defineProperty(On,"__esModule",{value:!0});On.DidChangeWorkspaceFoldersNotification=On.WorkspaceFoldersRequest=void 0;const Ts=K;var Hu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType0(t.method)})(Hu||(On.WorkspaceFoldersRequest=Hu={}));var Xu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Ts.MessageDirection.clientToServer,t.type=new Ts.ProtocolNotificationType(t.method)})(Xu||(On.DidChangeWorkspaceFoldersNotification=Xu={}));var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.ConfigurationRequest=void 0;const Yu=K;var Ju;(function(t){t.method="workspace/configuration",t.messageDirection=Yu.MessageDirection.serverToClient,t.type=new Yu.ProtocolRequestType(t.method)})(Ju||(zs.ConfigurationRequest=Ju={}));var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ColorPresentationRequest=Ln.DocumentColorRequest=void 0;const Rs=K;var Zu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(Zu||(Ln.DocumentColorRequest=Zu={}));var Qu;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(Qu||(Ln.ColorPresentationRequest=Qu={}));var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.FoldingRangeRefreshRequest=xn.FoldingRangeRequest=void 0;const vs=K;var ef;(function(t){t.method="textDocument/foldingRange",t.messageDirection=vs.MessageDirection.clientToServer,t.type=new vs.ProtocolRequestType(t.method)})(ef||(xn.FoldingRangeRequest=ef={}));var tf;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=vs.MessageDirection.serverToClient,t.type=new vs.ProtocolRequestType0(t.method)})(tf||(xn.FoldingRangeRefreshRequest=tf={}));var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.DeclarationRequest=void 0;const rf=K;var nf;(function(t){t.method="textDocument/declaration",t.messageDirection=rf.MessageDirection.clientToServer,t.type=new rf.ProtocolRequestType(t.method)})(nf||(Us.DeclarationRequest=nf={}));var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.SelectionRangeRequest=void 0;const af=K;var sf;(function(t){t.method="textDocument/selectionRange",t.messageDirection=af.MessageDirection.clientToServer,t.type=new af.ProtocolRequestType(t.method)})(sf||(Bs.SelectionRangeRequest=sf={}));var rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.WorkDoneProgressCancelNotification=rr.WorkDoneProgressCreateRequest=rr.WorkDoneProgress=void 0;const ov=Lr,Es=K;var of;(function(t){t.type=new ov.ProgressType;function e(r){return r===t.type}t.is=e})(of||(rr.WorkDoneProgress=of={}));var lf;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Es.MessageDirection.serverToClient,t.type=new Es.ProtocolRequestType(t.method)})(lf||(rr.WorkDoneProgressCreateRequest=lf={}));var cf;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Es.MessageDirection.clientToServer,t.type=new Es.ProtocolNotificationType(t.method)})(cf||(rr.WorkDoneProgressCancelNotification=cf={}));var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.CallHierarchyOutgoingCallsRequest=nr.CallHierarchyIncomingCallsRequest=nr.CallHierarchyPrepareRequest=void 0;const Dn=K;var uf;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(uf||(nr.CallHierarchyPrepareRequest=uf={}));var ff;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(ff||(nr.CallHierarchyIncomingCallsRequest=ff={}));var df;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(df||(nr.CallHierarchyOutgoingCallsRequest=df={}));var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.SemanticTokensRefreshRequest=Be.SemanticTokensRangeRequest=Be.SemanticTokensDeltaRequest=Be.SemanticTokensRequest=Be.SemanticTokensRegistrationType=Be.TokenFormat=void 0;const Wt=K;var hf;(function(t){t.Relative="relative"})(hf||(Be.TokenFormat=hf={}));var zi;(function(t){t.method="textDocument/semanticTokens",t.type=new Wt.RegistrationType(t.method)})(zi||(Be.SemanticTokensRegistrationType=zi={}));var pf;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method),t.registrationMethod=zi.method})(pf||(Be.SemanticTokensRequest=pf={}));var mf;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method),t.registrationMethod=zi.method})(mf||(Be.SemanticTokensDeltaRequest=mf={}));var gf;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method),t.registrationMethod=zi.method})(gf||(Be.SemanticTokensRangeRequest=gf={}));var yf;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Wt.MessageDirection.serverToClient,t.type=new Wt.ProtocolRequestType0(t.method)})(yf||(Be.SemanticTokensRefreshRequest=yf={}));var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.ShowDocumentRequest=void 0;const Tf=K;var Rf;(function(t){t.method="window/showDocument",t.messageDirection=Tf.MessageDirection.serverToClient,t.type=new Tf.ProtocolRequestType(t.method)})(Rf||(Ws.ShowDocumentRequest=Rf={}));var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.LinkedEditingRangeRequest=void 0;const vf=K;var Ef;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=vf.MessageDirection.clientToServer,t.type=new vf.ProtocolRequestType(t.method)})(Ef||(Ks.LinkedEditingRangeRequest=Ef={}));var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.WillDeleteFilesRequest=Me.DidDeleteFilesNotification=Me.DidRenameFilesNotification=Me.WillRenameFilesRequest=Me.DidCreateFilesNotification=Me.WillCreateFilesRequest=Me.FileOperationPatternKind=void 0;const nt=K;var Af;(function(t){t.file="file",t.folder="folder"})(Af||(Me.FileOperationPatternKind=Af={}));var $f;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})($f||(Me.WillCreateFilesRequest=$f={}));var Cf;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(Cf||(Me.DidCreateFilesNotification=Cf={}));var Sf;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(Sf||(Me.WillRenameFilesRequest=Sf={}));var wf;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(wf||(Me.DidRenameFilesNotification=wf={}));var kf;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(kf||(Me.DidDeleteFilesNotification=kf={}));var bf;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(bf||(Me.WillDeleteFilesRequest=bf={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.MonikerRequest=ir.MonikerKind=ir.UniquenessLevel=void 0;const Nf=K;var _f;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(_f||(ir.UniquenessLevel=_f={}));var If;(function(t){t.$import="import",t.$export="export",t.local="local"})(If||(ir.MonikerKind=If={}));var Pf;(function(t){t.method="textDocument/moniker",t.messageDirection=Nf.MessageDirection.clientToServer,t.type=new Nf.ProtocolRequestType(t.method)})(Pf||(ir.MonikerRequest=Pf={}));var ar={};Object.defineProperty(ar,"__esModule",{value:!0});ar.TypeHierarchySubtypesRequest=ar.TypeHierarchySupertypesRequest=ar.TypeHierarchyPrepareRequest=void 0;const Mn=K;var Of;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Of||(ar.TypeHierarchyPrepareRequest=Of={}));var Lf;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Lf||(ar.TypeHierarchySupertypesRequest=Lf={}));var xf;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(xf||(ar.TypeHierarchySubtypesRequest=xf={}));var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.InlineValueRefreshRequest=Fn.InlineValueRequest=void 0;const As=K;var Df;(function(t){t.method="textDocument/inlineValue",t.messageDirection=As.MessageDirection.clientToServer,t.type=new As.ProtocolRequestType(t.method)})(Df||(Fn.InlineValueRequest=Df={}));var Mf;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=As.MessageDirection.serverToClient,t.type=new As.ProtocolRequestType0(t.method)})(Mf||(Fn.InlineValueRefreshRequest=Mf={}));var sr={};Object.defineProperty(sr,"__esModule",{value:!0});sr.InlayHintRefreshRequest=sr.InlayHintResolveRequest=sr.InlayHintRequest=void 0;const Gn=K;var Ff;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(Ff||(sr.InlayHintRequest=Ff={}));var Gf;(function(t){t.method="inlayHint/resolve",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(Gf||(sr.InlayHintResolveRequest=Gf={}));var jf;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Gn.MessageDirection.serverToClient,t.type=new Gn.ProtocolRequestType0(t.method)})(jf||(sr.InlayHintRefreshRequest=jf={}));var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.DiagnosticRefreshRequest=tt.WorkspaceDiagnosticRequest=tt.DocumentDiagnosticRequest=tt.DocumentDiagnosticReportKind=tt.DiagnosticServerCancellationData=void 0;const ep=Lr,lv=ye,jn=K;var zf;(function(t){function e(r){const n=r;return n&&lv.boolean(n.retriggerRequest)}t.is=e})(zf||(tt.DiagnosticServerCancellationData=zf={}));var Uf;(function(t){t.Full="full",t.Unchanged="unchanged"})(Uf||(tt.DocumentDiagnosticReportKind=Uf={}));var Bf;(function(t){t.method="textDocument/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Bf||(tt.DocumentDiagnosticRequest=Bf={}));var Wf;(function(t){t.method="workspace/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Wf||(tt.WorkspaceDiagnosticRequest=Wf={}));var Kf;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=jn.MessageDirection.serverToClient,t.type=new jn.ProtocolRequestType0(t.method)})(Kf||(tt.DiagnosticRefreshRequest=Kf={}));var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.DidCloseNotebookDocumentNotification=ge.DidSaveNotebookDocumentNotification=ge.DidChangeNotebookDocumentNotification=ge.NotebookCellArrayChange=ge.DidOpenNotebookDocumentNotification=ge.NotebookDocumentSyncRegistrationType=ge.NotebookDocument=ge.NotebookCell=ge.ExecutionSummary=ge.NotebookCellKind=void 0;const Ui=Mc,dt=ye,At=K;var rc;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(rc||(ge.NotebookCellKind=rc={}));var nc;(function(t){function e(i,a){const s={executionOrder:i};return(a===!0||a===!1)&&(s.success=a),s}t.create=e;function r(i){const a=i;return dt.objectLiteral(a)&&Ui.uinteger.is(a.executionOrder)&&(a.success===void 0||dt.boolean(a.success))}t.is=r;function n(i,a){return i===a?!0:i==null||a===null||a===void 0?!1:i.executionOrder===a.executionOrder&&i.success===a.success}t.equals=n})(nc||(ge.ExecutionSummary=nc={}));var $s;(function(t){function e(a,s){return{kind:a,document:s}}t.create=e;function r(a){const s=a;return dt.objectLiteral(s)&&rc.is(s.kind)&&Ui.DocumentUri.is(s.document)&&(s.metadata===void 0||dt.objectLiteral(s.metadata))}t.is=r;function n(a,s){const o=new Set;return a.document!==s.document&&o.add("document"),a.kind!==s.kind&&o.add("kind"),a.executionSummary!==s.executionSummary&&o.add("executionSummary"),(a.metadata!==void 0||s.metadata!==void 0)&&!i(a.metadata,s.metadata)&&o.add("metadata"),(a.executionSummary!==void 0||s.executionSummary!==void 0)&&!nc.equals(a.executionSummary,s.executionSummary)&&o.add("executionSummary"),o}t.diff=n;function i(a,s){if(a===s)return!0;if(a==null||s===null||s===void 0||typeof a!=typeof s||typeof a!="object")return!1;const o=Array.isArray(a),l=Array.isArray(s);if(o!==l)return!1;if(o&&l){if(a.length!==s.length)return!1;for(let c=0;c<a.length;c++)if(!i(a[c],s[c]))return!1}if(dt.objectLiteral(a)&&dt.objectLiteral(s)){const c=Object.keys(a),u=Object.keys(s);if(c.length!==u.length||(c.sort(),u.sort(),!i(c,u)))return!1;for(let d=0;d<c.length;d++){const p=c[d];if(!i(a[p],s[p]))return!1}}return!0}})($s||(ge.NotebookCell=$s={}));var Vf;(function(t){function e(n,i,a,s){return{uri:n,notebookType:i,version:a,cells:s}}t.create=e;function r(n){const i=n;return dt.objectLiteral(i)&&dt.string(i.uri)&&Ui.integer.is(i.version)&&dt.typedArray(i.cells,$s.is)}t.is=r})(Vf||(ge.NotebookDocument=Vf={}));var zn;(function(t){t.method="notebookDocument/sync",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.RegistrationType(t.method)})(zn||(ge.NotebookDocumentSyncRegistrationType=zn={}));var qf;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(qf||(ge.DidOpenNotebookDocumentNotification=qf={}));var Hf;(function(t){function e(n){const i=n;return dt.objectLiteral(i)&&Ui.uinteger.is(i.start)&&Ui.uinteger.is(i.deleteCount)&&(i.cells===void 0||dt.typedArray(i.cells,$s.is))}t.is=e;function r(n,i,a){const s={start:n,deleteCount:i};return a!==void 0&&(s.cells=a),s}t.create=r})(Hf||(ge.NotebookCellArrayChange=Hf={}));var Xf;(function(t){t.method="notebookDocument/didChange",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Xf||(ge.DidChangeNotebookDocumentNotification=Xf={}));var Yf;(function(t){t.method="notebookDocument/didSave",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Yf||(ge.DidSaveNotebookDocumentNotification=Yf={}));var Jf;(function(t){t.method="notebookDocument/didClose",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Jf||(ge.DidCloseNotebookDocumentNotification=Jf={}));var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.InlineCompletionRequest=void 0;const Zf=K;var Qf;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Zf.MessageDirection.clientToServer,t.type=new Zf.ProtocolRequestType(t.method)})(Qf||(Vs.InlineCompletionRequest=Qf={}));(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=K,r=Mc,n=ye,i=Gs;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=js;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=On;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=zs;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=Ln;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=xn;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const u=Us;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=Bs;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const p=rr;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 g=nr;Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const A=Be;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return A.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return A.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return A.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return A.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return A.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return A.SemanticTokensRegistrationType}});const w=Ws;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return w.ShowDocumentRequest}});const I=Ks;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return I.LinkedEditingRangeRequest}});const b=Me;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return b.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return b.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return b.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return b.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return b.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return b.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return b.WillDeleteFilesRequest}});const L=ir;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return L.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return L.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return L.MonikerRequest}});const N=ar;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});const x=Fn;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const q=sr;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return q.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return q.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return q.InlayHintRefreshRequest}});const Z=tt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Z.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Z.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Z.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Z.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Z.DiagnosticRefreshRequest}});const Q=ge;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return Q.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return Q.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return Q.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return Q.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Q.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Q.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidCloseNotebookDocumentNotification}});const he=Vs;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return he.InlineCompletionRequest}});var ve;(function(f){function Ee(Ae){const B=Ae;return n.string(B)||n.string(B.language)||n.string(B.scheme)||n.string(B.pattern)}f.is=Ee})(ve||(t.TextDocumentFilter=ve={}));var oe;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebookType)||n.string(B.scheme)||n.string(B.pattern))}f.is=Ee})(oe||(t.NotebookDocumentFilter=oe={}));var S;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebook)||oe.is(B.notebook))&&(B.language===void 0||n.string(B.language))}f.is=Ee})(S||(t.NotebookCellTextDocumentFilter=S={}));var R;(function(f){function Ee(Ae){if(!Array.isArray(Ae))return!1;for(let B of Ae)if(!n.string(B)&&!ve.is(B)&&!S.is(B))return!1;return!0}f.is=Ee})(R||(t.DocumentSelector=R={}));var m;(function(f){f.method="client/registerCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(m||(t.RegistrationRequest=m={}));var $;(function(f){f.method="client/unregisterCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})($||(t.UnregistrationRequest=$={}));var y;(function(f){f.Create="create",f.Rename="rename",f.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(f){f.Abort="abort",f.Transactional="transactional",f.TextOnlyTransactional="textOnlyTransactional",f.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var E;(function(f){f.UTF8="utf-8",f.UTF16="utf-16",f.UTF32="utf-32"})(E||(t.PositionEncodingKind=E={}));var P;(function(f){function Ee(Ae){const B=Ae;return B&&n.string(B.id)&&B.id.length>0}f.hasId=Ee})(P||(t.StaticRegistrationOptions=P={}));var D;(function(f){function Ee(Ae){const B=Ae;return B&&(B.documentSelector===null||R.is(B.documentSelector))}f.is=Ee})(D||(t.TextDocumentRegistrationOptions=D={}));var O;(function(f){function Ee(B){const h=B;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}f.is=Ee;function Ae(B){const h=B;return h&&n.boolean(h.workDoneProgress)}f.hasWorkDoneProgress=Ae})(O||(t.WorkDoneProgressOptions=O={}));var j;(function(f){f.method="initialize",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(j||(t.InitializeRequest=j={}));var F;(function(f){f.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var re;(function(f){f.method="initialized",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(re||(t.InitializedNotification=re={}));var z;(function(f){f.method="shutdown",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType0(f.method)})(z||(t.ShutdownRequest=z={}));var ee;(function(f){f.method="exit",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType0(f.method)})(ee||(t.ExitNotification=ee={}));var Ie;(function(f){f.method="workspace/didChangeConfiguration",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Ie||(t.DidChangeConfigurationNotification=Ie={}));var pe;(function(f){f.Error=1,f.Warning=2,f.Info=3,f.Log=4,f.Debug=5})(pe||(t.MessageType=pe={}));var le;(function(f){f.method="window/showMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(le||(t.ShowMessageNotification=le={}));var be;(function(f){f.method="window/showMessageRequest",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(be||(t.ShowMessageRequest=be={}));var Pe;(function(f){f.method="window/logMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Pe||(t.LogMessageNotification=Pe={}));var Ce;(function(f){f.method="telemetry/event",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ce||(t.TelemetryEventNotification=Ce={}));var X;(function(f){f.None=0,f.Full=1,f.Incremental=2})(X||(t.TextDocumentSyncKind=X={}));var He;(function(f){f.method="textDocument/didOpen",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(He||(t.DidOpenTextDocumentNotification=He={}));var me;(function(f){function Ee(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}f.isIncremental=Ee;function Ae(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}f.isFull=Ae})(me||(t.TextDocumentContentChangeEvent=me={}));var at;(function(f){f.method="textDocument/didChange",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(at||(t.DidChangeTextDocumentNotification=at={}));var xr;(function(f){f.method="textDocument/didClose",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(xr||(t.DidCloseTextDocumentNotification=xr={}));var qn;(function(f){f.method="textDocument/didSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(qn||(t.DidSaveTextDocumentNotification=qn={}));var Hn;(function(f){f.Manual=1,f.AfterDelay=2,f.FocusOut=3})(Hn||(t.TextDocumentSaveReason=Hn={}));var Xn;(function(f){f.method="textDocument/willSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Xn||(t.WillSaveTextDocumentNotification=Xn={}));var Yn;(function(f){f.method="textDocument/willSaveWaitUntil",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Yn||(t.WillSaveTextDocumentWaitUntilRequest=Yn={}));var st;(function(f){f.method="workspace/didChangeWatchedFiles",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(st||(t.DidChangeWatchedFilesNotification=st={}));var Jn;(function(f){f.Created=1,f.Changed=2,f.Deleted=3})(Jn||(t.FileChangeType=Jn={}));var Zi;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(r.URI.is(B.baseUri)||r.WorkspaceFolder.is(B.baseUri))&&n.string(B.pattern)}f.is=Ee})(Zi||(t.RelativePattern=Zi={}));var Qi;(function(f){f.Create=1,f.Change=2,f.Delete=4})(Qi||(t.WatchKind=Qi={}));var ea;(function(f){f.method="textDocument/publishDiagnostics",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(ea||(t.PublishDiagnosticsNotification=ea={}));var ta;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.TriggerForIncompleteCompletions=3})(ta||(t.CompletionTriggerKind=ta={}));var Zn;(function(f){f.method="textDocument/completion",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Zn||(t.CompletionRequest=Zn={}));var Qn;(function(f){f.method="completionItem/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Qn||(t.CompletionResolveRequest=Qn={}));var bt;(function(f){f.method="textDocument/hover",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(bt||(t.HoverRequest=bt={}));var ei;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.ContentChange=3})(ei||(t.SignatureHelpTriggerKind=ei={}));var ra;(function(f){f.method="textDocument/signatureHelp",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ra||(t.SignatureHelpRequest=ra={}));var na;(function(f){f.method="textDocument/definition",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(na||(t.DefinitionRequest=na={}));var ti;(function(f){f.method="textDocument/references",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ti||(t.ReferencesRequest=ti={}));var ri;(function(f){f.method="textDocument/documentHighlight",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ri||(t.DocumentHighlightRequest=ri={}));var ia;(function(f){f.method="textDocument/documentSymbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ia||(t.DocumentSymbolRequest=ia={}));var aa;(function(f){f.method="textDocument/codeAction",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(aa||(t.CodeActionRequest=aa={}));var sa;(function(f){f.method="codeAction/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(sa||(t.CodeActionResolveRequest=sa={}));var oa;(function(f){f.method="workspace/symbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(oa||(t.WorkspaceSymbolRequest=oa={}));var la;(function(f){f.method="workspaceSymbol/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(la||(t.WorkspaceSymbolResolveRequest=la={}));var ca;(function(f){f.method="textDocument/codeLens",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ca||(t.CodeLensRequest=ca={}));var ot;(function(f){f.method="codeLens/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ot||(t.CodeLensResolveRequest=ot={}));var ua;(function(f){f.method="workspace/codeLens/refresh",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType0(f.method)})(ua||(t.CodeLensRefreshRequest=ua={}));var fa;(function(f){f.method="textDocument/documentLink",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(fa||(t.DocumentLinkRequest=fa={}));var hr;(function(f){f.method="documentLink/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(hr||(t.DocumentLinkResolveRequest=hr={}));var da;(function(f){f.method="textDocument/formatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(da||(t.DocumentFormattingRequest=da={}));var Dr;(function(f){f.method="textDocument/rangeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Dr||(t.DocumentRangeFormattingRequest=Dr={}));var ha;(function(f){f.method="textDocument/rangesFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ha||(t.DocumentRangesFormattingRequest=ha={}));var Nt;(function(f){f.method="textDocument/onTypeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Nt||(t.DocumentOnTypeFormattingRequest=Nt={}));var Jt;(function(f){f.Identifier=1})(Jt||(t.PrepareSupportDefaultBehavior=Jt={}));var pa;(function(f){f.method="textDocument/rename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(pa||(t.RenameRequest=pa={}));var ma;(function(f){f.method="textDocument/prepareRename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ma||(t.PrepareRenameRequest=ma={}));var Zt;(function(f){f.method="workspace/executeCommand",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Zt||(t.ExecuteCommandRequest=Zt={}));var ni;(function(f){f.method="workspace/applyEdit",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType("workspace/applyEdit")})(ni||(t.ApplyWorkspaceEditRequest=ni={}))})(Jh);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.createProtocolConnection=void 0;const ed=Lr;function cv(t,e,r,n){return ed.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ed.createMessageConnection)(t,e,r,n)}qs.createProtocolConnection=cv;(function(t){var e=rt&&rt.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,c)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=rt&&rt.__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(Lr,t),r(Mc,t),r(K,t),r(Jh,t);var n=qs;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={}))})(Yh);(function(t){var e=rt&&rt.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,c)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=rt&&rt.__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=Uu;r(Uu,t),r(Yh,t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(ki);var Ni;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Ni||(Ni={}));class uv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new ji,this.documentPhaseListeners=new ji,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=W.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=de.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===W.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,W.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=W.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=W.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=de.None){this.currentState=W.Changed;const i=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)i.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=W.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,W.Changed)}const s=ue(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,W.ComputedScopes)),await this.emitUpdate(a,i),await je(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var c;return l.state<W.Validated||!((c=this.buildState.get(l.uri.toString()))!=null&&c.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){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return ue(s).filter(c=>!a.has(c)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))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){var r;return!!((r=this.textDocuments)!=null&&r.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),Ni.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case W.Changed:case W.Parsed:this.indexManager.removeContent(e.uri);case W.IndexedContent:e.localSymbols=void 0;case W.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case W.Linked:this.indexManager.removeReferences(e.uri);case W.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case W.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=W.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,W.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,W.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,W.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,W.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,W.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,W.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==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.state<r&&(await je(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),Ni.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ni.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=de.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(nn);if(this.currentState>=e&&e>i.state)return Promise.reject(new ki.ResponseError(ki.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${W[i.state]}, requiring ${W[e]}, but workspace state is already ${W[this.currentState]}. Returning undefined.`))}else return Promise.reject(new ki.ResponseError(ki.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Je.equals(c.uri,r)&&(o.dispose(),l.dispose(),a(c.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(nn)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(nn):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(nn)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await je(n),await s(e,n)}catch(o){if(!Ms(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 je(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=ue(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}}class fv{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new SR,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=jt(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Je.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ue(i)}allElements(e,r){let n=ue(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=de.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=de.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 dv{constructor(e){this.initialBuildOptions={},this._ready=new xc,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=de.None){const n=await this.performStartup(e);await je(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=ue(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 ht.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=Je.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class hv{buildUnexpectedCharactersMessage(e,r,n,i,a){return Mo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Mo.buildUnableToPopLexerModeMessage(e)}}const pv={mode:"full"};class mv{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=td(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new We(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=pv){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(td(e))return e;const r=tp(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function gv(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function tp(t){return t&&"modes"in t&&"defaultMode"in t}function td(t){return!gv(t)&&!tp(t)}function yv(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=J.create(0,0));const a=rp(t),s=Fc(n),o=vv({lines:a,position:i,options:s});return Sv({index:0,tokens:o,position:i})}function Tv(t,e){const r=Fc(e),n=rp(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function rp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Tm)}const rd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Rv=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function vv(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,c=o===t.lines.length-1;let u=t.lines[o],d=0;if(l&&t.options.start){const g=(i=t.options.start)==null?void 0:i.exec(u);g&&(d=g.index+g[0].length)}else{const g=(a=t.options.line)==null?void 0:a.exec(u);g&&(d=g.index+g[0].length)}if(c){const g=(s=t.options.end)==null?void 0:s.exec(u);g&&(u=u.substring(0,g.index))}if(u=u.substring(0,Cv(u)),ic(u,d)>=u.length){if(e.length>0){const g=J.create(r,n);e.push({type:"break",content:"",range:V.create(g,g)})}}else{rd.lastIndex=d;const g=rd.exec(u);if(g){const A=g[0],w=g[1],I=J.create(r,n+d),b=J.create(r,n+d+A.length);e.push({type:"tag",content:w,range:V.create(I,b)}),d+=A.length,d=ic(u,d)}if(d<u.length){const A=u.substring(d),w=Array.from(A.matchAll(Rv));e.push(...Ev(w,A,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function Ev(t,e,r,n){const i=[];if(t.length===0){const a=J.create(r,n),s=J.create(r,n+e.length);i.push({type:"text",content:e,range:V.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,c=e.substring(a,l);c.length>0&&i.push({type:"text",content:e.substring(a,l),range:V.create(J.create(r,a+n),J.create(r,l+n))});let u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:V.create(J.create(r,a+u+n),J.create(r,a+u+d.length+n))}),u+=d.length,o.length===4){u+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:V.create(J.create(r,a+u+n),J.create(r,a+u+p.length+n))})}else i.push({type:"text",content:"",range:V.create(J.create(r,a+u+n),J.create(r,a+u+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V.create(J.create(r,a+n),J.create(r,a+n+s.length))})}return i}const Av=/\S/,$v=/\s*$/;function ic(t,e){const r=t.substring(e).match(Av);return r?e+r.index:t.length}function Cv(t){const e=t.match($v);if(e&&typeof e.index=="number")return e.index}function Sv(t){var a,s;const e=J.create(t.position.line,t.position.character);if(t.tokens.length===0)return new nd([],V.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=wv(t,r[r.length-1]);o&&r.push(o)}const n=((a=r[0])==null?void 0:a.range.start)??e,i=((s=r[r.length-1])==null?void 0:s.range.end)??e;return new nd(r,V.create(n,i))}function wv(t,e){const r=t.tokens[t.index];if(r.type==="tag")return ip(t,!1);if(r.type==="text"||r.type==="inline-tag")return np(t);kv(r,e),t.index++}function kv(t,e){if(e){const r=new sp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function np(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(bv(t)),n=e,e=t.tokens[t.index];return new ac(i,V.create(r.range.start,n.range.end))}function bv(t){return t.tokens[t.index].type==="inline-tag"?ip(t,!0):ap(t)}function ip(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=ap(t);return new fo(n,new ac([a],a.range),e,V.create(r.range.start,a.range.end))}else{const a=np(t);return new fo(n,a,e,V.create(r.range.start,a.range.end))}else{const a=r.range;return new fo(n,new ac([],a),e,a)}}function ap(t){const e=t.tokens[t.index++];return new sp(e.content,e.range)}function Fc(t){if(!t)return Fc({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:uo(e,!0),end:uo(r,!1),line:uo(n,!0)}}function uo(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?bs(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class nd{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+=id(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+=id(r)+i}return r.trim()}}class fo{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){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Nv(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0: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 Nv(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=ic(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??_v(e,a)}}function _v(t,e){try{return ht.parse(t,!0),`[${e}](${t})`}catch{return t}}class ac{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 sp{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function id(t){return t.endsWith(`
156
+ `)?`
157
+ `:`
158
+
159
+ `}class Iv{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Tv(r))return yv(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=jt(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 Pv{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return bR(e)?e.$comment:(r=hm(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}}class Ov{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class Lv{constructor(){this.previousTokenSource=new Lc,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=hR();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=de.None){const i=new xc,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){Ms(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class xv{constructor(e){this.grammarElementIdMap=new Nu,this.tokenTypeIdMap=new Nu,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 zt(e))r.set(i,{});if(e.$cstNode)for(const i of Po(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)Fe(o)?s.push(this.dehydrateAstNode(o,r)):ft(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Fe(a)?n[i]=this.dehydrateAstNode(a,r):ft(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 Ad(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),_i(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Ed(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 zt(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Po(e.$cstNode)){let s;"fullText"in a?(s=new Nh(a.fullText),i=s):"content"in a?s=new Ic:"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)Fe(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ft(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Fe(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ft(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),_i(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,c=e.hidden;return new Kl(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of zt(this.grammar))Wp(r)&&this.grammarElementIdMap.set(r,e++)}}function St(t){return{documentation:{CommentProvider:e=>new Pv(e),DocumentationProvider:e=>new Iv(e)},parser:{AsyncParser:e=>new Ov(e),GrammarConfig:e=>jm(e),LangiumParser:e=>ZT(e),CompletionParser:e=>JT(e),ValueConverter:()=>new Fh,TokenBuilder:()=>new Mh,Lexer:e=>new mv(e),ParserErrorMessageProvider:()=>new Ph,LexerErrorMessageProvider:()=>new hv},workspace:{AstNodeLocator:()=>new FR,AstNodeDescriptionProvider:e=>new DR(e),ReferenceDescriptionProvider:e=>new MR(e)},references:{Linker:e=>new TR(e),NameProvider:()=>new vR,ScopeProvider:e=>new kR(e),ScopeComputation:e=>new AR(e),References:e=>new ER(e)},serializer:{Hydrator:e=>new xv(e),JsonSerializer:e=>new NR(e)},validation:{DocumentValidator:e=>new OR(e),ValidationRegistry:e=>new IR(e)},shared:()=>t.shared}}function wt(t){return{ServiceRegistry:e=>new _R(e),workspace:{LangiumDocuments:e=>new yR(e),LangiumDocumentFactory:e=>new gR(e),DocumentBuilder:e=>new uv(e),IndexManager:e=>new fv(e),WorkspaceManager:e=>new dv(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Lv,ConfigurationProvider:e=>new GR(e)},profilers:{}}}var ad;(function(t){t.merge=(e,r)=>Bi(Bi({},e),r)})(ad||(ad={}));function ke(t,e,r,n,i,a,s,o,l){const c=[t,e,r,n,i,a,s,o,l].reduce(Bi,{});return op(c)}const Dv=Symbol("isProxy");function op(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===Dv?!0:od(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(od(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const sd=Symbol();function od(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]===sd)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]=sd;try{t[e]=typeof i=="function"?i(n):op(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function Bi(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]=Bi(i,n):t[r]=Bi({},n)}else t[r]=n}return t}class Mv{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 kt={fileSystemProvider:()=>new Mv},Fv={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Gv={AstReflection:()=>new bd};function jv(){const t=ke(wt(kt),Gv),e=ke(St({shared:t}),Fv);return t.ServiceRegistry.register(e),e}function Ht(t){const e=jv(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ht.parse(`memory:/${r.name??"grammar"}.langium`)),r}var zv=Object.defineProperty,k=(t,e)=>zv(t,"name",{value:e,configurable:!0}),sc;(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 ]+)\]/}})(sc||(sc={}));var oc;(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])?/}})(oc||(oc={}));var lc;(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]*/}})(lc||(lc={}));var cc;(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]*/}})(cc||(cc={}));var uc;(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]*/}})(uc||(uc={}));var fc;(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]*/}})(fc||(fc={}));var dc;(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:/"[^"]*"|'[^']*'/}})(dc||(dc={}));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]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(hc||(hc={}));var pc;(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]*/}})(pc||(pc={}));({...sc.Terminals,...oc.Terminals,...lc.Terminals,...cc.Terminals,...uc.Terminals,...fc.Terminals,...hc.Terminals,...dc.Terminals,...pc.Terminals});var Ca={$type:"Accelerator",name:"name",x:"x",y:"y"},Sa={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},pi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},ho={$type:"Annotations",x:"x",y:"y"},xt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Uv(t){return it.isInstance(t,xt.$type)}k(Uv,"isArchitecture");var wa={$type:"Axis",label:"label",name:"name"},qa={$type:"Branch",name:"name",order:"order"};function Bv(t){return it.isInstance(t,qa.$type)}k(Bv,"isBranch");var ld={$type:"Checkout",branch:"branch"},ka={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},po={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Jr={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Wv(t){return it.isInstance(t,Jr.$type)}k(Wv,"isCommit");var gr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},ba={$type:"Curve",entries:"entries",label:"label",name:"name"},Na={$type:"Deaccelerator",name:"name",x:"x",y:"y"},cd={$type:"Decorator",strategy:"strategy"},jr={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},mt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},mo={$type:"Entry",axis:"axis",value:"value"},ud={$type:"Evolution",stages:"stages"},_a={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},go={$type:"Evolve",component:"component",target:"target"},$r={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Kv(t){return it.isInstance(t,$r.$type)}k(Kv,"isGitGraph");var mi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},bi={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Vv(t){return it.isInstance(t,bi.$type)}k(Vv,"isInfo");var gi={$type:"Item",classSelector:"classSelector",name:"name"},yo={$type:"Junction",id:"id",in:"in"},yi={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},Ia={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},yr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Zr={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function qv(t){return it.isInstance(t,Zr.$type)}k(qv,"isMerge");var Pa={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},To={$type:"Option",name:"name",value:"value"},Qr={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function Hv(t){return it.isInstance(t,Qr.$type)}k(Hv,"isPacket");var en={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Xv(t){return it.isInstance(t,en.$type)}k(Xv,"isPacketBlock");var Cr={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Yv(t){return it.isInstance(t,Cr.$type)}k(Yv,"isPie");var Ha={$type:"PieSection",label:"label",value:"value"};function Jv(t){return it.isInstance(t,Ha.$type)}k(Jv,"isPieSection");var Ro={$type:"Pipeline",components:"components",parent:"parent"},Oa={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Tr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},vo={$type:"Section",classSelector:"classSelector",name:"name"},zr={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Eo={$type:"Size",height:"height",width:"width"},Ur={$type:"Statement"},tn={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Zv(t){return it.isInstance(t,tn.$type)}k(Zv,"isTreemap");var Ao={$type:"TreemapRow",indent:"indent",item:"item"},$o={$type:"TreeNode",indent:"indent",name:"name"},Ti={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Oe={$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 Qv(t){return it.isInstance(t,Oe.$type)}k(Qv,"isWardley");var sn,lp=(sn=class extends vd{constructor(){super(...arguments),this.types={Accelerator:{name:Ca.$type,properties:{name:{name:Ca.name},x:{name:Ca.x},y:{name:Ca.y}},superTypes:[]},Anchor:{name:Sa.$type,properties:{evolution:{name:Sa.evolution},name:{name:Sa.name},visibility:{name:Sa.visibility}},superTypes:[]},Annotation:{name:pi.$type,properties:{number:{name:pi.number},text:{name:pi.text},x:{name:pi.x},y:{name:pi.y}},superTypes:[]},Annotations:{name:ho.$type,properties:{x:{name:ho.x},y:{name:ho.y}},superTypes:[]},Architecture:{name:xt.$type,properties:{accDescr:{name:xt.accDescr},accTitle:{name:xt.accTitle},edges:{name:xt.edges,defaultValue:[]},groups:{name:xt.groups,defaultValue:[]},junctions:{name:xt.junctions,defaultValue:[]},services:{name:xt.services,defaultValue:[]},title:{name:xt.title}},superTypes:[]},Axis:{name:wa.$type,properties:{label:{name:wa.label},name:{name:wa.name}},superTypes:[]},Branch:{name:qa.$type,properties:{name:{name:qa.name},order:{name:qa.order}},superTypes:[Ur.$type]},Checkout:{name:ld.$type,properties:{branch:{name:ld.branch}},superTypes:[Ur.$type]},CherryPicking:{name:ka.$type,properties:{id:{name:ka.id},parent:{name:ka.parent},tags:{name:ka.tags,defaultValue:[]}},superTypes:[Ur.$type]},ClassDefStatement:{name:po.$type,properties:{className:{name:po.className},styleText:{name:po.styleText}},superTypes:[]},Commit:{name:Jr.$type,properties:{id:{name:Jr.id},message:{name:Jr.message},tags:{name:Jr.tags,defaultValue:[]},type:{name:Jr.type}},superTypes:[Ur.$type]},Component:{name:gr.$type,properties:{decorator:{name:gr.decorator},evolution:{name:gr.evolution},inertia:{name:gr.inertia,defaultValue:!1},label:{name:gr.label},name:{name:gr.name},visibility:{name:gr.visibility}},superTypes:[]},Curve:{name:ba.$type,properties:{entries:{name:ba.entries,defaultValue:[]},label:{name:ba.label},name:{name:ba.name}},superTypes:[]},Deaccelerator:{name:Na.$type,properties:{name:{name:Na.name},x:{name:Na.x},y:{name:Na.y}},superTypes:[]},Decorator:{name:cd.$type,properties:{strategy:{name:cd.strategy}},superTypes:[]},Direction:{name:jr.$type,properties:{accDescr:{name:jr.accDescr},accTitle:{name:jr.accTitle},dir:{name:jr.dir},statements:{name:jr.statements,defaultValue:[]},title:{name:jr.title}},superTypes:[$r.$type]},Edge:{name:mt.$type,properties:{lhsDir:{name:mt.lhsDir},lhsGroup:{name:mt.lhsGroup,defaultValue:!1},lhsId:{name:mt.lhsId},lhsInto:{name:mt.lhsInto,defaultValue:!1},rhsDir:{name:mt.rhsDir},rhsGroup:{name:mt.rhsGroup,defaultValue:!1},rhsId:{name:mt.rhsId},rhsInto:{name:mt.rhsInto,defaultValue:!1},title:{name:mt.title}},superTypes:[]},Entry:{name:mo.$type,properties:{axis:{name:mo.axis,referenceType:wa.$type},value:{name:mo.value}},superTypes:[]},Evolution:{name:ud.$type,properties:{stages:{name:ud.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:_a.$type,properties:{boundary:{name:_a.boundary},name:{name:_a.name},secondName:{name:_a.secondName}},superTypes:[]},Evolve:{name:go.$type,properties:{component:{name:go.component},target:{name:go.target}},superTypes:[]},GitGraph:{name:$r.$type,properties:{accDescr:{name:$r.accDescr},accTitle:{name:$r.accTitle},statements:{name:$r.statements,defaultValue:[]},title:{name:$r.title}},superTypes:[]},Group:{name:mi.$type,properties:{icon:{name:mi.icon},id:{name:mi.id},in:{name:mi.in},title:{name:mi.title}},superTypes:[]},Info:{name:bi.$type,properties:{accDescr:{name:bi.accDescr},accTitle:{name:bi.accTitle},title:{name:bi.title}},superTypes:[]},Item:{name:gi.$type,properties:{classSelector:{name:gi.classSelector},name:{name:gi.name}},superTypes:[]},Junction:{name:yo.$type,properties:{id:{name:yo.id},in:{name:yo.in}},superTypes:[]},Label:{name:yi.$type,properties:{negX:{name:yi.negX,defaultValue:!1},negY:{name:yi.negY,defaultValue:!1},offsetX:{name:yi.offsetX},offsetY:{name:yi.offsetY}},superTypes:[]},Leaf:{name:Ia.$type,properties:{classSelector:{name:Ia.classSelector},name:{name:Ia.name},value:{name:Ia.value}},superTypes:[gi.$type]},Link:{name:yr.$type,properties:{arrow:{name:yr.arrow},from:{name:yr.from},fromPort:{name:yr.fromPort},linkLabel:{name:yr.linkLabel},to:{name:yr.to},toPort:{name:yr.toPort}},superTypes:[]},Merge:{name:Zr.$type,properties:{branch:{name:Zr.branch},id:{name:Zr.id},tags:{name:Zr.tags,defaultValue:[]},type:{name:Zr.type}},superTypes:[Ur.$type]},Note:{name:Pa.$type,properties:{evolution:{name:Pa.evolution},text:{name:Pa.text},visibility:{name:Pa.visibility}},superTypes:[]},Option:{name:To.$type,properties:{name:{name:To.name},value:{name:To.value,defaultValue:!1}},superTypes:[]},Packet:{name:Qr.$type,properties:{accDescr:{name:Qr.accDescr},accTitle:{name:Qr.accTitle},blocks:{name:Qr.blocks,defaultValue:[]},title:{name:Qr.title}},superTypes:[]},PacketBlock:{name:en.$type,properties:{bits:{name:en.bits},end:{name:en.end},label:{name:en.label},start:{name:en.start}},superTypes:[]},Pie:{name:Cr.$type,properties:{accDescr:{name:Cr.accDescr},accTitle:{name:Cr.accTitle},sections:{name:Cr.sections,defaultValue:[]},showData:{name:Cr.showData,defaultValue:!1},title:{name:Cr.title}},superTypes:[]},PieSection:{name:Ha.$type,properties:{label:{name:Ha.label},value:{name:Ha.value}},superTypes:[]},Pipeline:{name:Ro.$type,properties:{components:{name:Ro.components,defaultValue:[]},parent:{name:Ro.parent}},superTypes:[]},PipelineComponent:{name:Oa.$type,properties:{evolution:{name:Oa.evolution},label:{name:Oa.label},name:{name:Oa.name}},superTypes:[]},Radar:{name:Tr.$type,properties:{accDescr:{name:Tr.accDescr},accTitle:{name:Tr.accTitle},axes:{name:Tr.axes,defaultValue:[]},curves:{name:Tr.curves,defaultValue:[]},options:{name:Tr.options,defaultValue:[]},title:{name:Tr.title}},superTypes:[]},Section:{name:vo.$type,properties:{classSelector:{name:vo.classSelector},name:{name:vo.name}},superTypes:[gi.$type]},Service:{name:zr.$type,properties:{icon:{name:zr.icon},iconText:{name:zr.iconText},id:{name:zr.id},in:{name:zr.in},title:{name:zr.title}},superTypes:[]},Size:{name:Eo.$type,properties:{height:{name:Eo.height},width:{name:Eo.width}},superTypes:[]},Statement:{name:Ur.$type,properties:{},superTypes:[]},TreeNode:{name:$o.$type,properties:{indent:{name:$o.indent},name:{name:$o.name}},superTypes:[]},TreeView:{name:Ti.$type,properties:{accDescr:{name:Ti.accDescr},accTitle:{name:Ti.accTitle},nodes:{name:Ti.nodes,defaultValue:[]},title:{name:Ti.title}},superTypes:[]},Treemap:{name:tn.$type,properties:{accDescr:{name:tn.accDescr},accTitle:{name:tn.accTitle},title:{name:tn.title},TreemapRows:{name:tn.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Ao.$type,properties:{indent:{name:Ao.indent},item:{name:Ao.item}},superTypes:[]},Wardley:{name:Oe.$type,properties:{accDescr:{name:Oe.accDescr},accelerators:{name:Oe.accelerators,defaultValue:[]},accTitle:{name:Oe.accTitle},anchors:{name:Oe.anchors,defaultValue:[]},annotation:{name:Oe.annotation,defaultValue:[]},annotations:{name:Oe.annotations,defaultValue:[]},components:{name:Oe.components,defaultValue:[]},deaccelerators:{name:Oe.deaccelerators,defaultValue:[]},evolution:{name:Oe.evolution},evolves:{name:Oe.evolves,defaultValue:[]},links:{name:Oe.links,defaultValue:[]},notes:{name:Oe.notes,defaultValue:[]},pipelines:{name:Oe.pipelines,defaultValue:[]},size:{name:Oe.size},title:{name:Oe.title}},superTypes:[]}}}},k(sn,"MermaidAstReflection"),sn),it=new lp,fd,eE=k(()=>fd??(fd=Ht(`{"$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"),dd,tE=k(()=>dd??(dd=Ht(`{"$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"),hd,rE=k(()=>hd??(hd=Ht(`{"$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"),pd,nE=k(()=>pd??(pd=Ht(`{"$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"),md,iE=k(()=>md??(md=Ht(`{"$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"),gd,aE=k(()=>gd??(gd=Ht(`{"$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"),yd,sE=k(()=>yd??(yd=Ht(`{"$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"),Td,oE=k(()=>Td??(Td=Ht(`{"$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"),Rd,lE=k(()=>Rd??(Rd=Ht(`{"$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"),cE={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uE={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fE={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dE={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hE={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pE={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mE={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gE={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yE={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Xt={AstReflection:k(()=>new lp,"AstReflection")},TE={Grammar:k(()=>eE(),"Grammar"),LanguageMetaData:k(()=>cE,"LanguageMetaData"),parser:{}},RE={Grammar:k(()=>tE(),"Grammar"),LanguageMetaData:k(()=>uE,"LanguageMetaData"),parser:{}},vE={Grammar:k(()=>rE(),"Grammar"),LanguageMetaData:k(()=>fE,"LanguageMetaData"),parser:{}},EE={Grammar:k(()=>nE(),"Grammar"),LanguageMetaData:k(()=>dE,"LanguageMetaData"),parser:{}},AE={Grammar:k(()=>iE(),"Grammar"),LanguageMetaData:k(()=>hE,"LanguageMetaData"),parser:{}},$E={Grammar:k(()=>aE(),"Grammar"),LanguageMetaData:k(()=>pE,"LanguageMetaData"),parser:{}},CE={Grammar:k(()=>sE(),"Grammar"),LanguageMetaData:k(()=>mE,"LanguageMetaData"),parser:{}},SE={Grammar:k(()=>oE(),"Grammar"),LanguageMetaData:k(()=>gE,"LanguageMetaData"),parser:{}},wE={Grammar:k(()=>lE(),"Grammar"),LanguageMetaData:k(()=>yE,"LanguageMetaData"),parser:{}},kE=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,bE=/accTitle[\t ]*:([^\n\r]*)/,NE=/title([\t ][^\n\r]*|)/,_E={ACC_DESCR:kE,ACC_TITLE:bE,TITLE:NE},on,Vn=(on=class extends Fh{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=_E[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(on,"AbstractMermaidValueConverter"),on),ln,Hs=(ln=class extends Vn{runCustomConverter(e,r,n){}},k(ln,"CommonValueConverter"),ln),cn,Yt=(cn=class extends Mh{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(cn,"AbstractMermaidTokenBuilder"),cn),un;un=class extends Yt{},k(un,"CommonTokenBuilder");var fn,IE=(fn=class extends Yt{constructor(){super(["treemap"])}},k(fn,"TreemapTokenBuilder"),fn),PE=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,dn,OE=(dn=class extends Vn{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=PE.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},k(dn,"TreemapValueConverter"),dn);function cp(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}k(cp,"registerValidationChecks");var hn,LE=(hn=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(hn,"TreemapValidator"),hn),up={parser:{TokenBuilder:k(()=>new IE,"TokenBuilder"),ValueConverter:k(()=>new OE,"ValueConverter")},validation:{TreemapValidator:k(()=>new LE,"TreemapValidator")}};function fp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),CE,up);return e.ServiceRegistry.register(r),cp(r),{shared:e,Treemap:r}}k(fp,"createTreemapServices");var pn,xE=(pn=class extends Vn{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},k(pn,"WardleyValueConverter"),pn),dp={parser:{ValueConverter:k(()=>new xE,"ValueConverter")}};function hp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),wE,dp);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}k(hp,"createWardleyServices");var mn,DE=(mn=class extends Yt{constructor(){super(["gitGraph"])}},k(mn,"GitGraphTokenBuilder"),mn),pp={parser:{TokenBuilder:k(()=>new DE,"TokenBuilder"),ValueConverter:k(()=>new Hs,"ValueConverter")}};function mp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),RE,pp);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}k(mp,"createGitGraphServices");var gn,ME=(gn=class extends Yt{constructor(){super(["info","showInfo"])}},k(gn,"InfoTokenBuilder"),gn),gp={parser:{TokenBuilder:k(()=>new ME,"TokenBuilder"),ValueConverter:k(()=>new Hs,"ValueConverter")}};function yp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),vE,gp);return e.ServiceRegistry.register(r),{shared:e,Info:r}}k(yp,"createInfoServices");var yn,FE=(yn=class extends Yt{constructor(){super(["packet"])}},k(yn,"PacketTokenBuilder"),yn),Tp={parser:{TokenBuilder:k(()=>new FE,"TokenBuilder"),ValueConverter:k(()=>new Hs,"ValueConverter")}};function Rp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),EE,Tp);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}k(Rp,"createPacketServices");var Tn,GE=(Tn=class extends Yt{constructor(){super(["pie","showData"])}},k(Tn,"PieTokenBuilder"),Tn),Rn,jE=(Rn=class extends Vn{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},k(Rn,"PieValueConverter"),Rn),vp={parser:{TokenBuilder:k(()=>new GE,"TokenBuilder"),ValueConverter:k(()=>new jE,"ValueConverter")}};function Ep(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),AE,vp);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}k(Ep,"createPieServices");var vn,zE=(vn=class extends Vn{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="STRING2")return r.substring(1,r.length-1)}},k(vn,"TreeViewValueConverter"),vn),En,UE=(En=class extends Yt{constructor(){super(["treeView-beta"])}},k(En,"TreeViewTokenBuilder"),En),Ap={parser:{TokenBuilder:k(()=>new UE,"TokenBuilder"),ValueConverter:k(()=>new zE,"ValueConverter")}};function $p(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),SE,Ap);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}k($p,"createTreeViewServices");var An,BE=(An=class extends Yt{constructor(){super(["architecture"])}},k(An,"ArchitectureTokenBuilder"),An),$n,WE=($n=class extends Vn{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($n,"ArchitectureValueConverter"),$n),Cp={parser:{TokenBuilder:k(()=>new BE,"TokenBuilder"),ValueConverter:k(()=>new WE,"ValueConverter")}};function Sp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),TE,Cp);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}k(Sp,"createArchitectureServices");var Cn,KE=(Cn=class extends Yt{constructor(){super(["radar-beta"])}},k(Cn,"RadarTokenBuilder"),Cn),wp={parser:{TokenBuilder:k(()=>new KE,"TokenBuilder"),ValueConverter:k(()=>new Hs,"ValueConverter")}};function kp(t=kt){const e=ke(wt(t),Xt),r=ke(St({shared:e}),$E,wp);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}k(kp,"createRadarServices");var ct={},VE={info:k(async()=>{const{createInfoServices:t}=await _t(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>XE);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;ct.info=e},"info"),packet:k(async()=>{const{createPacketServices:t}=await _t(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>YE);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;ct.packet=e},"packet"),pie:k(async()=>{const{createPieServices:t}=await _t(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>JE);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;ct.pie=e},"pie"),treeView:k(async()=>{const{createTreeViewServices:t}=await _t(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>ZE);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;ct.treeView=e},"treeView"),architecture:k(async()=>{const{createArchitectureServices:t}=await _t(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>QE);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;ct.architecture=e},"architecture"),gitGraph:k(async()=>{const{createGitGraphServices:t}=await _t(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>eA);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;ct.gitGraph=e},"gitGraph"),radar:k(async()=>{const{createRadarServices:t}=await _t(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>tA);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;ct.radar=e},"radar"),treemap:k(async()=>{const{createTreemapServices:t}=await _t(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>rA);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;ct.treemap=e},"treemap"),wardley:k(async()=>{const{createWardleyServices:t}=await _t(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>nA);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;ct.wardley=e},"wardley")};async function qE(t,e){const r=VE[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);ct[t]||await r();const i=ct[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new HE(i);return i.value}k(qE,"parse");var Sn,HE=(Sn=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(Sn,"MermaidParseError"),Sn);const XE=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:gp,createInfoServices:yp},Symbol.toStringTag,{value:"Module"})),YE=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Tp,createPacketServices:Rp},Symbol.toStringTag,{value:"Module"})),JE=Object.freeze(Object.defineProperty({__proto__:null,PieModule:vp,createPieServices:Ep},Symbol.toStringTag,{value:"Module"})),ZE=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Ap,createTreeViewServices:$p},Symbol.toStringTag,{value:"Module"})),QE=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Cp,createArchitectureServices:Sp},Symbol.toStringTag,{value:"Module"})),eA=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:pp,createGitGraphServices:mp},Symbol.toStringTag,{value:"Module"})),tA=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:wp,createRadarServices:kp},Symbol.toStringTag,{value:"Module"})),rA=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:up,createTreemapServices:fp},Symbol.toStringTag,{value:"Module"})),nA=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:dp,createWardleyServices:hp},Symbol.toStringTag,{value:"Module"}));export{qE as p};