@yancyyu/openhermit 1.6.27 → 1.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/bin/hermit.mjs +2 -2
- package/dist-renderer/assets/ProjectEditorOverlay-CQm6jUR1.js +52 -0
- package/dist-renderer/assets/{TeamGraphOverlay-DVq8rt6_.js → TeamGraphOverlay-h0WDfifv.js} +1 -1
- package/dist-renderer/assets/{_basePickBy-ZbF0pKvS.js → _basePickBy-CgG_tjgX.js} +1 -1
- package/dist-renderer/assets/{_baseUniq-BBLBOeXc.js → _baseUniq-DwPTU9lP.js} +1 -1
- package/dist-renderer/assets/{arc-wGaEgkCf.js → arc-7nIrGRzY.js} +1 -1
- package/dist-renderer/assets/{architectureDiagram-VXUJARFQ-BpMkdC35.js → architectureDiagram-VXUJARFQ-BYhA6Ev2.js} +1 -1
- package/dist-renderer/assets/{blockDiagram-VD42YOAC-C8Z1xhG4.js → blockDiagram-VD42YOAC-BVpZUGDg.js} +1 -1
- package/dist-renderer/assets/{c4Diagram-YG6GDRKO-CJmlw9LA.js → c4Diagram-YG6GDRKO-DsdreMQ9.js} +1 -1
- package/dist-renderer/assets/channel-C0SqeFU7.js +1 -0
- package/dist-renderer/assets/{chunk-4BX2VUAB-CHPHiRPP.js → chunk-4BX2VUAB-CcoAs7Jd.js} +1 -1
- package/dist-renderer/assets/{chunk-55IACEB6-DyVohOQb.js → chunk-55IACEB6-CGGAOoXd.js} +1 -1
- package/dist-renderer/assets/{chunk-B4BG7PRW-p5bffh_R.js → chunk-B4BG7PRW-FhpTEPvD.js} +1 -1
- package/dist-renderer/assets/{chunk-DI55MBZ5-BnfGPSUu.js → chunk-DI55MBZ5-DoYySbm1.js} +1 -1
- package/dist-renderer/assets/{chunk-FMBD7UC4-B6SCKseX.js → chunk-FMBD7UC4-e9l2tGHG.js} +1 -1
- package/dist-renderer/assets/{chunk-QN33PNHL-L12RvLBR.js → chunk-QN33PNHL-DeiXVTCy.js} +1 -1
- package/dist-renderer/assets/{chunk-QZHKN3VN-DeH1Kxge.js → chunk-QZHKN3VN-DC2UJLJM.js} +1 -1
- package/dist-renderer/assets/{chunk-TZMSLE5B-BWnjzSlI.js → chunk-TZMSLE5B-BHFD9eZI.js} +1 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-DWew1HpM.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-DWew1HpM.js +1 -0
- package/dist-renderer/assets/clone-Dm-k63Yr.js +1 -0
- package/dist-renderer/assets/{cose-bilkent-S5V4N54A-BtzoT5fu.js → cose-bilkent-S5V4N54A-BdybQraU.js} +1 -1
- package/dist-renderer/assets/{dagre-6UL2VRFP-CBBvuoUD.js → dagre-6UL2VRFP-DdF3pwM3.js} +1 -1
- package/dist-renderer/assets/{diagram-PSM6KHXK-Be9BAKws.js → diagram-PSM6KHXK-B9Ldd3nh.js} +1 -1
- package/dist-renderer/assets/{diagram-QEK2KX5R-BDS4PI_i.js → diagram-QEK2KX5R-XEqkrbpu.js} +1 -1
- package/dist-renderer/assets/{diagram-S2PKOQOG-2Rameaq7.js → diagram-S2PKOQOG-CipwtY59.js} +1 -1
- package/dist-renderer/assets/{erDiagram-Q2GNP2WA-CSIzCEZD.js → erDiagram-Q2GNP2WA-BB-2ISGo.js} +1 -1
- package/dist-renderer/assets/{flowDiagram-NV44I4VS-ForEIVM5.js → flowDiagram-NV44I4VS-B8XmJ0u2.js} +1 -1
- package/dist-renderer/assets/{ganttDiagram-JELNMOA3-BJrli_xr.js → ganttDiagram-JELNMOA3-D-8XglBb.js} +1 -1
- package/dist-renderer/assets/{gitGraphDiagram-V2S2FVAM-C_4GuLno.js → gitGraphDiagram-V2S2FVAM-DL4ChakD.js} +1 -1
- package/dist-renderer/assets/{graph-B1EAT_gw.js → graph-BiFNoBjP.js} +1 -1
- package/dist-renderer/assets/{index-eKRmS5kI.js → index-6m1ZAymG.js} +1 -1
- package/dist-renderer/assets/index-BhellmRb.css +1 -0
- package/dist-renderer/assets/{index-DYdseEwc.js → index-BowUl0Jb.js} +518 -514
- package/dist-renderer/assets/{index-DR602dwJ.js → index-Dp3kJTEe.js} +1 -1
- package/dist-renderer/assets/{index-Dwr5wu5x.js → index-TOpt_T7A.js} +1 -1
- package/dist-renderer/assets/{index-DOA_jbYb.js → index-qNBNjW4K.js} +1 -1
- package/dist-renderer/assets/{index-k4tnOFC5.js → index-vAykq1H1.js} +1 -1
- package/dist-renderer/assets/{infoDiagram-HS3SLOUP-DjI0uaMz.js → infoDiagram-HS3SLOUP-DRIBfHDi.js} +1 -1
- package/dist-renderer/assets/{journeyDiagram-XKPGCS4Q-jQ6Thae-.js → journeyDiagram-XKPGCS4Q-BOMiigU4.js} +1 -1
- package/dist-renderer/assets/{kanban-definition-3W4ZIXB7-CKw6InbL.js → kanban-definition-3W4ZIXB7-DDxeyjod.js} +1 -1
- package/dist-renderer/assets/{layout-Dad20y3V.js → layout-DNANbrI4.js} +1 -1
- package/dist-renderer/assets/{linear-vMgo_2Cv.js → linear-DxEJi1yT.js} +1 -1
- package/dist-renderer/assets/{mindmap-definition-VGOIOE7T-DYp6YoHL.js → mindmap-definition-VGOIOE7T-nBfGriW8.js} +1 -1
- package/dist-renderer/assets/{pieDiagram-ADFJNKIX-BytBecG9.js → pieDiagram-ADFJNKIX-Din5j6sV.js} +1 -1
- package/dist-renderer/assets/{quadrantDiagram-AYHSOK5B-RUaspLsc.js → quadrantDiagram-AYHSOK5B-DMVK2BEQ.js} +1 -1
- package/dist-renderer/assets/{requirementDiagram-UZGBJVZJ-rR2B1Use.js → requirementDiagram-UZGBJVZJ-6SC94Gg_.js} +1 -1
- package/dist-renderer/assets/{sankeyDiagram-TZEHDZUN-BJi5qYhq.js → sankeyDiagram-TZEHDZUN-CD2gghhu.js} +1 -1
- package/dist-renderer/assets/{sequenceDiagram-WL72ISMW-BM-wggUb.js → sequenceDiagram-WL72ISMW-BnhkN7nZ.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-FKZM4ZOC-BqmcVjnj.js → stateDiagram-FKZM4ZOC-Bn8XdYX-.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-v2-4FDKWEC3-By3JDVbB.js → stateDiagram-v2-4FDKWEC3-1b6sI1_g.js} +1 -1
- package/dist-renderer/assets/{timeline-definition-IT6M3QCI-szH0GUyk.js → timeline-definition-IT6M3QCI-CNs3RPoa.js} +1 -1
- package/dist-renderer/assets/treemap-GDKQZRPO-DU_yr827.js +162 -0
- package/dist-renderer/assets/{xychartDiagram-PRI3JC2R-dwDpvw0w.js → xychartDiagram-PRI3JC2R-B8o5J2f3.js} +1 -1
- package/dist-renderer/index.html +2 -2
- package/package.json +1 -1
- package/src/main/server.ts +800 -163
- package/src/main/services/session-intelligence/SessionUsageParser.ts +446 -0
- package/src/main/services/session-intelligence/UsageTelemetryService.ts +252 -0
- package/src/main/services/teams-mvp/CollaborationBoardService.ts +310 -0
- package/src/main/services/teams-mvp/TaskDispatchService.ts +880 -95
- package/src/main/services/teams-mvp/TeamProvisioningService.ts +58 -19
- package/src/main/services/teams-mvp/TeamWorkspaceService.ts +25 -2
- package/src/main/services/teams-mvp/index.ts +3 -0
- package/src/renderer/App.tsx +5 -0
- package/src/renderer/api/httpClient.ts +67 -0
- package/src/renderer/components/dashboard/DashboardView.tsx +6 -105
- package/src/renderer/components/layout/PaneContent.tsx +2 -0
- package/src/renderer/components/layout/SortableTab.tsx +1 -0
- package/src/renderer/components/layout/TabBarActions.tsx +12 -12
- package/src/renderer/components/schedules/SchedulesView.tsx +54 -22
- package/src/renderer/components/settings/SettingsTabs.tsx +2 -2
- package/src/renderer/components/settings/sections/AdvancedSection.tsx +1 -1
- package/src/renderer/components/settings/sections/TaskBusSection.tsx +511 -81
- package/src/renderer/components/tasks/TasksView.tsx +343 -0
- package/src/renderer/components/team/TeamDetailView.tsx +20 -98
- package/src/renderer/components/team/dialogs/LaunchTeamDialog.tsx +1 -1
- package/src/renderer/components/team/editor/EditorContextMenu.tsx +8 -23
- package/src/renderer/components/team/editor/EditorFileTree.tsx +0 -4
- package/src/renderer/components/team/editor/EditorSelectionMenu.tsx +1 -8
- package/src/renderer/components/team/editor/ProjectEditorOverlay.tsx +0 -10
- package/src/renderer/components/team/kanban/KanbanBoard.tsx +5 -1
- package/src/renderer/components/team/members/MemberDetailDialog.tsx +8 -33
- package/src/renderer/components/team/messages/MessageComposer.tsx +39 -3
- package/src/renderer/components/team/messages/MessagesPanel.tsx +72 -2
- package/src/renderer/components/team/messages/StatusBlock.tsx +2 -24
- package/src/renderer/components/team/schedule/ScheduleEmptyState.tsx +1 -1
- package/src/renderer/components/ui/MentionableTextarea.tsx +0 -1
- package/src/renderer/store/slices/scheduleSlice.ts +21 -0
- package/src/renderer/store/slices/teamSlice.ts +59 -23
- package/src/renderer/types/tabs.ts +1 -0
- package/src/shared/types/api.ts +29 -0
- package/src/shared/types/team.ts +109 -1
- package/dist-renderer/assets/ProjectEditorOverlay-BBwYdXPv.js +0 -57
- package/dist-renderer/assets/channel-DJUrwVrK.js +0 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-blc3DrH7.js +0 -1
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-blc3DrH7.js +0 -1
- package/dist-renderer/assets/clone-BftjWakJ.js +0 -1
- package/dist-renderer/assets/index-CWpFqEvz.css +0 -1
- package/dist-renderer/assets/treemap-GDKQZRPO-BCMlh-Ex.js +0 -162
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import{e6 as Op,e7 as xp,bj as Rf,dS as Dp,bn as Mp,bk as ze,aV as Fp,aW as jl,dI as Gp,dL as vf,dM as Ef,dJ as Up,dX as zl,aY as Jn,aZ as oe,bl as jp,bf as zp,ba as Rt,e8 as Bp,e9 as Pn}from"./index-BowUl0Jb.js";import{k as wr,j as fl,g as Wr,S as qp,w as Wp,x as Vp,c as Af,v as Oe,y as Sf,l as Kp,z as Hp,A as Yp,B as Xp,C as Jp,a as kf,d as j,i as nn,r as Qe,f as pt,D as Fe}from"./_baseUniq-DwPTU9lP.js";import{j as hl,m as D,d as Qp,f as vt,g as br,h as B,i as pl,l as qn,e as Zp}from"./_basePickBy-CgG_tjgX.js";import{c as qe}from"./clone-Dm-k63Yr.js";var em=Object.prototype,tm=em.hasOwnProperty,ht=Op(function(t,e){if(xp(e)||Rf(e)){Dp(e,wr(e),t);return}for(var n in e)tm.call(e,n)&&Mp(t,n,e[n])});function Cf(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function qi(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}function nm(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function rm(t,e,n,r){return fl(t,function(i,s,a){e(r,i,n(i),a)}),r}function im(t,e){return function(n,r){var i=ze(n)?nm:rm,s=e?e():{};return i(n,t,Wr(r),s)}}var sm=200;function am(t,e,n,r){var i=-1,s=Wp,a=!0,o=t.length,c=[],l=e.length;if(!o)return c;e.length>=sm&&(s=Vp,a=!1,e=new qp(e));e:for(;++i<o;){var d=t[i],h=d;if(d=d!==0?d:0,a&&h===h){for(var p=l;p--;)if(e[p]===h)continue e;c.push(d)}else s(e,h,r)||c.push(d)}return c}var Aa=Fp(function(t,e){return jl(t)?am(t,Af(e,1,jl,!0)):[]});function Ge(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:hl(e),Cf(t,e<0?0:e,r)):[]}function bi(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:hl(e),e=r-e,Cf(t,0,e<0?0:e)):[]}function om(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function cm(t,e){var n=!0;return fl(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function _t(t,e,n){var r=ze(t)?om:cm;return r(t,Wr(e))}function $t(t){return t&&t.length?t[0]:void 0}function ft(t,e){return Af(D(t,e))}var lm=Object.prototype,um=lm.hasOwnProperty,dm=im(function(t,e,n){um.call(t,n)?t[n].push(e):Gp(t,n,[e])}),fm="[object String]";function it(t){return typeof t=="string"||!ze(t)&&vf(t)&&Ef(t)==fm}var hm=Math.max;function tt(t,e,n,r){t=Rf(t)?t:Oe(t),n=n?hl(n):0;var i=t.length;return n<0&&(n=hm(i+n,0)),it(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Sf(t,e,n)>-1}function Bl(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return Sf(t,e,i)}var pm="[object RegExp]";function mm(t){return vf(t)&&Ef(t)==pm}var ql=zl&&zl.isRegExp,rn=ql?Up(ql):mm,gm="Expected a function";function ym(t){if(typeof t!="function")throw new TypeError(gm);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Pt(t,e){if(t==null)return{};var n=Kp(Hp(t),function(r){return[r]});return e=Wr(e),Qp(t,n,function(r,i){return e(r,i[0])})}function Sa(t,e){var n=ze(t)?Yp:Xp;return n(t,ym(Wr(e)))}function Tm(t,e){var n;return fl(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function Nf(t,e,n){var r=ze(t)?Jp:Tm;return r(t,Wr(e))}function ml(t){return t&&t.length?kf(t):[]}function Rm(t,e){return t&&t.length?kf(t,Wr(e)):[]}function Ke(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function wt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function hn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function vm(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function oi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class wf{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const n=this.types[e.container.$type];if(!n)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=n.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const n=this.types[e];return n||{name:e,properties:{},superTypes:[]}}isInstance(e,n){return Ke(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,n)):!1;return r[n]=a,a}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function _i(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function bf(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function _f(t){return _i(t)&&typeof t.fullText=="string"}class Ue{constructor(e,n){this.startFn=e,this.nextFn=n}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 n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Ue(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return ut})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Em(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Ue(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?ut:{done:!1,value:e(i)}})}filter(e){return new Ue(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return ut})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Ue(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ws(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return ut})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Ue(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ws(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return ut})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Ue(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Ue(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?ut:this.nextFn(n.state)))}distinct(e){return new Ue(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return ut})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Em(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ws(t){return!!t&&typeof t[Symbol.iterator]=="function"}const If=new Ue(()=>{},()=>ut),ut=Object.freeze({done:!0,value:void 0});function fe(...t){if(t.length===1){const e=t[0];if(e instanceof Ue)return e;if(Ws(e))return new Ue(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Ue(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:ut)}return t.length>1?new Ue(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;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 n=t[e.collIndex++];Ws(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return ut}):If}class gl extends Ue{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return ut})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var vo;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(vo||(vo={}));function Eo(t,e={}){for(const[n,r]of Object.entries(t))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,s)=>{Ke(i)&&(i.$container=t,i.$containerProperty=n,i.$containerIndex=s,e.deep&&Eo(i,e))}):Ke(r)&&(r.$container=t,r.$containerProperty=n,e.deep&&Eo(r,e)))}function ka(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Qt(t){const n=Is(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Is(t){for(;t.$container;)t=t.$container;return t}function Wl(t){return wt(t)?t.ref?[t.ref]:[]:hn(t)?t.items.map(e=>e.ref):[]}function yl(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Ue(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(Ke(s)){if(r.keyIndex++,Vl(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(Ke(o)&&Vl(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return ut})}function Wi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gl(t,n=>yl(n,e))}function Zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gl(t,n=>yl(n,e),{includeRoot:!0})}function Vl(t,e){if(!e)return!0;const n=t.$cstNode?.range;return n?qm(n,e):!1}function Vs(t){return new Ue(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(wt(r)||hn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(wt(s)||hn(r))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return ut})}function Am(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=$f(i.defaultValue))}function $f(t){return Array.isArray(t)?[...t.map($f)]:t}const lt={$type:"AbstractElement",cardinality:"cardinality"};function Sm(t){return Z.isInstance(t,lt.$type)}const $s={$type:"AbstractParserRule"};function Vi(t){return Z.isInstance(t,$s.$type)}const Ts={$type:"AbstractRule"},Ct={$type:"AbstractType"},xn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ca(t){return Z.isInstance(t,xn.$type)}const Ps={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Pf(t){return Z.isInstance(t,Ps.$type)}const Kl={$type:"ArrayLiteral",elements:"elements"},Hl={$type:"ArrayType",elementType:"elementType"},Dn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Wn(t){return Z.isInstance(t,Dn.$type)}const Ao={$type:"BooleanLiteral",true:"true"};function km(t){return Z.isInstance(t,Ao.$type)}const Mn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Cm(t){return Z.isInstance(t,Mn.$type)}const ir={$type:"Condition"},Ls={$type:"Conjunction",left:"left",right:"right"};function Nm(t){return Z.isInstance(t,Ls.$type)}const Fn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Na(t){return Z.isInstance(t,Fn.$type)}const Os={$type:"Disjunction",left:"left",right:"right"};function wm(t){return Z.isInstance(t,Os.$type)}const So={$type:"EndOfFile",cardinality:"cardinality"};function bm(t){return Z.isInstance(t,So.$type)}const Ln={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Yl={$type:"GrammarImport",path:"path"},ur={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Tl(t){return Z.isInstance(t,ur.$type)}const ko={$type:"InferredType",name:"name"};function Lf(t){return Z.isInstance(t,ko.$type)}const Vt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ks(t){return Z.isInstance(t,Vt.$type)}const Qa={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Xl={$type:"InfixRuleOperators",precedences:"precedences"},gi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function _m(t){return Z.isInstance(t,gi.$type)}const yi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Vn(t){return Z.isInstance(t,yi.$type)}const Rs={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},dr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Im(t){return Z.isInstance(t,dr.$type)}const Co={$type:"Negation",value:"value"};function $m(t){return Z.isInstance(t,Co.$type)}const Jl={$type:"NumberLiteral",value:"value"},vs={$type:"Parameter",name:"name"},No={$type:"ParameterReference",parameter:"parameter"};function Pm(t){return Z.isInstance(t,No.$type)}const Dt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function on(t){return Z.isInstance(t,Dt.$type)}const Za={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},fr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Lm(t){return Z.isInstance(t,fr.$type)}const wo={$type:"ReturnType",name:"name"};function Om(t){return Z.isInstance(t,wo.$type)}const hr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Kn(t){return Z.isInstance(t,hr.$type)}const Ti={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function xm(t){return Z.isInstance(t,Ti.$type)}const Ql={$type:"StringLiteral",value:"value"},pr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Dm(t){return Z.isInstance(t,pr.$type)}const yt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},mr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Mm(t){return Z.isInstance(t,mr.$type)}const fn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function cn(t){return Z.isInstance(t,fn.$type)}const gr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Fm(t){return Z.isInstance(t,gr.$type)}const xs={$type:"Type",name:"name",type:"type"};function Gm(t){return Z.isInstance(t,xs.$type)}const ci={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},li={$type:"TypeDefinition"},Zl={$type:"UnionType",types:"types"},Ds={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Of(t){return Z.isInstance(t,Ds.$type)}const yr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Um(t){return Z.isInstance(t,yr.$type)}const ui={$type:"ValueLiteral"},Ri={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jm(t){return Z.isInstance(t,Ri.$type)}class xf extends wf{constructor(){super(...arguments),this.types={AbstractElement:{name:lt.$type,properties:{cardinality:{name:lt.cardinality}},superTypes:[]},AbstractParserRule:{name:$s.$type,properties:{},superTypes:[Ts.$type,Ct.$type]},AbstractRule:{name:Ts.$type,properties:{},superTypes:[]},AbstractType:{name:Ct.$type,properties:{},superTypes:[]},Action:{name:xn.$type,properties:{cardinality:{name:xn.cardinality},feature:{name:xn.feature},inferredType:{name:xn.inferredType},operator:{name:xn.operator},type:{name:xn.type,referenceType:Ct.$type}},superTypes:[lt.$type]},Alternatives:{name:Ps.$type,properties:{cardinality:{name:Ps.cardinality},elements:{name:Ps.elements,defaultValue:[]}},superTypes:[lt.$type]},ArrayLiteral:{name:Kl.$type,properties:{elements:{name:Kl.elements,defaultValue:[]}},superTypes:[ui.$type]},ArrayType:{name:Hl.$type,properties:{elementType:{name:Hl.elementType}},superTypes:[li.$type]},Assignment:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},feature:{name:Dn.feature},operator:{name:Dn.operator},predicate:{name:Dn.predicate},terminal:{name:Dn.terminal}},superTypes:[lt.$type]},BooleanLiteral:{name:Ao.$type,properties:{true:{name:Ao.true,defaultValue:!1}},superTypes:[ir.$type,ui.$type]},CharacterRange:{name:Mn.$type,properties:{cardinality:{name:Mn.cardinality},left:{name:Mn.left},lookahead:{name:Mn.lookahead},parenthesized:{name:Mn.parenthesized,defaultValue:!1},right:{name:Mn.right}},superTypes:[yt.$type]},Condition:{name:ir.$type,properties:{},superTypes:[]},Conjunction:{name:Ls.$type,properties:{left:{name:Ls.left},right:{name:Ls.right}},superTypes:[ir.$type]},CrossReference:{name:Fn.$type,properties:{cardinality:{name:Fn.cardinality},deprecatedSyntax:{name:Fn.deprecatedSyntax,defaultValue:!1},isMulti:{name:Fn.isMulti,defaultValue:!1},terminal:{name:Fn.terminal},type:{name:Fn.type,referenceType:Ct.$type}},superTypes:[lt.$type]},Disjunction:{name:Os.$type,properties:{left:{name:Os.left},right:{name:Os.right}},superTypes:[ir.$type]},EndOfFile:{name:So.$type,properties:{cardinality:{name:So.cardinality}},superTypes:[lt.$type]},Grammar:{name:Ln.$type,properties:{imports:{name:Ln.imports,defaultValue:[]},interfaces:{name:Ln.interfaces,defaultValue:[]},isDeclared:{name:Ln.isDeclared,defaultValue:!1},name:{name:Ln.name},rules:{name:Ln.rules,defaultValue:[]},types:{name:Ln.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Yl.$type,properties:{path:{name:Yl.path}},superTypes:[]},Group:{name:ur.$type,properties:{cardinality:{name:ur.cardinality},elements:{name:ur.elements,defaultValue:[]},guardCondition:{name:ur.guardCondition},predicate:{name:ur.predicate}},superTypes:[lt.$type]},InferredType:{name:ko.$type,properties:{name:{name:ko.name}},superTypes:[Ct.$type]},InfixRule:{name:Vt.$type,properties:{call:{name:Vt.call},dataType:{name:Vt.dataType},inferredType:{name:Vt.inferredType},name:{name:Vt.name},operators:{name:Vt.operators},parameters:{name:Vt.parameters,defaultValue:[]},returnType:{name:Vt.returnType,referenceType:Ct.$type}},superTypes:[$s.$type]},InfixRuleOperatorList:{name:Qa.$type,properties:{associativity:{name:Qa.associativity},operators:{name:Qa.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Xl.$type,properties:{precedences:{name:Xl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:gi.$type,properties:{attributes:{name:gi.attributes,defaultValue:[]},name:{name:gi.name},superTypes:{name:gi.superTypes,defaultValue:[],referenceType:Ct.$type}},superTypes:[Ct.$type]},Keyword:{name:yi.$type,properties:{cardinality:{name:yi.cardinality},predicate:{name:yi.predicate},value:{name:yi.value}},superTypes:[lt.$type]},NamedArgument:{name:Rs.$type,properties:{calledByName:{name:Rs.calledByName,defaultValue:!1},parameter:{name:Rs.parameter,referenceType:vs.$type},value:{name:Rs.value}},superTypes:[]},NegatedToken:{name:dr.$type,properties:{cardinality:{name:dr.cardinality},lookahead:{name:dr.lookahead},parenthesized:{name:dr.parenthesized,defaultValue:!1},terminal:{name:dr.terminal}},superTypes:[yt.$type]},Negation:{name:Co.$type,properties:{value:{name:Co.value}},superTypes:[ir.$type]},NumberLiteral:{name:Jl.$type,properties:{value:{name:Jl.value}},superTypes:[ui.$type]},Parameter:{name:vs.$type,properties:{name:{name:vs.name}},superTypes:[]},ParameterReference:{name:No.$type,properties:{parameter:{name:No.parameter,referenceType:vs.$type}},superTypes:[ir.$type]},ParserRule:{name:Dt.$type,properties:{dataType:{name:Dt.dataType},definition:{name:Dt.definition},entry:{name:Dt.entry,defaultValue:!1},fragment:{name:Dt.fragment,defaultValue:!1},inferredType:{name:Dt.inferredType},name:{name:Dt.name},parameters:{name:Dt.parameters,defaultValue:[]},returnType:{name:Dt.returnType,referenceType:Ct.$type}},superTypes:[$s.$type]},ReferenceType:{name:Za.$type,properties:{isMulti:{name:Za.isMulti,defaultValue:!1},referenceType:{name:Za.referenceType}},superTypes:[li.$type]},RegexToken:{name:fr.$type,properties:{cardinality:{name:fr.cardinality},lookahead:{name:fr.lookahead},parenthesized:{name:fr.parenthesized,defaultValue:!1},regex:{name:fr.regex}},superTypes:[yt.$type]},ReturnType:{name:wo.$type,properties:{name:{name:wo.name}},superTypes:[]},RuleCall:{name:hr.$type,properties:{arguments:{name:hr.arguments,defaultValue:[]},cardinality:{name:hr.cardinality},predicate:{name:hr.predicate},rule:{name:hr.rule,referenceType:Ts.$type}},superTypes:[lt.$type]},SimpleType:{name:Ti.$type,properties:{primitiveType:{name:Ti.primitiveType},stringType:{name:Ti.stringType},typeRef:{name:Ti.typeRef,referenceType:Ct.$type}},superTypes:[li.$type]},StringLiteral:{name:Ql.$type,properties:{value:{name:Ql.value}},superTypes:[ui.$type]},TerminalAlternatives:{name:pr.$type,properties:{cardinality:{name:pr.cardinality},elements:{name:pr.elements,defaultValue:[]},lookahead:{name:pr.lookahead},parenthesized:{name:pr.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalElement:{name:yt.$type,properties:{cardinality:{name:yt.cardinality},lookahead:{name:yt.lookahead},parenthesized:{name:yt.parenthesized,defaultValue:!1}},superTypes:[lt.$type]},TerminalGroup:{name:mr.$type,properties:{cardinality:{name:mr.cardinality},elements:{name:mr.elements,defaultValue:[]},lookahead:{name:mr.lookahead},parenthesized:{name:mr.parenthesized,defaultValue:!1}},superTypes:[yt.$type]},TerminalRule:{name:fn.$type,properties:{definition:{name:fn.definition},fragment:{name:fn.fragment,defaultValue:!1},hidden:{name:fn.hidden,defaultValue:!1},name:{name:fn.name},type:{name:fn.type}},superTypes:[Ts.$type]},TerminalRuleCall:{name:gr.$type,properties:{cardinality:{name:gr.cardinality},lookahead:{name:gr.lookahead},parenthesized:{name:gr.parenthesized,defaultValue:!1},rule:{name:gr.rule,referenceType:fn.$type}},superTypes:[yt.$type]},Type:{name:xs.$type,properties:{name:{name:xs.name},type:{name:xs.type}},superTypes:[Ct.$type]},TypeAttribute:{name:ci.$type,properties:{defaultValue:{name:ci.defaultValue},isOptional:{name:ci.isOptional,defaultValue:!1},name:{name:ci.name},type:{name:ci.type}},superTypes:[]},TypeDefinition:{name:li.$type,properties:{},superTypes:[]},UnionType:{name:Zl.$type,properties:{types:{name:Zl.types,defaultValue:[]}},superTypes:[li.$type]},UnorderedGroup:{name:Ds.$type,properties:{cardinality:{name:Ds.cardinality},elements:{name:Ds.elements,defaultValue:[]}},superTypes:[lt.$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:[yt.$type]},ValueLiteral:{name:ui.$type,properties:{},superTypes:[]},Wildcard:{name:Ri.$type,properties:{cardinality:{name:Ri.cardinality},lookahead:{name:Ri.lookahead},parenthesized:{name:Ri.parenthesized,defaultValue:!1}},superTypes:[yt.$type]}}}}const Z=new xf;function bo(t){return new gl(t,e=>_i(e)?e.content:[],{includeRoot:!0})}function zm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function _o(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Hs(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Xt;(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"})(Xt||(Xt={}));function Bm(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Xt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Xt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?Xt.Inside:n?Xt.OverlapBack:r?Xt.OverlapFront:Xt.Outside}function qm(t,e){return Bm(t,e)>Xt.After}const Wm=/^[\w\p{L}]$/u;function Vm(t,e){if(t){const n=Km(t,!0);if(n&&eu(n,e))return n;if(_f(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(eu(s,e))return s}}}}function eu(t,e){return bf(t)&&e.includes(t.tokenType.name)}function Km(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class Df extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Ki(t,e="Error: Got unexpected value."){throw new Error(e)}function W(t){return t.charCodeAt(0)}function eo(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function di(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function sr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Hm(){throw Error("Internal Error - Should never get here!")}function tu(t){return t.type==="Character"}const Ys=[];for(let t=W("0");t<=W("9");t++)Ys.push(t);const Xs=[W("_")].concat(Ys);for(let t=W("a");t<=W("z");t++)Xs.push(t);for(let t=W("A");t<=W("Z");t++)Xs.push(t);const nu=[W(" "),W("\f"),W(`
|
|
2
|
+
`),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Ym=/[0-9a-fA-F]/,Es=/[0-9]/,Xm=/[1-9]/;class Mf{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 n=this.disjunction();this.consumeChar("/");const r={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":di(r,"global");break;case"i":di(r,"ignoreCase");break;case"m":di(r,"multiLine");break;case"u":di(r,"unicode");break;case"y":di(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}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 n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}sr(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return Hm()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;sr(n);break}if(!(e===!0&&n===void 0)&&sr(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=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()),sr(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
|
|
3
|
+
`),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Ys;break;case"D":e=Ys,n=!0;break;case"s":e=nu;break;case"S":e=nu,n=!0;break;case"w":e=Xs;break;case"W":e=Xs,n=!0;break}if(sr(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
|
|
4
|
+
`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(sr(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:W(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,tu(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,tu(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else eo(r.value,e),e.push(W("-")),eo(i.value,e)}else eo(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:W("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(Xm.test(e)===!1)throw Error("Expecting a positive integer");for(;Es.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Es.test(e)===!1)throw Error("Expecting an integer");for(;Es.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:W(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Es.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 n="";for(let i=0;i<e;i++){const s=this.popChar();if(Ym.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,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 wa{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.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 Jm=/\r?\n/gm,Qm=new Mf;class Zm extends wa{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 n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=ba(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
11
|
+
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const to=new Zm;function eg(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),to.reset(t),to.visit(Qm.pattern(t)),to.multiline}catch{return!1}}const tg=`\f
|
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function Ff(t){const e=typeof t=="string"?new RegExp(t):t;return tg.some(n=>e.test(n))}function ba(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ng(t,e){const n=rg(t),r=e.match(n);return!!r&&r[0].length>0}function rg(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(l){s+=n.substr(r,l),r+=l}function c(l){s+="(?:"+n.substr(r,l)+"|$)",r+=l}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],c(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function ig(t){return t.rules.find(e=>on(e)&&e.entry)}function sg(t){return t.rules.filter(e=>cn(e)&&e.hidden)}function Gf(t,e){const n=new Set,r=ig(t);if(!r)return new Set(t.rules);const i=[r].concat(sg(t));for(const a of i)Uf(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||cn(a)&&a.hidden)&&s.add(a);return s}function Uf(t,e,n){e.add(t.name),Wi(t).forEach(r=>{if(Kn(r)||n){const i=r.rule.ref;i&&!e.has(i.name)&&Uf(i,e,n)}})}function ag(t){if(t.terminal)return t.terminal;if(t.type.ref)return zf(t.type.ref)?.terminal}function og(t){return t.hidden&&!Ff(vl(t))}function cg(t,e){return!t||!e?[]:Rl(t,e,t.astNode,!0)}function jf(t,e,n){if(!t||!e)return;const r=Rl(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Rl(t,e,n,r){if(!r){const i=ka(t.grammarSource,Wn);if(i&&i.feature===e)return[t]}return _i(t)&&t.astNode===n?t.content.flatMap(i=>Rl(i,e,n,!1)):[]}function lg(t,e,n){if(!t)return;const r=ug(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function ug(t,e,n){if(t.astNode!==n)return[];if(Vn(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=bo(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?Vn(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function dg(t){const e=t.astNode;for(;e===t.container?.astNode;){const n=ka(t.grammarSource,Wn);if(n)return n;t=t.container}}function zf(t){let e=t;return Lf(e)&&(Ca(e.$container)?e=e.$container.$container:Vi(e.$container)?e=e.$container:Ki(e.$container)),Bf(t,e,new Map)}function Bf(t,e,n){function r(i,s){let a;return ka(i,Wn)||(a=Bf(s,s,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const i of Wi(e)){if(Wn(i)&&i.feature.toLowerCase()==="name")return n.set(t,i),i;if(Kn(i)&&on(i.rule.ref))return r(i,i.rule.ref);if(xm(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}}function qf(t){return Wf(t,new Set)}function Wf(t,e){if(e.has(t))return!0;e.add(t);for(const n of Wi(t))if(Kn(n)){if(!n.rule.ref||on(n.rule.ref)&&!Wf(n.rule.ref,e)||Ks(n.rule.ref))return!1}else{if(Wn(n))return!1;if(Ca(n))return!1}return!!t.definition}function Vf(t){if(!cn(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(Vi(t))return on(t)&&qf(t)?t.name:Vf(t)??t.name;if(_m(t)||Gm(t)||Om(t))return t.name;if(Ca(t)){const e=fg(t);if(e)return e}else if(Lf(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function fg(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return Ii(t.type.ref)}function hg(t){return cn(t)?t.type?.name??"string":Vf(t)??t.name}function vl(t){const e={s:!1,i:!1,u:!1},n=Vr(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const El=/[\s\S]/.source;function Vr(t,e){if(Dm(t))return pg(t);if(Mm(t))return mg(t);if(Cm(t))return Tg(t);if(Fm(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return en(Vr(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Im(t))return yg(t);if(Um(t))return gg(t);if(Lm(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),en(r,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(jm(t))return en(El,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function pg(t){return en(t.elements.map(e=>Vr(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function mg(t){return en(t.elements.map(e=>Vr(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function gg(t){return en(`${El}*?${Vr(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function yg(t){return en(`(?!${Vr(t.terminal)})${El}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Tg(t){return t.right?en(`[${no(t.left)}-${no(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):en(no(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function no(t){return ba(t.value)}function en(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Rg(t){const e=[],n=t.Grammar;for(const r of n.rules)cn(r)&&og(r)&&eg(vl(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Wm}}function Io(t){console&&console.error&&console.error(`Error: ${t}`)}function Kf(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Hf(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function Yf(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function vg(t){return Eg(t)?t.LABEL:t.name}function Eg(t){return it(t.LABEL)&&t.LABEL!==""}class Bt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),j(this.definition,n=>{n.accept(e)})}}class Ze extends Bt{constructor(e){super([]),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Kr extends Bt{constructor(e){super(e.definition),this.orgText="",ht(this,Pt(e,n=>n!==void 0))}}class st extends Bt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ht(this,Pt(e,n=>n!==void 0))}}let Be=class extends Bt{constructor(e){super(e.definition),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}};class mt extends Bt{constructor(e){super(e.definition),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}}class gt extends Bt{constructor(e){super(e.definition),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}}class Ee extends Bt{constructor(e){super(e.definition),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}}class at extends Bt{constructor(e){super(e.definition),this.idx=1,ht(this,Pt(e,n=>n!==void 0))}}class ot extends Bt{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,ht(this,Pt(e,n=>n!==void 0))}}class le{constructor(e){this.idx=1,ht(this,Pt(e,n=>n!==void 0))}accept(e){e.visit(this)}}function Ag(t){return D(t,Ms)}function Ms(t){function e(n){return D(n,Ms)}if(t instanceof Ze){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return it(t.label)&&(n.label=t.label),n}else{if(t instanceof st)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Be)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof mt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof gt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Ms(new le({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof at)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Ms(new le({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ee)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ot)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof le){const n={type:"Terminal",name:t.terminalType.name,label:vg(t.terminalType),idx:t.idx};it(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=rn(r)?r.source:r),n}else{if(t instanceof Kr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Hr{visit(e){const n=e;switch(n.constructor){case Ze:return this.visitNonTerminal(n);case st:return this.visitAlternative(n);case Be:return this.visitOption(n);case mt:return this.visitRepetitionMandatory(n);case gt:return this.visitRepetitionMandatoryWithSeparator(n);case at:return this.visitRepetitionWithSeparator(n);case Ee:return this.visitRepetition(n);case ot:return this.visitAlternation(n);case le:return this.visitTerminal(n);case Kr:return this.visitRule(n);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 Sg(t){return t instanceof st||t instanceof Be||t instanceof Ee||t instanceof mt||t instanceof gt||t instanceof at||t instanceof le||t instanceof Kr}function Js(t,e=[]){return t instanceof Be||t instanceof Ee||t instanceof at?!0:t instanceof ot?Nf(t.definition,r=>Js(r,e)):t instanceof Ze&&tt(e,t)?!1:t instanceof Bt?(t instanceof Ze&&e.push(t),_t(t.definition,r=>Js(r,e))):!1}function kg(t){return t instanceof ot}function Mt(t){if(t instanceof Ze)return"SUBRULE";if(t instanceof Be)return"OPTION";if(t instanceof ot)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof at)return"MANY_SEP";if(t instanceof Ee)return"MANY";if(t instanceof le)return"CONSUME";throw Error("non exhaustive match")}class _a{walk(e,n=[]){j(e.definition,(r,i)=>{const s=Ge(e.definition,i+1);if(r instanceof Ze)this.walkProdRef(r,s,n);else if(r instanceof le)this.walkTerminal(r,s,n);else if(r instanceof st)this.walkFlat(r,s,n);else if(r instanceof Be)this.walkOption(r,s,n);else if(r instanceof mt)this.walkAtLeastOne(r,s,n);else if(r instanceof gt)this.walkAtLeastOneSep(r,s,n);else if(r instanceof at)this.walkManySep(r,s,n);else if(r instanceof Ee)this.walkMany(r,s,n);else if(r instanceof ot)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Be({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=ru(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Be({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=ru(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);j(e.definition,s=>{const a=new st({definition:[s]});this.walk(a,i)})}}function ru(t,e,n){return[new Be({definition:[new le({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Hi(t){if(t instanceof Ze)return Hi(t.referencedRule);if(t instanceof le)return wg(t);if(Sg(t))return Cg(t);if(kg(t))return Ng(t);throw Error("non exhaustive match")}function Cg(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=Js(s),e=e.concat(Hi(s)),r=r+1,i=n.length>r;return ml(e)}function Ng(t){const e=D(t.definition,n=>Hi(n));return ml(vt(e))}function wg(t){return[t.terminalType]}const Xf="_~IN~_";class bg extends _a{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=Ig(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new st({definition:s}),o=Hi(a);this.follows[i]=o}}function _g(t){const e={};return j(t,n=>{const r=new bg(n).startWalking();ht(e,r)}),e}function Ig(t,e){return t.name+e+Xf}let Fs={};const $g=new Mf;function Ia(t){const e=t.toString();if(Fs.hasOwnProperty(e))return Fs[e];{const n=$g.pattern(e);return Fs[e]=n,n}}function Pg(){Fs={}}const Jf="Complement Sets are not supported for first char optimization",Qs=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function Lg(t,e=!1){try{const n=Ia(t);return $o(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===Jf)e&&Kf(`${Qs} 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 r="";e&&(r=`
|
|
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.`),Io(`${Qs}
|
|
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`+r)}}return[]}function $o(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)$o(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":As(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(Jf);j(a.value,c=>{if(typeof c=="number")As(c,e,n);else{const l=c;if(n===!0)for(let d=l.from;d<=l.to;d++)As(d,e,n);else{for(let d=l.from;d<=l.to&&d<Ei;d++)As(d,e,n);if(l.to>=Ei){const d=l.from>=Ei?l.from:Ei,h=l.to,p=En(d),R=En(h);for(let k=p;k<=R;k++)e[k]=k}}}});break;case"Group":$o(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Po(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Oe(e)}function As(t,e,n){const r=En(t);e[r]=r,n===!0&&Og(t,e)}function Og(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=En(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=En(i.charCodeAt(0));e[s]=s}}}function iu(t,e){return br(t.value,n=>{if(typeof n=="number")return tt(e,n);{const r=n;return br(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Po(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ze(t.value)?_t(t.value,Po):Po(t.value):!1}class xg extends wa{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){tt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?iu(e,this.targetCharCodes)===void 0&&(this.found=!0):iu(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Al(t,e){if(e instanceof RegExp){const n=Ia(e),r=new xg(t);return r.visit(n),r.found}else return br(e,n=>tt(t,n.charCodeAt(0)))!==void 0}const Hn="PATTERN",vi="defaultMode",Ss="modes";function Dg(t,e){e=pl(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(L,w)=>w()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{ay()});let r;n("Reject Lexer.NA",()=>{r=Sa(t,L=>L[Hn]===rt.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=D(r,L=>{const w=L[Hn];if(rn(w)){const O=w.source;return O.length===1&&O!=="^"&&O!=="$"&&O!=="."&&!w.ignoreCase?O:O.length===2&&O[0]==="\\"&&!tt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],O[1])?O[1]:su(w)}else{if(Jn(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{const O=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),J=new RegExp(O);return su(J)}}else throw Error("non exhaustive match")}})});let a,o,c,l,d;n("misc mapping",()=>{a=D(r,L=>L.tokenTypeIdx),o=D(r,L=>{const w=L.GROUP;if(w!==rt.SKIPPED){if(it(w))return w;if(nn(w))return!1;throw Error("non exhaustive match")}}),c=D(r,L=>{const w=L.LONGER_ALT;if(w)return ze(w)?D(w,J=>Bl(r,J)):[Bl(r,w)]}),l=D(r,L=>L.PUSH_MODE),d=D(r,L=>B(L,"POP_MODE"))});let h;n("Line Terminator Handling",()=>{const L=eh(e.lineTerminatorCharacters);h=D(r,w=>!1),e.positionTracking!=="onlyOffset"&&(h=D(r,w=>B(w,"LINE_BREAKS")?!!w.LINE_BREAKS:Zf(w,L)===!1&&Al(L,w.PATTERN)))});let p,R,k,_;n("Misc Mapping #2",()=>{p=D(r,Qf),R=D(s,ry),k=Qe(r,(L,w)=>{const O=w.GROUP;return it(O)&&O!==rt.SKIPPED&&(L[O]=[]),L},{}),_=D(s,(L,w)=>({pattern:s[w],longerAlt:c[w],canLineTerminator:h[w],isCustom:p[w],short:R[w],group:o[w],push:l[w],pop:d[w],tokenTypeIdx:a[w],tokenType:r[w]}))});let M=!0,N=[];return e.safeMode||n("First Char Optimization",()=>{N=Qe(r,(L,w,O)=>{if(typeof w.PATTERN=="string"){const J=w.PATTERN.charCodeAt(0),re=En(J);ro(L,re,_[O])}else if(ze(w.START_CHARS_HINT)){let J;j(w.START_CHARS_HINT,re=>{const ie=typeof re=="string"?re.charCodeAt(0):re,we=En(ie);J!==we&&(J=we,ro(L,we,_[O]))})}else if(rn(w.PATTERN))if(w.PATTERN.unicode)M=!1,e.ensureOptimizations&&Io(`${Qs} Unable to analyze < ${w.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 J=Lg(w.PATTERN,e.ensureOptimizations);oe(J)&&(M=!1),j(J,re=>{ro(L,re,_[O])})}else e.ensureOptimizations&&Io(`${Qs} TokenType: <${w.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`),M=!1;return L},[])}),{emptyGroups:k,patternIdxToConfig:_,charCodeToPatternIdxToConfig:N,hasCustom:i,canBeOptimized:M}}function Mg(t,e){let n=[];const r=Gg(t);n=n.concat(r.errors);const i=Ug(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(Fg(s)),n=n.concat(Hg(s)),n=n.concat(Yg(s,e)),n=n.concat(Xg(s)),n}function Fg(t){let e=[];const n=pt(t,r=>rn(r[Hn]));return e=e.concat(zg(n)),e=e.concat(Wg(n)),e=e.concat(Vg(n)),e=e.concat(Kg(n)),e=e.concat(Bg(n)),e}function Gg(t){const e=pt(t,i=>!B(i,Hn)),n=D(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ae.MISSING_PATTERN,tokenTypes:[i]})),r=Aa(t,e);return{errors:n,valid:r}}function Ug(t){const e=pt(t,i=>{const s=i[Hn];return!rn(s)&&!Jn(s)&&!B(s,"exec")&&!it(s)}),n=D(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ae.INVALID_PATTERN,tokenTypes:[i]})),r=Aa(t,e);return{errors:n,valid:r}}const jg=/[^\\][$]/;function zg(t){class e extends wa{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=pt(t,i=>{const s=i.PATTERN;try{const a=Ia(s),o=new e;return o.visit(a),o.found}catch{return jg.test(s.source)}});return D(n,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:Ae.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Bg(t){const e=pt(t,r=>r.PATTERN.test(""));return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Ae.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const qg=/[^\\[][\^]|^\^/;function Wg(t){class e extends wa{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=pt(t,i=>{const s=i.PATTERN;try{const a=Ia(s),o=new e;return o.visit(a),o.found}catch{return qg.test(s.source)}});return D(n,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:Ae.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Vg(t){const e=pt(t,r=>{const i=r[Hn];return i instanceof RegExp&&(i.multiline||i.global)});return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ae.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function Kg(t){const e=[];let n=D(t,s=>Qe(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!tt(e,o)&&o.PATTERN!==rt.NA&&(e.push(o),a.push(o)),a),[]));n=qi(n);const r=pt(n,s=>s.length>1);return D(r,s=>{const a=D(s,c=>c.name);return{message:`The same RegExp pattern ->${$t(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Ae.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function Hg(t){const e=pt(t,r=>{if(!B(r,"GROUP"))return!1;const i=r.GROUP;return i!==rt.SKIPPED&&i!==rt.NA&&!it(i)});return D(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ae.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function Yg(t,e){const n=pt(t,i=>i.PUSH_MODE!==void 0&&!tt(e,i.PUSH_MODE));return D(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ae.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function Xg(t){const e=[],n=Qe(t,(r,i,s)=>{const a=i.PATTERN;return a===rt.NA||(it(a)?r.push({str:a,idx:s,tokenType:i}):rn(a)&&Qg(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return j(t,(r,i)=>{j(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&Jg(s,r.PATTERN)){const c=`Token: ->${o.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ae.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function Jg(t,e){if(rn(e)){if(Zg(e))return!1;const n=e.exec(t);return n!==null&&n.index===0}else{if(Jn(e))return e(t,0,[],{});if(B(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function Qg(t){return br([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function Zg(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function su(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function ey(t,e,n){const r=[];return B(t,vi)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+vi+`> property in its definition
|
|
34
|
+
`,type:Ae.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),B(t,Ss)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ss+`> property in its definition
|
|
35
|
+
`,type:Ae.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),B(t,Ss)&&B(t,vi)&&!B(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${vi}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:Ae.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),B(t,Ss)&&j(t.modes,(i,s)=>{j(i,(a,o)=>{if(nn(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
|
37
|
+
`,type:Ae.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(B(a,"LONGER_ALT")){const c=ze(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];j(c,l=>{!nn(l)&&!tt(i,l)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}>
|
|
38
|
+
`,type:Ae.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function ty(t,e,n){const r=[];let i=!1;const s=qi(vt(Oe(t.modes))),a=Sa(s,c=>c[Hn]===rt.NA),o=eh(n);return e&&j(a,c=>{const l=Zf(c,o);if(l!==!1){const h={message:sy(c,l),type:l.issue,tokenType:c};r.push(h)}else B(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Al(o,c.PATTERN)&&(i=!0)}),e&&!i&&r.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:Ae.NO_LINE_BREAKS_FLAGS}),r}function ny(t){const e={},n=wr(t);return j(n,r=>{const i=t[r];if(ze(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Qf(t){const e=t.PATTERN;if(rn(e))return!1;if(Jn(e))return!0;if(B(e,"exec"))return!0;if(it(e))return!1;throw Error("non exhaustive match")}function ry(t){return it(t)&&t.length===1?t.charCodeAt(0):!1}const iy={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Zf(t,e){if(B(t,"LINE_BREAKS"))return!1;if(rn(t.PATTERN)){try{Al(e,t.PATTERN)}catch(n){return{issue:Ae.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(it(t.PATTERN))return!1;if(Qf(t))return{issue:Ae.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function sy(t,e){if(e.issue===Ae.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===Ae.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 eh(t){return D(t,n=>it(n)?n.charCodeAt(0):n)}function ro(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Ei=256;let Gs=[];function En(t){return t<Ei?t:Gs[t]}function ay(){if(oe(Gs)){Gs=new Array(65536);for(let t=0;t<65536;t++)Gs[t]=t>255?255+~~(t/255):t}}function Yi(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function Zs(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let au=1;const th={};function Xi(t){const e=oy(t);cy(e),uy(e),ly(e),j(e,n=>{n.isParent=n.categoryMatches.length>0})}function oy(t){let e=qe(t),n=t,r=!0;for(;r;){n=qi(vt(D(n,s=>s.CATEGORIES)));const i=Aa(n,e);e=e.concat(i),oe(i)?r=!1:n=i}return e}function cy(t){j(t,e=>{rh(e)||(th[au]=e,e.tokenTypeIdx=au++),ou(e)&&!ze(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ou(e)||(e.CATEGORIES=[]),dy(e)||(e.categoryMatches=[]),fy(e)||(e.categoryMatchesMap={})})}function ly(t){j(t,e=>{e.categoryMatches=[],j(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(th[r].tokenTypeIdx)})})}function uy(t){j(t,e=>{nh([],e)})}function nh(t,e){j(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),j(e.CATEGORIES,n=>{const r=t.concat(e);tt(r,n)||nh(r,n)})}function rh(t){return B(t,"tokenTypeIdx")}function ou(t){return B(t,"CATEGORIES")}function dy(t){return B(t,"categoryMatches")}function fy(t){return B(t,"categoryMatchesMap")}function hy(t){return B(t,"tokenTypeIdx")}const Lo={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Ae;(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"})(Ae||(Ae={}));const Ai={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Lo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ai);class rt{constructor(e,n=Ai){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,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:c}=Hf(s),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,c}else return s()},typeof n=="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=ht({},Ai,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ai.lineTerminatorsPattern)this.config.lineTerminatorsPattern=iy;else if(this.config.lineTerminatorCharacters===Ai.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(n.safeMode&&n.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),ze(e)?i={modes:{defaultMode:qe(e)},defaultMode:vi}:(s=!1,i=qe(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ey(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ty(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},j(i.modes,(o,c)=>{i.modes[c]=Sa(o,l=>nn(l))});const a=wr(i.modes);if(j(i.modes,(o,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Mg(o,a))}),oe(this.lexerDefinitionErrors)){Xi(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Dg(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=ht({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!oe(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=D(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+c)}j(this.lexerDefinitionWarning,o=>{Kf(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Fe),this.trackStartLines===!1&&(this.computeNewColumn=jp),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Fe),/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=Qe(this.canModeBeOptimized,(c,l,d)=>(l===!1&&c.push(d),c),[]);if(n.ensureOptimizations&&!oe(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Pg()}),this.TRACE_INIT("toFastProperties",()=>{Yf(this)})})}tokenize(e,n=this.defaultMode){if(!oe(this.lexerDefinitionErrors)){const i=D(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,c,l,d,h,p,R,k,_,M,N;const L=e,w=L.length;let O=0,J=0;const re=this.hasCustom?0:Math.floor(e.length/10),ie=new Array(re),we=[];let $e=this.trackStartLines?1:void 0,Se=this.trackStartLines?1:void 0;const C=ny(this.emptyGroups),v=this.trackStartLines,g=this.config.lineTerminatorsPattern;let S=0,m=[],y=[];const E=[],$=[];Object.freeze($);let x=!1;const P=q=>{if(E.length===1&&q.tokenType.PUSH_MODE===void 0){const te=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);we.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:te})}else{E.pop();const te=qn(E);m=this.patternIdxToConfig[te],y=this.charCodeToPatternIdxToConfig[te],S=m.length;const De=this.canModeBeOptimized[te]&&this.config.safeMode===!1;y&&De?x=!0:x=!1}};function z(q){E.push(q),y=this.charCodeToPatternIdxToConfig[q],m=this.patternIdxToConfig[q],S=m.length,S=m.length;const te=this.canModeBeOptimized[q]&&this.config.safeMode===!1;y&&te?x=!0:x=!1}z.call(this,n);let G;const se=this.config.recoveryEnabled;for(;O<w;){c=null,h=-1;const q=L.charCodeAt(O);let te;if(x){const ge=En(q),ue=y[ge];te=ue!==void 0?ue:$}else te=m;const De=te.length;for(r=0;r<De;r++){G=te[r];const ge=G.pattern;l=null;const ue=G.short;if(ue!==!1?q===ue&&(h=1,c=ge):G.isCustom===!0?(N=ge.exec(L,O,ie,C),N!==null?(c=N[0],h=c.length,N.payload!==void 0&&(l=N.payload)):c=null):(ge.lastIndex=O,h=this.matchLength(ge,e,O)),h!==-1){if(o=G.longerAlt,o!==void 0){c=e.substring(O,O+h);const Pe=o.length;for(s=0;s<Pe;s++){const Me=m[o[s]],be=Me.pattern;if(d=null,Me.isCustom===!0?(N=be.exec(L,O,ie,C),N!==null?(a=N[0],N.payload!==void 0&&(d=N.payload)):a=null):(be.lastIndex=O,a=this.match(be,e,O)),a&&a.length>c.length){c=a,h=a.length,l=d,G=Me;break}}}break}}if(h!==-1){if(p=G.group,p!==void 0&&(c=c!==null?c:e.substring(O,O+h),R=G.tokenTypeIdx,k=this.createTokenInstance(c,O,R,G.tokenType,$e,Se,h),this.handlePayload(k,l),p===!1?J=this.addToken(ie,J,k):C[p].push(k)),v===!0&&G.canLineTerminator===!0){let ge=0,ue,Pe;g.lastIndex=0;do c=c!==null?c:e.substring(O,O+h),ue=g.test(c),ue===!0&&(Pe=g.lastIndex-1,ge++);while(ue===!0);ge!==0?($e=$e+ge,Se=h-Pe,this.updateTokenEndLineColumnLocation(k,p,Pe,ge,$e,Se,h)):Se=this.computeNewColumn(Se,h)}else Se=this.computeNewColumn(Se,h);O=O+h,this.handleModes(G,P,z,k)}else{const ge=O,ue=$e,Pe=Se;let Me=se===!1;for(;Me===!1&&O<w;)for(O++,i=0;i<S;i++){const be=m[i],Q=be.pattern,ct=be.short;if(ct!==!1?L.charCodeAt(O)===ct&&(Me=!0):be.isCustom===!0?Me=Q.exec(L,O,ie,C)!==null:(Q.lastIndex=O,Me=Q.exec(e)!==null),Me===!0)break}if(_=O-ge,Se=this.computeNewColumn(Se,_),M=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(L,ge,_,ue,Pe,qn(E)),we.push({offset:ge,line:ue,column:Pe,length:_,message:M}),se===!1)break}}return this.hasCustom||(ie.length=J),{tokens:ie,groups:C,errors:we}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let c,l;n!==void 0&&(c=r===o-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=a-1+-l))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}match(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchLength(e,n,r){return e.test(n)===!0?e.lastIndex-r:-1}}rt.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.";rt.NA=/NOT_APPLICABLE/;function Nr(t){return ih(t)?t.LABEL:t.name}function ih(t){return it(t.LABEL)&&t.LABEL!==""}const py="parent",cu="categories",lu="label",uu="group",du="push_mode",fu="pop_mode",hu="longer_alt",pu="line_breaks",mu="start_chars_hint";function sh(t){return my(t)}function my(t){const e=t.pattern,n={};if(n.name=t.name,nn(e)||(n.PATTERN=e),B(t,py))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return B(t,cu)&&(n.CATEGORIES=t[cu]),Xi([n]),B(t,lu)&&(n.LABEL=t[lu]),B(t,uu)&&(n.GROUP=t[uu]),B(t,fu)&&(n.POP_MODE=t[fu]),B(t,du)&&(n.PUSH_MODE=t[du]),B(t,hu)&&(n.LONGER_ALT=t[hu]),B(t,pu)&&(n.LINE_BREAKS=t[pu]),B(t,mu)&&(n.START_CHARS_HINT=t[mu]),n}const An=sh({name:"EOF",pattern:rt.NA});Xi([An]);function Sl(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function ah(t,e){return Yi(t,e)}const kr={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${ih(t)?`--> ${Nr(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:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
|
|
58
|
+
but found: '`+$t(e).image+"'";if(r)return s+r+o;{const c=Qe(t,(p,R)=>p.concat(R),[]),l=D(c,p=>`[${D(p,R=>Nr(R)).join(", ")}]`),h=`one of these possible Token sequences:
|
|
59
|
+
${D(l,(p,R)=>` ${R+1}. ${p}`).join(`
|
|
60
|
+
`)}`;return s+h+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
|
|
61
|
+
but found: '`+$t(e).image+"'";if(n)return i+n+a;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${D(t,l=>`[${D(l,d=>Nr(d)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(kr);const gy={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},zn={buildDuplicateFoundError(t,e){function n(d){return d instanceof le?d.terminalType.name:d instanceof Ze?d.nonTerminalName:""}const r=t.name,i=$t(e),s=i.idx,a=Mt(i),o=n(i),c=s>0;let l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
67
|
+
`),l},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=D(t.prefixPath,i=>Nr(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${n}> 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,n=t.prefixPath.length===0;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
+
`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
77
|
+
Only the last alternative may be empty.
|
|
78
|
+
`;else{const i=D(t.prefixPath,s=>Nr(s)).join(", ");r+=`<${i}> may appears as a prefix path in all these alternatives.
|
|
79
|
+
`}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
80
|
+
For Further details.`,r},buildEmptyRepetitionError(t){let e=Mt(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,n=D(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.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
|
+
${r}
|
|
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 Kr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function yy(t,e){const n=new Ty(t,e);return n.resolveRefs(),n.errors}class Ty extends Hr{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){j(Oe(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:et.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Ry extends _a{constructor(e,n){super(),this.topProd=e,this.path=n,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=qe(this.path.ruleStack).reverse(),this.occurrenceStack=qe(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){oe(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class vy extends Ry{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new st({definition:i});this.possibleTokTypes=Hi(s),this.found=!0}}}class $a extends _a{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Ey extends $a{walkMany(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class gu extends $a{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class Ay extends $a{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class yu extends $a{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=$t(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Oo(t,e,n=[]){n=qe(n);let r=[],i=0;function s(o){return o.concat(Ge(t,i+1))}function a(o){const c=Oo(s(o),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof st)return a(o.definition);if(o instanceof Ze)return a(o.definition);if(o instanceof Be)r=a(o.definition);else if(o instanceof mt){const c=o.definition.concat([new Ee({definition:o.definition})]);return a(c)}else if(o instanceof gt){const c=[new st({definition:o.definition}),new Ee({definition:[new le({terminalType:o.separator})].concat(o.definition)})];return a(c)}else if(o instanceof at){const c=o.definition.concat([new Ee({definition:[new le({terminalType:o.separator})].concat(o.definition)})]);r=a(c)}else if(o instanceof Ee){const c=o.definition.concat([new Ee({definition:o.definition})]);r=a(c)}else{if(o instanceof ot)return j(o.definition,c=>{oe(c.definition)===!1&&(r=a(c.definition))}),r;if(o instanceof le)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Ge(t,i)}),r}function oh(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const c=e.length,l=c-r-1,d=[],h=[];for(h.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!oe(h);){const p=h.pop();if(p===a){o&&qn(h).idx<=l&&h.pop();continue}const R=p.def,k=p.idx,_=p.ruleStack,M=p.occurrenceStack;if(oe(R))continue;const N=R[0];if(N===i){const L={idx:k,def:Ge(R),ruleStack:bi(_),occurrenceStack:bi(M)};h.push(L)}else if(N instanceof le)if(k<c-1){const L=k+1,w=e[L];if(n(w,N.terminalType)){const O={idx:L,def:Ge(R),ruleStack:_,occurrenceStack:M};h.push(O)}}else if(k===c-1)d.push({nextTokenType:N.terminalType,nextTokenOccurrence:N.idx,ruleStack:_,occurrenceStack:M}),o=!0;else throw Error("non exhaustive match");else if(N instanceof Ze){const L=qe(_);L.push(N.nonTerminalName);const w=qe(M);w.push(N.idx);const O={idx:k,def:N.definition.concat(s,Ge(R)),ruleStack:L,occurrenceStack:w};h.push(O)}else if(N instanceof Be){const L={idx:k,def:Ge(R),ruleStack:_,occurrenceStack:M};h.push(L),h.push(a);const w={idx:k,def:N.definition.concat(Ge(R)),ruleStack:_,occurrenceStack:M};h.push(w)}else if(N instanceof mt){const L=new Ee({definition:N.definition,idx:N.idx}),w=N.definition.concat([L],Ge(R)),O={idx:k,def:w,ruleStack:_,occurrenceStack:M};h.push(O)}else if(N instanceof gt){const L=new le({terminalType:N.separator}),w=new Ee({definition:[L].concat(N.definition),idx:N.idx}),O=N.definition.concat([w],Ge(R)),J={idx:k,def:O,ruleStack:_,occurrenceStack:M};h.push(J)}else if(N instanceof at){const L={idx:k,def:Ge(R),ruleStack:_,occurrenceStack:M};h.push(L),h.push(a);const w=new le({terminalType:N.separator}),O=new Ee({definition:[w].concat(N.definition),idx:N.idx}),J=N.definition.concat([O],Ge(R)),re={idx:k,def:J,ruleStack:_,occurrenceStack:M};h.push(re)}else if(N instanceof Ee){const L={idx:k,def:Ge(R),ruleStack:_,occurrenceStack:M};h.push(L),h.push(a);const w=new Ee({definition:N.definition,idx:N.idx}),O=N.definition.concat([w],Ge(R)),J={idx:k,def:O,ruleStack:_,occurrenceStack:M};h.push(J)}else if(N instanceof ot)for(let L=N.definition.length-1;L>=0;L--){const w=N.definition[L],O={idx:k,def:w.definition.concat(Ge(R)),ruleStack:_,occurrenceStack:M};h.push(O),h.push(a)}else if(N instanceof st)h.push({idx:k,def:N.definition.concat(Ge(R)),ruleStack:_,occurrenceStack:M});else if(N instanceof Kr)h.push(Sy(N,k,_,M));else throw Error("non exhaustive match")}return d}function Sy(t,e,n,r){const i=qe(n);i.push(t.name);const s=qe(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var he;(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"})(he||(he={}));function kl(t){if(t instanceof Be||t==="Option")return he.OPTION;if(t instanceof Ee||t==="Repetition")return he.REPETITION;if(t instanceof mt||t==="RepetitionMandatory")return he.REPETITION_MANDATORY;if(t instanceof gt||t==="RepetitionMandatoryWithSeparator")return he.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof at||t==="RepetitionWithSeparator")return he.REPETITION_WITH_SEPARATOR;if(t instanceof ot||t==="Alternation")return he.ALTERNATION;throw Error("non exhaustive match")}function Tu(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=kl(r);return s===he.ALTERNATION?Pa(e,n,i):La(e,n,s,i)}function ky(t,e,n,r,i,s){const a=Pa(t,e,n),o=uh(a)?Zs:Yi;return s(a,r,o,i)}function Cy(t,e,n,r,i,s){const a=La(t,e,i,n),o=uh(a)?Zs:Yi;return s(a[0],o,r)}function Ny(t,e,n,r){const i=t.length,s=_t(t,a=>_t(a,o=>o.length===1));if(e)return function(a){const o=D(a,c=>c.GATE);for(let c=0;c<i;c++){const l=t[c],d=l.length,h=o[c];if(!(h!==void 0&&h.call(this)===!1))e:for(let p=0;p<d;p++){const R=l[p],k=R.length;for(let _=0;_<k;_++){const M=this.LA(_+1);if(n(M,R[_])===!1)continue e}return c}}};if(s&&!r){const a=D(t,c=>vt(c)),o=Qe(a,(c,l,d)=>(j(l,h=>{B(c,h.tokenTypeIdx)||(c[h.tokenTypeIdx]=d),j(h.categoryMatches,p=>{B(c,p)||(c[p]=d)})}),c),{});return function(){const c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],c=o.length;e:for(let l=0;l<c;l++){const d=o[l],h=d.length;for(let p=0;p<h;p++){const R=this.LA(p+1);if(n(R,d[p])===!1)continue e}return a}}}}function wy(t,e,n){const r=_t(t,s=>s.length===1),i=t.length;if(r&&!n){const s=vt(t);if(s.length===1&&oe(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Qe(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,j(c.categoryMatches,d=>{o[d]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let c=0;c<o;c++){const l=this.LA(c+1);if(e(l,a[c])===!1)continue e}return!0}return!1}}class by extends _a{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,he.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,he.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,he.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,he.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,he.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class ch extends Hr{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,he.OPTION)}visitRepetition(e){this.checkIsTarget(e,he.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,he.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,he.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,he.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,he.ALTERNATION)}}function Ru(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function io(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const c="_"+r.categoryMatches[o];i.push(a+c)}}e=i}return e}function _y(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function lh(t,e){const n=D(t,a=>Oo([a],1)),r=Ru(n.length),i=D(n,a=>{const o={};return j(a,c=>{const l=io(c.partialPath);j(l,d=>{o[d]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=Ru(o.length);for(let c=0;c<o.length;c++){const l=o[c];for(let d=0;d<l.length;d++){const h=l[d].partialPath,p=l[d].suffixDef,R=io(h);if(_y(i,R,c)||oe(p)||h.length===e){const _=r[c];if(xo(_,h)===!1){_.push(h);for(let M=0;M<R.length;M++){const N=R[M];i[c][N]=!0}}}else{const _=Oo(p,a+1,h);s[c]=s[c].concat(_),j(_,M=>{const N=io(M.partialPath);j(N,L=>{i[c][L]=!0})})}}}}return r}function Pa(t,e,n,r){const i=new ch(t,he.ALTERNATION,r);return e.accept(i),lh(i.result,n)}function La(t,e,n,r){const i=new ch(t,n);e.accept(i);const s=i.result,o=new by(e,t,n).startWalking(),c=new st({definition:s}),l=new st({definition:o});return lh([c,l],r)}function xo(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Iy(t,e){return t.length<e.length&&_t(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function uh(t){return _t(t,e=>_t(e,n=>_t(n,r=>oe(r.categoryMatches))))}function $y(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return D(e,n=>Object.assign({type:et.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Py(t,e,n,r){const i=ft(t,c=>Ly(c,n)),s=Wy(t,e,n),a=ft(t,c=>jy(c,n)),o=ft(t,c=>Dy(c,t,r,n));return i.concat(s,a,o)}function Ly(t,e){const n=new xy;t.accept(n);const r=n.allProductions,i=dm(r,Oy),s=Pt(i,o=>o.length>1);return D(Oe(s),o=>{const c=$t(o),l=e.buildDuplicateFoundError(t,o),d=Mt(c),h={message:l,type:et.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:d,occurrence:c.idx},p=dh(c);return p&&(h.parameter=p),h})}function Oy(t){return`${Mt(t)}_#_${t.idx}_#_${dh(t)}`}function dh(t){return t instanceof le?t.terminalType.name:t instanceof Ze?t.nonTerminalName:""}class xy extends Hr{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 Dy(t,e,n,r){const i=[];if(Qe(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:et.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function My(t,e,n){const r=[];let i;return tt(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:et.INVALID_RULE_OVERRIDE,ruleName:t})),r}function fh(t,e,n,r=[]){const i=[],s=Us(e.definition);if(oe(s))return[];{const a=t.name;tt(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:et.LEFT_RECURSION,ruleName:a});const c=Aa(s,r.concat([t])),l=ft(c,d=>{const h=qe(r);return h.push(d),fh(t,d,n,h)});return i.concat(l)}}function Us(t){let e=[];if(oe(t))return e;const n=$t(t);if(n instanceof Ze)e.push(n.referencedRule);else if(n instanceof st||n instanceof Be||n instanceof mt||n instanceof gt||n instanceof at||n instanceof Ee)e=e.concat(Us(n.definition));else if(n instanceof ot)e=vt(D(n.definition,s=>Us(s.definition)));else if(!(n instanceof le))throw Error("non exhaustive match");const r=Js(n),i=t.length>1;if(r&&i){const s=Ge(t);return e.concat(Us(s))}else return e}class Cl extends Hr{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Fy(t,e){const n=new Cl;t.accept(n);const r=n.alternations;return ft(r,s=>{const a=bi(s.definition);return ft(a,(o,c)=>{const l=oh([o],[],Yi,1);return oe(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:et.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function Gy(t,e,n){const r=new Cl;t.accept(r);let i=r.alternations;return i=Sa(i,a=>a.ignoreAmbiguities===!0),ft(i,a=>{const o=a.idx,c=a.maxLookahead||e,l=Pa(o,t,c,a),d=By(l,a,t,n),h=qy(l,a,t,n);return d.concat(h)})}class Uy extends Hr{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 jy(t,e){const n=new Cl;t.accept(n);const r=n.alternations;return ft(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:et.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function zy(t,e,n){const r=[];return j(t,i=>{const s=new Uy;i.accept(s);const a=s.allProductions;j(a,o=>{const c=kl(o),l=o.maxLookahead||e,d=o.idx,p=La(d,i,c,l)[0];if(oe(vt(p))){const R=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:R,type:et.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function By(t,e,n,r){const i=[],s=Qe(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||j(c,d=>{const h=[l];j(t,(p,R)=>{l!==R&&xo(p,d)&&e.definition[R].ignoreAmbiguities!==!0&&h.push(R)}),h.length>1&&!xo(i,d)&&(i.push(d),o.push({alts:h,path:d}))}),o),[]);return D(s,o=>{const c=D(o.alts,d=>d+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:et.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function qy(t,e,n,r){const i=Qe(t,(a,o,c)=>{const l=D(o,d=>({idx:c,path:d}));return a.concat(l)},[]);return qi(ft(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const c=a.idx,l=a.path,d=pt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&Iy(p.path,l));return D(d,p=>{const R=[p.idx+1,c+1],k=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:R,prefixPath:p.path}),type:et.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:k,alternatives:R}})}))}function Wy(t,e,n){const r=[],i=D(e,s=>s.name);return j(t,s=>{const a=s.name;if(tt(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:et.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function Vy(t){const e=pl(t,{errMsgProvider:gy}),n={};return j(t.rules,r=>{n[r.name]=r}),yy(n,e.errMsgProvider)}function Ky(t){return t=pl(t,{errMsgProvider:zn}),Py(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const hh="MismatchedTokenException",ph="NoViableAltException",mh="EarlyExitException",gh="NotAllInputParsedException",yh=[hh,ph,mh,gh];Object.freeze(yh);function ea(t){return tt(yh,t.name)}class Oa extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Th extends Oa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=hh}}class Hy extends Oa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=ph}}class Yy extends Oa{constructor(e,n){super(e,n),this.name=gh}}class Xy extends Oa{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=mh}}const so={},Rh="InRuleRecoveryException";class Jy extends Error{constructor(e){super(e),this.name=Rh}}class Qy{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=B(e,"recoveryEnabled")?e.recoveryEnabled:sn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Zy)}getTokenToInsert(e){const n=Sl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let c=!1;const l=this.LA(1);let d=this.LA(1);const h=()=>{const p=this.LA(0),R=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),k=new Th(R,l,this.LA(0));k.resyncedTokens=bi(o),this.SAVE_ERROR(k)};for(;!c;)if(this.tokenMatcher(d,i)){h();return}else if(r.call(this)){h(),e.apply(this,n);return}else this.tokenMatcher(d,s)?c=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new Jy("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||oe(n))return!1;const r=this.LA(1);return br(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return tt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=br(e,s=>ah(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return so;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return D(e,(r,i)=>i===0?so:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=D(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return vt(e)}getFollowSetFromFollowKey(e){if(e===so)return[An];const n=e.ruleName+e.idxInCallingRule+Xf+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,An)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return bi(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=qe(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return D(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Zy(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[o];if(c===void 0){const p=this.getCurrRuleFullName(),R=this.getGAstProductions()[p];c=new s(R,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,d=c.occurrence;const h=c.isEndOfRule;this.RULE_STACK.length===1&&h&&l===void 0&&(l=An,d=1),!(l===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,d,a)&&this.tryInRepetitionRecovery(t,e,n,l)}const eT=4,Cn=8,vh=1<<Cn,Eh=2<<Cn,Do=3<<Cn,Mo=4<<Cn,Fo=5<<Cn,js=6<<Cn;function ao(t,e,n){return n|e|t}class Nl{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:sn.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(oe(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return ft(e,n=>fh(n,n,zn))}validateEmptyOrAlternatives(e){return ft(e,n=>Fy(n,zn))}validateAmbiguousAlternationAlternatives(e,n){return ft(e,r=>Gy(r,n,zn))}validateSomeNonEmptyLookaheadPath(e,n){return zy(e,n,zn)}buildLookaheadForAlternation(e){return ky(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Ny)}buildLookaheadForOptional(e){return Cy(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,kl(e.prodType),wy)}}class tT{initLooksAhead(e){this.dynamicTokensEnabled=B(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:sn.dynamicTokensEnabled,this.maxLookahead=B(e,"maxLookahead")?e.maxLookahead:sn.maxLookahead,this.lookaheadStrategy=B(e,"lookaheadStrategy")?e.lookaheadStrategy:new Nl({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){j(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=rT(n);j(r,l=>{const d=l.idx===0?"":l.idx;this.TRACE_INIT(`${Mt(l)}${d}`,()=>{const h=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:n,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=ao(this.fullRuleNameToShort[n.name],vh,l.idx);this.setLaFuncCache(p,h)})}),j(i,l=>{this.computeLookaheadFunc(n,l.idx,Do,"Repetition",l.maxLookahead,Mt(l))}),j(s,l=>{this.computeLookaheadFunc(n,l.idx,Eh,"Option",l.maxLookahead,Mt(l))}),j(a,l=>{this.computeLookaheadFunc(n,l.idx,Mo,"RepetitionMandatory",l.maxLookahead,Mt(l))}),j(o,l=>{this.computeLookaheadFunc(n,l.idx,js,"RepetitionMandatoryWithSeparator",l.maxLookahead,Mt(l))}),j(c,l=>{this.computeLookaheadFunc(n,l.idx,Fo,"RepetitionWithSeparator",l.maxLookahead,Mt(l))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=ao(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return ao(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class nT extends Hr{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 ks=new nT;function rT(t){ks.reset(),t.accept(ks);const e=ks.dslMethods;return ks.reset(),e}function vu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Eu(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 iT(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function sT(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const aT="name";function Ah(t,e){Object.defineProperty(t,aT,{enumerable:!1,configurable:!0,writable:!1,value:e})}function oT(t,e){const n=wr(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let c=0;c<o;c++){const l=a[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function cT(t,e){const n=function(){};Ah(n,t+"BaseSemantics");const r={visit:function(i,s){if(ze(i)&&(i=i[0]),!nn(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=uT(this,e);if(!oe(i)){const s=D(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
90
|
+
${s.join(`
|
|
91
|
+
|
|
92
|
+
`).replace(/\n/g,`
|
|
93
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function lT(t,e,n){const r=function(){};Ah(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return j(e,s=>{i[s]=oT}),r.prototype=i,r.prototype.constructor=r,r}var Go;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Go||(Go={}));function uT(t,e){return dT(t,e)}function dT(t,e){const n=pt(e,i=>Jn(t[i])===!1),r=D(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Go.MISSING_METHOD,methodName:i}));return qi(r)}class fT{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=B(e,"nodeLocationTracking")?e.nodeLocationTracking:sn.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Fe,this.cstFinallyStateUpdate=Fe,this.cstPostTerminal=Fe,this.cstPostNonTerminal=Fe,this.cstPostRule=Fe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eu,this.setNodeLocationFromNode=Eu,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vu,this.setNodeLocationFromNode=vu,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=Fe,this.setInitialNodeLocation=Fe;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];iT(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];sT(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(nn(this.baseCstVisitorConstructor)){const e=cT(this.className,wr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(nn(this.baseCstVisitorWithDefaultsConstructor)){const e=lT(this.className,wr(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class hT{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):na}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?na:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class pT{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}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,n,r=ra){if(tt(this.definedRulesNames,e)){const a={message:zn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:et.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=ra){const i=My(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(ea(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ag(Oe(this.gastProductionsCache))}}class mT{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Zs,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},B(n,"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(ze(e)){if(oe(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
96
|
+
Note that the first argument for the parser constructor
|
|
97
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
98
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
99
|
+
For Further details.`)}if(ze(e))this.tokensMap=Qe(e,(s,a)=>(s[a.name]=a,s),{});else if(B(e,"modes")&&_t(vt(Oe(e.modes)),hy)){const s=vt(Oe(e.modes)),a=ml(s);this.tokensMap=Qe(a,(o,c)=>(o[c.name]=c,o),{})}else if(zp(e))this.tokensMap=qe(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=An;const r=B(e,"modes")?vt(Oe(e.modes)):Oe(e),i=_t(r,s=>oe(s.categoryMatches));this.tokenMatcher=i?Zs:Yi,Xi(Oe(this.tokensMap))}defineRule(e,n,r){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=B(r,"resyncEnabled")?r.resyncEnabled:ra.resyncEnabled,s=B(r,"recoveryValueFunc")?r.recoveryValueFunc:ra.recoveryValueFunc,a=this.ruleShortNameIdx<<eT+Cn;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...d){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,d);const h=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(h),h}catch(h){return this.invokeRuleCatch(h,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...d){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,d)}catch(h){return this.invokeRuleCatch(h,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(ea(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(Eh,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Mo,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,he.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Mo,e,Ay)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(js,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,yu],o,js,e,yu)}else throw this.raiseEarlyExitException(e,he.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(Do,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const c=i;i=()=>o.call(this)&&c.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,Do,e,Ey,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Fo,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,gu],o,Fo,e,gu)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,js,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(vh,n),i=ze(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Yy(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw ea(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Th(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===Rh?r:s}}else throw r}saveRecogState(){const e=this.errors,n=qe(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),An)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class gT{initErrorHandler(e){this._errors=[],this.errorMessageProvider=B(e,"errorMessageProvider")?e.errorMessageProvider:sn.errorMessageProvider}SAVE_ERROR(e){if(ea(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:qe(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return qe(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=La(e,s,n,this.maxLookahead)[0],c=[];for(let d=1;d<=this.maxLookahead;d++)c.push(this.LA(d));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new Xy(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Pa(e,i,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));const o=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Hy(c,this.LA(1),o))}}class yT{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(nn(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return oh([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=$t(e.ruleStack),i=this.getGAstProductions()[n];return new vy(i,e).startWalking()}}const xa={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(xa);const Au=!0,Su=Math.pow(2,Cn)-1,Sh=sh({name:"RECORDING_PHASE_TOKEN",pattern:rt.NA});Xi([Sh]);const kh=Sl(Sh,`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(kh);const TT={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 RT{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 n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},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 n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}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,n){return()=>!0}LA_RECORD(e){return na}topLevelRuleRecord(e,n){try{const r=new Kr({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.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 r}throw r}}optionInternalRecord(e,n){return fi.call(this,Be,e,n)}atLeastOneInternalRecord(e,n){fi.call(this,mt,n,e)}atLeastOneSepFirstInternalRecord(e,n){fi.call(this,gt,n,e,Au)}manyInternalRecord(e,n){fi.call(this,Ee,n,e)}manySepFirstInternalRecord(e,n){fi.call(this,at,n,e,Au)}orInternalRecord(e,n){return vT.call(this,e,n)}subruleInternalRecord(e,n,r){if(ta(n),!e||B(e,"ruleName")===!1){const o=new Error(`<SUBRULE${ku(n)}> 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=qn(this.recordingProdStack),s=e.ruleName,a=new Ze({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?TT:xa}consumeInternalRecord(e,n,r){if(ta(n),!rh(e)){const a=new Error(`<CONSUME${ku(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
106
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=qn(this.recordingProdStack),s=new le({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),kh}}function fi(t,e,n,r=!1){ta(n);const i=qn(this.recordingProdStack),s=Jn(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),B(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),xa}function vT(t,e){ta(e);const n=qn(this.recordingProdStack),r=ze(t)===!1,i=r===!1?t:t.DEF,s=new ot({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});B(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=Nf(i,o=>Jn(o.GATE));return s.hasPredicates=a,n.definition.push(s),j(i,o=>{const c=new st({definition:[]});s.definition.push(c),B(o,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:B(o,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),o.ALT.call(this),this.recordingProdStack.pop()}),xa}function ku(t){return t===0?"":`${t}`}function ta(t){if(t<0||t>Su){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
107
|
+
Idx value must be a none negative value smaller than ${Su+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class ET{initPerformanceTracer(e){if(B(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=sn.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=Hf(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function AT(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const na=Sl(An,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(na);const sn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:kr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ra=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var et;(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"})(et||(et={}));function Cu(t=void 0){return function(){return t}}class Ji{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 n=this.className;this.TRACE_INIT("toFastProps",()=>{Yf(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),j(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=Vy({rules:Oe(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(oe(r)&&this.skipValidations===!1){const i=Ky({rules:Oe(this.gastProductionsCache),tokenTypes:Oe(this.tokensMap),errMsgProvider:zn,grammarName:n}),s=$y({lookaheadStrategy:this.lookaheadStrategy,rules:Oe(this.gastProductionsCache),tokenTypes:Oe(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),oe(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=_g(Oe(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Oe(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Oe(this.gastProductionsCache))})),!Ji.DEFER_DEFINITION_ERRORS_HANDLING&&!oe(this.definitionErrors))throw e=D(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
108
|
+
${e.join(`
|
|
109
|
+
-------------------------------
|
|
110
|
+
`)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),B(n,"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=B(n,"skipValidations")?n.skipValidations:sn.skipValidations}}Ji.DEFER_DEFINITION_ERRORS_HANDLING=!1;AT(Ji,[Qy,tT,fT,hT,mT,pT,gT,yT,RT,ET]);class ST extends Ji{constructor(e,n=sn){const r=qe(n);r.outputCst=!1,super(e,r)}}function _r(t,e,n){return`${t.name}_${e}_${n}`}const Sn=1,kT=2,Ch=4,Nh=5,Qi=7,CT=8,NT=9,wT=10,bT=11,wh=12;class wl{constructor(e){this.target=e}isEpsilon(){return!1}}class bl extends wl{constructor(e,n){super(e),this.tokenType=n}}class bh extends wl{constructor(e){super(e)}isEpsilon(){return!0}}class _l extends wl{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function _T(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};IT(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Qn(e,i,i);s!==void 0&&jT(e,i,s)}return e}function IT(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=xe(t,i,void 0,{type:kT}),a=xe(t,i,void 0,{type:Qi});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function _h(t,e,n){return n instanceof le?Il(t,e,n.terminalType,n):n instanceof Ze?UT(t,e,n):n instanceof ot?xT(t,e,n):n instanceof Be?DT(t,e,n):n instanceof Ee?$T(t,e,n):n instanceof at?PT(t,e,n):n instanceof mt?LT(t,e,n):n instanceof gt?OT(t,e,n):Qn(t,e,n)}function $T(t,e,n){const r=xe(t,e,n,{type:Nh});Nn(t,r);const i=Yr(t,e,r,n,Qn(t,e,n));return $h(t,e,n,i)}function PT(t,e,n){const r=xe(t,e,n,{type:Nh});Nn(t,r);const i=Yr(t,e,r,n,Qn(t,e,n)),s=Il(t,e,n.separator,n);return $h(t,e,n,i,s)}function LT(t,e,n){const r=xe(t,e,n,{type:Ch});Nn(t,r);const i=Yr(t,e,r,n,Qn(t,e,n));return Ih(t,e,n,i)}function OT(t,e,n){const r=xe(t,e,n,{type:Ch});Nn(t,r);const i=Yr(t,e,r,n,Qn(t,e,n)),s=Il(t,e,n.separator,n);return Ih(t,e,n,i,s)}function xT(t,e,n){const r=xe(t,e,n,{type:Sn});Nn(t,r);const i=D(n.definition,a=>_h(t,e,a));return Yr(t,e,r,n,...i)}function DT(t,e,n){const r=xe(t,e,n,{type:Sn});Nn(t,r);const i=Yr(t,e,r,n,Qn(t,e,n));return MT(t,e,n,i)}function Qn(t,e,n){const r=pt(D(n.definition,i=>_h(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:GT(t,r)}function Ih(t,e,n,r,i){const s=r.left,a=r.right,o=xe(t,e,n,{type:bT});Nn(t,o);const c=xe(t,e,n,{type:wh});return s.loopback=o,c.loopback=o,t.decisionMap[_r(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,_e(a,o),i===void 0?(_e(o,s),_e(o,c)):(_e(o,c),_e(o,i.left),_e(i.right,s)),{left:s,right:c}}function $h(t,e,n,r,i){const s=r.left,a=r.right,o=xe(t,e,n,{type:wT});Nn(t,o);const c=xe(t,e,n,{type:wh}),l=xe(t,e,n,{type:NT});return o.loopback=l,c.loopback=l,_e(o,s),_e(o,c),_e(a,l),i!==void 0?(_e(l,c),_e(l,i.left),_e(i.right,s)):_e(l,o),t.decisionMap[_r(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:c}}function MT(t,e,n,r){const i=r.left,s=r.right;return _e(i,s),t.decisionMap[_r(e,"Option",n.idx)]=i,r}function Nn(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Yr(t,e,n,r,...i){const s=xe(t,e,r,{type:CT,start:n});n.end=s;for(const o of i)o!==void 0?(_e(n,o.left),_e(o.right,s)):_e(n,s);const a={left:n,right:s};return t.decisionMap[_r(e,FT(r),r.idx)]=n,a}function FT(t){if(t instanceof ot)return"Alternation";if(t instanceof Be)return"Option";if(t instanceof Ee)return"Repetition";if(t instanceof at)return"RepetitionWithSeparator";if(t instanceof mt)return"RepetitionMandatory";if(t instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function GT(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const c=o instanceof _l,l=o,d=e[s+1].left;a.left.type===Sn&&a.right.type===Sn&&o!==void 0&&(c&&l.followState===a.right||o.target===a.right)?(c?l.followState=d:o.target=d,zT(t,a.right)):_e(a.right,d)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Il(t,e,n,r){const i=xe(t,e,r,{type:Sn}),s=xe(t,e,r,{type:Sn});return $l(i,new bl(s,n)),{left:i,right:s}}function UT(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=xe(t,e,n,{type:Sn}),a=xe(t,e,n,{type:Sn}),o=new _l(i,r,a);return $l(s,o),{left:s,right:a}}function jT(t,e,n){const r=t.ruleToStartState.get(e);_e(r,n.left);const i=t.ruleToStopState.get(e);return _e(n.right,i),{left:r,right:i}}function _e(t,e){const n=new bh(e);$l(t,n)}function xe(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function $l(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function zT(t,e){t.states.splice(t.states.indexOf(e),1)}const ia={};class Uo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=Ph(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return D(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function Ph(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function BT(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class Lh{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const Nu=new Lh;class qT extends Nl{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=_T(e.rules),this.dfas=WT(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=_r(r,"Alternation",n),d=this.atn.decisionMap[c].decision,h=D(Tu({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),p=>D(p,R=>R[0]));if(wu(h,!1)&&!s){const p=Qe(h,(R,k,_)=>(j(k,M=>{M&&(R[M.tokenTypeIdx]=_,j(M.categoryMatches,N=>{R[N]=_}))}),R),{});return i?function(R){var k;const _=this.LA(1),M=p[_.tokenTypeIdx];if(R!==void 0&&M!==void 0){const N=(k=R[M])===null||k===void 0?void 0:k.GATE;if(N!==void 0&&N.call(this)===!1)return}return M}:function(){const R=this.LA(1);return p[R.tokenTypeIdx]}}else return i?function(p){const R=new Lh,k=p===void 0?0:p.length;for(let M=0;M<k;M++){const N=p?.[M].GATE;R.set(M,N===void 0||N.call(this))}const _=oo.call(this,a,d,R,o);return typeof _=="number"?_:void 0}:function(){const p=oo.call(this,a,d,Nu,o);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=_r(r,i,n),d=this.atn.decisionMap[c].decision,h=D(Tu({maxLookahead:1,occurrence:n,prodType:i,rule:r}),p=>D(p,R=>R[0]));if(wu(h)&&h[0][0]&&!s){const p=h[0],R=vt(p);if(R.length===1&&oe(R[0].categoryMatches)){const _=R[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===_}}else{const k=Qe(R,(_,M)=>(M!==void 0&&(_[M.tokenTypeIdx]=!0,j(M.categoryMatches,N=>{_[N]=!0})),_),{});return function(){const _=this.LA(1);return k[_.tokenTypeIdx]===!0}}}return function(){const p=oo.call(this,a,d,Nu,o);return typeof p=="object"?!1:p===0}}}function wu(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function WT(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=BT(t.decisionStates[r],r);return n}function oo(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=nR(i.atnStartState);s=xh(i,Oh(o)),i.start=s}return VT.apply(this,[i,s,n,r])}function VT(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let c=QT(i,o);if(c===void 0&&(c=KT.apply(this,[t,i,o,s,n,r])),c===ia)return JT(a,i,o);if(c.isAcceptState===!0)return c.prediction;i=c,a.push(o),o=this.LA(s++)}}function KT(t,e,n,r,i,s){const a=ZT(e.configs,n,i);if(a.size===0)return bu(t,e,n,ia),ia;let o=Oh(a);const c=tR(a,i);if(c!==void 0)o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c;else if(aR(a)){const l=Zp(a.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,HT.apply(this,[t,r,a.alts,s])}return o=bu(t,e,n,o),o}function HT(t,e,n,r){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,c=YT({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(c)}function YT(t){const e=D(t.prefixPath,i=>Nr(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${XT(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
114
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
115
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
116
|
+
For Further details.`,r}function XT(t){if(t instanceof Ze)return"SUBRULE";if(t instanceof Be)return"OPTION";if(t instanceof ot)return"OR";if(t instanceof mt)return"AT_LEAST_ONE";if(t instanceof gt)return"AT_LEAST_ONE_SEP";if(t instanceof at)return"MANY_SEP";if(t instanceof Ee)return"MANY";if(t instanceof le)return"CONSUME";throw Error("non exhaustive match")}function JT(t,e,n){const r=ft(e.configs.elements,s=>s.state.transitions),i=Rm(r.filter(s=>s instanceof bl).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function QT(t,e){return t.edges[e.tokenTypeIdx]}function ZT(t,e,n){const r=new Uo,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===Qi){i.push(a);continue}const o=a.state.transitions.length;for(let c=0;c<o;c++){const l=a.state.transitions[c],d=eR(l,e);d!==void 0&&r.add({state:d,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Uo;for(const a of r.elements)sa(a,s)}if(i.length>0&&!iR(s))for(const a of i)s.add(a);return s}function eR(t,e){if(t instanceof bl&&ah(e,t.tokenType))return t.target}function tR(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Oh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function bu(t,e,n,r){return r=xh(t,r),e.edges[n.tokenTypeIdx]=r,r}function xh(t,e){if(e===ia)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function nR(t){const e=new Uo,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};sa(s,e)}return e}function sa(t,e){const n=t.state;if(n.type===Qi){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};sa(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=rR(t,s);a!==void 0&&sa(a,e)}}function rR(t,e){if(e instanceof bh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof _l){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function iR(t){for(const e of t.elements)if(e.state.type===Qi)return!0;return!1}function sR(t){for(const e of t.elements)if(e.state.type!==Qi)return!1;return!0}function aR(t){if(sR(t))return!0;const e=oR(t.elements);return cR(e)&&!lR(e)}function oR(t){const e=new Map;for(const n of t){const r=Ph(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function cR(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function lR(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var jo;(function(t){function e(n){return typeof n=="string"}t.is=e})(jo||(jo={}));var aa;(function(t){function e(n){return typeof n=="string"}t.is=e})(aa||(aa={}));var zo;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(zo||(zo={}));var $i;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})($i||($i={}));var ee;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=$i.MAX_VALUE),i===Number.MAX_VALUE&&(i=$i.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return T.objectLiteral(i)&&T.uinteger(i.line)&&T.uinteger(i.character)}t.is=n})(ee||(ee={}));var Y;(function(t){function e(r,i,s,a){if(T.uinteger(r)&&T.uinteger(i)&&T.uinteger(s)&&T.uinteger(a))return{start:ee.create(r,i),end:ee.create(s,a)};if(ee.is(r)&&ee.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return T.objectLiteral(i)&&ee.is(i.start)&&ee.is(i.end)}t.is=n})(Y||(Y={}));var Pi;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return T.objectLiteral(i)&&Y.is(i.range)&&(T.string(i.uri)||T.undefined(i.uri))}t.is=n})(Pi||(Pi={}));var Bo;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return T.objectLiteral(i)&&Y.is(i.targetRange)&&T.string(i.targetUri)&&Y.is(i.targetSelectionRange)&&(Y.is(i.originSelectionRange)||T.undefined(i.originSelectionRange))}t.is=n})(Bo||(Bo={}));var oa;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&T.numberRange(i.red,0,1)&&T.numberRange(i.green,0,1)&&T.numberRange(i.blue,0,1)&&T.numberRange(i.alpha,0,1)}t.is=n})(oa||(oa={}));var qo;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&Y.is(i.range)&&oa.is(i.color)}t.is=n})(qo||(qo={}));var Wo;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&T.string(i.label)&&(T.undefined(i.textEdit)||Ut.is(i))&&(T.undefined(i.additionalTextEdits)||T.typedArray(i.additionalTextEdits,Ut.is))}t.is=n})(Wo||(Wo={}));var Vo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Vo||(Vo={}));var Ko;(function(t){function e(r,i,s,a,o,c){const l={startLine:r,endLine:i};return T.defined(s)&&(l.startCharacter=s),T.defined(a)&&(l.endCharacter=a),T.defined(o)&&(l.kind=o),T.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&T.uinteger(i.startLine)&&T.uinteger(i.startLine)&&(T.undefined(i.startCharacter)||T.uinteger(i.startCharacter))&&(T.undefined(i.endCharacter)||T.uinteger(i.endCharacter))&&(T.undefined(i.kind)||T.string(i.kind))}t.is=n})(Ko||(Ko={}));var ca;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return T.defined(i)&&Pi.is(i.location)&&T.string(i.message)}t.is=n})(ca||(ca={}));var Ho;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ho||(Ho={}));var Yo;(function(t){t.Unnecessary=1,t.Deprecated=2})(Yo||(Yo={}));var Xo;(function(t){function e(n){const r=n;return T.objectLiteral(r)&&T.string(r.href)}t.is=e})(Xo||(Xo={}));var Li;(function(t){function e(r,i,s,a,o,c){let l={range:r,message:i};return T.defined(s)&&(l.severity=s),T.defined(a)&&(l.code=a),T.defined(o)&&(l.source=o),T.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return T.defined(s)&&Y.is(s.range)&&T.string(s.message)&&(T.number(s.severity)||T.undefined(s.severity))&&(T.integer(s.code)||T.string(s.code)||T.undefined(s.code))&&(T.undefined(s.codeDescription)||T.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(T.string(s.source)||T.undefined(s.source))&&(T.undefined(s.relatedInformation)||T.typedArray(s.relatedInformation,ca.is))}t.is=n})(Li||(Li={}));var Yn;(function(t){function e(r,i,...s){let a={title:r,command:i};return T.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return T.defined(i)&&T.string(i.title)&&T.string(i.command)}t.is=n})(Yn||(Yn={}));var Ut;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return T.objectLiteral(a)&&T.string(a.newText)&&Y.is(a.range)}t.is=i})(Ut||(Ut={}));var Bn;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&T.string(i.label)&&(T.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(T.string(i.description)||i.description===void 0)}t.is=n})(Bn||(Bn={}));var je;(function(t){function e(n){const r=n;return T.string(r)}t.is=e})(je||(je={}));var Jt;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return Ut.is(a)&&(Bn.is(a.annotationId)||je.is(a.annotationId))}t.is=i})(Jt||(Jt={}));var Oi;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return T.defined(i)&&xi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Oi||(Oi={}));var Ir;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&T.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||T.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||T.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=n})(Ir||(Ir={}));var $r;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&T.string(i.oldUri)&&T.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||T.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||T.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=n})($r||($r={}));var Pr;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&T.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||T.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||T.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||je.is(i.annotationId))}t.is=n})(Pr||(Pr={}));var la;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>T.string(i.kind)?Ir.is(i)||$r.is(i)||Pr.is(i):Oi.is(i)))}t.is=e})(la||(la={}));class Cs{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,s;if(r===void 0?i=Ut.insert(e,n):je.is(r)?(s=r,i=Jt.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.insert(e,n,s)),this.edits.push(i),s!==void 0)return s}replace(e,n,r){let i,s;if(r===void 0?i=Ut.replace(e,n):je.is(r)?(s=r,i=Jt.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.replace(e,n,s)),this.edits.push(i),s!==void 0)return s}delete(e,n){let r,i;if(n===void 0?r=Ut.del(e):je.is(n)?(i=n,r=Jt.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Jt.del(e,i)),this.edits.push(r),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 _u{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,n){let r;if(je.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class uR{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new _u(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if(Oi.is(n)){const r=new Cs(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new Cs(e.changes[n]);this._textEditChanges[n]=r})):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(xi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],s={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(s),r=new Cs(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new Cs(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new _u,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,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Bn.is(n)||je.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Ir.create(e,r):(a=je.is(i)?i:this._changeAnnotations.manage(i),s=Ir.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;Bn.is(r)||je.is(r)?s=r:i=r;let a,o;if(s===void 0?a=$r.create(e,n,i):(o=je.is(s)?s:this._changeAnnotations.manage(s),a=$r.create(e,n,i,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Bn.is(n)||je.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Pr.create(e,r):(a=je.is(i)?i:this._changeAnnotations.manage(i),s=Pr.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}}var Jo;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return T.defined(i)&&T.string(i.uri)}t.is=n})(Jo||(Jo={}));var Qo;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return T.defined(i)&&T.string(i.uri)&&T.integer(i.version)}t.is=n})(Qo||(Qo={}));var xi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return T.defined(i)&&T.string(i.uri)&&(i.version===null||T.integer(i.version))}t.is=n})(xi||(xi={}));var Zo;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return T.defined(i)&&T.string(i.uri)&&T.string(i.languageId)&&T.integer(i.version)&&T.string(i.text)}t.is=n})(Zo||(Zo={}));var ua;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(ua||(ua={}));var Lr;(function(t){function e(n){const r=n;return T.objectLiteral(n)&&ua.is(r.kind)&&T.string(r.value)}t.is=e})(Lr||(Lr={}));var ec;(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})(ec||(ec={}));var tc;(function(t){t.PlainText=1,t.Snippet=2})(tc||(tc={}));var nc;(function(t){t.Deprecated=1})(nc||(nc={}));var rc;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&T.string(i.newText)&&Y.is(i.insert)&&Y.is(i.replace)}t.is=n})(rc||(rc={}));var ic;(function(t){t.asIs=1,t.adjustIndentation=2})(ic||(ic={}));var sc;(function(t){function e(n){const r=n;return r&&(T.string(r.detail)||r.detail===void 0)&&(T.string(r.description)||r.description===void 0)}t.is=e})(sc||(sc={}));var ac;(function(t){function e(n){return{label:n}}t.create=e})(ac||(ac={}));var oc;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(oc||(oc={}));var Di;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return T.string(i)||T.objectLiteral(i)&&T.string(i.language)&&T.string(i.value)}t.is=n})(Di||(Di={}));var cc;(function(t){function e(n){let r=n;return!!r&&T.objectLiteral(r)&&(Lr.is(r.contents)||Di.is(r.contents)||T.typedArray(r.contents,Di.is))&&(n.range===void 0||Y.is(n.range))}t.is=e})(cc||(cc={}));var lc;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(lc||(lc={}));var uc;(function(t){function e(n,r,...i){let s={label:n};return T.defined(r)&&(s.documentation=r),T.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(uc||(uc={}));var dc;(function(t){t.Text=1,t.Read=2,t.Write=3})(dc||(dc={}));var fc;(function(t){function e(n,r){let i={range:n};return T.number(r)&&(i.kind=r),i}t.create=e})(fc||(fc={}));var hc;(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})(hc||(hc={}));var pc;(function(t){t.Deprecated=1})(pc||(pc={}));var mc;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(mc||(mc={}));var gc;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(gc||(gc={}));var yc;(function(t){function e(r,i,s,a,o,c){let l={name:r,detail:i,kind:s,range:a,selectionRange:o};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&T.string(i.name)&&T.number(i.kind)&&Y.is(i.range)&&Y.is(i.selectionRange)&&(i.detail===void 0||T.string(i.detail))&&(i.deprecated===void 0||T.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(yc||(yc={}));var Tc;(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"})(Tc||(Tc={}));var Mi;(function(t){t.Invoked=1,t.Automatic=2})(Mi||(Mi={}));var Rc;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return T.defined(i)&&T.typedArray(i.diagnostics,Li.is)&&(i.only===void 0||T.typedArray(i.only,T.string))&&(i.triggerKind===void 0||i.triggerKind===Mi.Invoked||i.triggerKind===Mi.Automatic)}t.is=n})(Rc||(Rc={}));var vc;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Yn.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&T.string(i.title)&&(i.diagnostics===void 0||T.typedArray(i.diagnostics,Li.is))&&(i.kind===void 0||T.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Yn.is(i.command))&&(i.isPreferred===void 0||T.boolean(i.isPreferred))&&(i.edit===void 0||la.is(i.edit))}t.is=n})(vc||(vc={}));var Ec;(function(t){function e(r,i){let s={range:r};return T.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return T.defined(i)&&Y.is(i.range)&&(T.undefined(i.command)||Yn.is(i.command))}t.is=n})(Ec||(Ec={}));var Ac;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return T.defined(i)&&T.uinteger(i.tabSize)&&T.boolean(i.insertSpaces)}t.is=n})(Ac||(Ac={}));var Sc;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return T.defined(i)&&Y.is(i.range)&&(T.undefined(i.target)||T.string(i.target))}t.is=n})(Sc||(Sc={}));var kc;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return T.objectLiteral(i)&&Y.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(kc||(kc={}));var Cc;(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"})(Cc||(Cc={}));var Nc;(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"})(Nc||(Nc={}));var wc;(function(t){function e(n){const r=n;return T.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(wc||(wc={}));var bc;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Y.is(i.range)&&T.string(i.text)}t.is=n})(bc||(bc={}));var _c;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Y.is(i.range)&&T.boolean(i.caseSensitiveLookup)&&(T.string(i.variableName)||i.variableName===void 0)}t.is=n})(_c||(_c={}));var Ic;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Y.is(i.range)&&(T.string(i.expression)||i.expression===void 0)}t.is=n})(Ic||(Ic={}));var $c;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return T.defined(i)&&Y.is(r.stoppedLocation)}t.is=n})($c||($c={}));var da;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(da||(da={}));var fa;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&(i.tooltip===void 0||T.string(i.tooltip)||Lr.is(i.tooltip))&&(i.location===void 0||Pi.is(i.location))&&(i.command===void 0||Yn.is(i.command))}t.is=n})(fa||(fa={}));var Pc;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return T.objectLiteral(i)&&ee.is(i.position)&&(T.string(i.label)||T.typedArray(i.label,fa.is))&&(i.kind===void 0||da.is(i.kind))&&i.textEdits===void 0||T.typedArray(i.textEdits,Ut.is)&&(i.tooltip===void 0||T.string(i.tooltip)||Lr.is(i.tooltip))&&(i.paddingLeft===void 0||T.boolean(i.paddingLeft))&&(i.paddingRight===void 0||T.boolean(i.paddingRight))}t.is=n})(Pc||(Pc={}));var Lc;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Lc||(Lc={}));var Oc;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(Oc||(Oc={}));var xc;(function(t){function e(n){return{items:n}}t.create=e})(xc||(xc={}));var Dc;(function(t){t.Invoked=0,t.Automatic=1})(Dc||(Dc={}));var Mc;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(Mc||(Mc={}));var Fc;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(Fc||(Fc={}));var Gc;(function(t){function e(n){const r=n;return T.objectLiteral(r)&&aa.is(r.uri)&&T.string(r.name)}t.is=e})(Gc||(Gc={}));const dR=[`
|
|
117
|
+
`,`\r
|
|
118
|
+
`,"\r"];var Uc;(function(t){function e(s,a,o,c){return new fR(s,a,o,c)}t.create=e;function n(s){let a=s;return!!(T.defined(a)&&T.string(a.uri)&&(T.undefined(a.languageId)||T.string(a.languageId))&&T.uinteger(a.lineCount)&&T.func(a.getText)&&T.func(a.positionAt)&&T.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),c=i(a,(d,h)=>{let p=d.range.start.line-h.range.start.line;return p===0?d.range.start.character-h.range.start.character:p}),l=o.length;for(let d=c.length-1;d>=0;d--){let h=c[d],p=s.offsetAt(h.range.start),R=s.offsetAt(h.range.end);if(R<=l)o=o.substring(0,p)+h.newText+o.substring(R,o.length);else throw new Error("Overlapping edit");l=p}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,c=s.slice(0,o),l=s.slice(o);i(c,a),i(l,a);let d=0,h=0,p=0;for(;d<c.length&&h<l.length;)a(c[d],l[h])<=0?s[p++]=c[d++]:s[p++]=l[h++];for(;d<c.length;)s[p++]=c[d++];for(;h<l.length;)s[p++]=l[h++];return s}})(Uc||(Uc={}));let fR=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
119
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
120
|
+
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ee.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return ee.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var T;(function(t){const e=Object.prototype.toString;function n(R){return typeof R<"u"}t.defined=n;function r(R){return typeof R>"u"}t.undefined=r;function i(R){return R===!0||R===!1}t.boolean=i;function s(R){return e.call(R)==="[object String]"}t.string=s;function a(R){return e.call(R)==="[object Number]"}t.number=a;function o(R,k,_){return e.call(R)==="[object Number]"&&k<=R&&R<=_}t.numberRange=o;function c(R){return e.call(R)==="[object Number]"&&-2147483648<=R&&R<=2147483647}t.integer=c;function l(R){return e.call(R)==="[object Number]"&&0<=R&&R<=2147483647}t.uinteger=l;function d(R){return e.call(R)==="[object Function]"}t.func=d;function h(R){return R!==null&&typeof R=="object"}t.objectLiteral=h;function p(R,k){return Array.isArray(R)&&R.every(k)}t.typedArray=p})(T||(T={}));const hR=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Jt},get ChangeAnnotation(){return Bn},get ChangeAnnotationIdentifier(){return je},get CodeAction(){return vc},get CodeActionContext(){return Rc},get CodeActionKind(){return Tc},get CodeActionTriggerKind(){return Mi},get CodeDescription(){return Xo},get CodeLens(){return Ec},get Color(){return oa},get ColorInformation(){return qo},get ColorPresentation(){return Wo},get Command(){return Yn},get CompletionItem(){return ac},get CompletionItemKind(){return ec},get CompletionItemLabelDetails(){return sc},get CompletionItemTag(){return nc},get CompletionList(){return oc},get CreateFile(){return Ir},get DeleteFile(){return Pr},get Diagnostic(){return Li},get DiagnosticRelatedInformation(){return ca},get DiagnosticSeverity(){return Ho},get DiagnosticTag(){return Yo},get DocumentHighlight(){return fc},get DocumentHighlightKind(){return dc},get DocumentLink(){return Sc},get DocumentSymbol(){return yc},get DocumentUri(){return jo},EOL:dR,get FoldingRange(){return Ko},get FoldingRangeKind(){return Vo},get FormattingOptions(){return Ac},get Hover(){return cc},get InlayHint(){return Pc},get InlayHintKind(){return da},get InlayHintLabelPart(){return fa},get InlineCompletionContext(){return Fc},get InlineCompletionItem(){return Oc},get InlineCompletionList(){return xc},get InlineCompletionTriggerKind(){return Dc},get InlineValueContext(){return $c},get InlineValueEvaluatableExpression(){return Ic},get InlineValueText(){return bc},get InlineValueVariableLookup(){return _c},get InsertReplaceEdit(){return rc},get InsertTextFormat(){return tc},get InsertTextMode(){return ic},get Location(){return Pi},get LocationLink(){return Bo},get MarkedString(){return Di},get MarkupContent(){return Lr},get MarkupKind(){return ua},get OptionalVersionedTextDocumentIdentifier(){return xi},get ParameterInformation(){return lc},get Position(){return ee},get Range(){return Y},get RenameFile(){return $r},get SelectedCompletionInfo(){return Mc},get SelectionRange(){return kc},get SemanticTokenModifiers(){return Nc},get SemanticTokenTypes(){return Cc},get SemanticTokens(){return wc},get SignatureInformation(){return uc},get StringValue(){return Lc},get SymbolInformation(){return mc},get SymbolKind(){return hc},get SymbolTag(){return pc},get TextDocument(){return Uc},get TextDocumentEdit(){return Oi},get TextDocumentIdentifier(){return Jo},get TextDocumentItem(){return Zo},get TextEdit(){return Ut},get URI(){return aa},get VersionedTextDocumentIdentifier(){return Qo},WorkspaceChange:uR,get WorkspaceEdit(){return la},get WorkspaceFolder(){return Gc},get WorkspaceSymbol(){return gc},get integer(){return zo},get uinteger(){return $i}},Symbol.toStringTag,{value:"Module"}));class pR{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Mh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new Pl;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new jc(e.startOffset,e.image.length,_o(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new jc(s.startOffset,s.image.length,_o(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class Dh{get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}}class jc extends Dh{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,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class Pl extends Dh{constructor(){super(...arguments),this.content=new Ll(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:ee.create(0,0),end:ee.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 n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class Ll extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Ll.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class Mh extends Pl{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const zc=Symbol("Datatype");function co(t){return t.$type===zc}const Iu="",Fh=t=>t.endsWith(Iu)?t:t+Iu;class Gh{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new RR(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new jh(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}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 mR extends Gh{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new pR,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,n){const r=this.computeRuleType(e);let i;Ks(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(Fh(e.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(e.name,s),on(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const n=e.name,r=new Map;for(let i=0;i<e.operators.precedences.length;i++){const s=e.operators.precedences[i];for(const a of s.operators)r.set(a.value,{precedence:i,rightAssoc:s.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(e){return Ks(e)?Ii(e):e.fragment?void 0:qf(e)?zc:Ii(e)}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Eo(s,{deep:!0}),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(e){let n=this.wrapper.rule(e);if(this.stack.length>0&&(n=this.construct()),n===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 n}startImplementation(e,n,r){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===zc?a.value="":n!==void 0&&(a.$infixName=n)}return r(i),s?this.construct():void 0}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,crossRef:c}=this.getAssignment(r),l=this.current;if(o){const d=Vn(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,d,a,c)}else if(co(l)){let d=i.image;Vn(r)||(d=this.converter.convert(d,a).toString()),l.value+=d}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,n,s)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,n,r){const{assignment:i,crossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(co(a))a.value+=e.toString();else if(typeof e=="object"&&e){const c=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(c)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode)}else r.$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)):co(e)?this.converter.convert(e.value,e.$cstNode):(Am(this.astReflection,e),e)}constructInfix(e,n){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const i=e.operators;if(!Array.isArray(i)||r.length<2)return r[0];let s=0,a=-1;for(let _=0;_<i.length;_++){const M=i[_],N=n.get(M)??{precedence:1/0,rightAssoc:!1};N.precedence>a?(a=N.precedence,s=_):N.precedence===a&&(N.rightAssoc||(s=_))}const o=i.slice(0,s),c=i.slice(s+1),l=r.slice(0,s+1),d=r.slice(s+1),h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:d,operators:c},R=this.constructInfix(h,n),k=this.constructInfix(p,n);return{$type:e.$type,$cstNode:e.$cstNode,left:R,operator:i[s],right:k}}getAssignment(e){if(!this.assignmentMap.has(e)){const n=ka(e,Wn);this.assignmentMap.set(e,{assignment:n,crossRef:n&&Na(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s==="single"&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):s==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class gR{buildMismatchTokenMessage(e){return kr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return kr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return kr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return kr.buildEarlyExitMessage(e)}}class Uh extends gR{buildMismatchTokenMessage({expected:e,actual:n}){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 \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class yR extends Gh{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.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,n){const r=this.wrapper.DEFINE_RULE(Fh(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}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,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const TR={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Uh};class jh extends ST{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,{...TR,lookaheadStrategy:r?new Nl({maxLookahead:n.maxLookahead}):new qT({logging:n.skipValidations?()=>{}:void 0}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n,r){return this.RULE(e,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n,void 0)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}rule(e){return e.call(this,{})}}class RR extends jh{constructor(e,n,r){super(e,n),this.task=r}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,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(e,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}}function zh(t,e,n){return vR({parser:e,tokens:n,ruleNames:new Map},t),e}function vR(t,e){const n=Gf(e,!1),r=fe(e.rules).filter(on).filter(s=>n.has(s));for(const s of r){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Xn(a,s.definition))}const i=fe(e.rules).filter(Ks).filter(s=>n.has(s));for(const s of i)t.parser.rule(s,ER(t,s))}function ER(t,e){const n=e.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(cn(n))throw new Error("Cannot use terminal rule in infix expression");const r=e.operators.precedences.flatMap(R=>R.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const c={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},l={...s,$container:a};a.elements.push(c,l);const h=r.map(R=>t.tokens[R.value]).map((R,k)=>({ALT:()=>t.parser.consume(k,R,c)}));let p;return R=>{p??(p=Ol(t,n)),t.parser.subrule(0,p,!1,s,R),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,h),t.parser.subrule(1,p,!1,l,R)}})}}function Xn(t,e,n=!1){let r;if(Vn(e))r=bR(t,e);else if(Ca(e))r=AR(t,e);else if(Wn(e))r=Xn(t,e.terminal);else if(Na(e))r=Bh(t,e);else if(Kn(e))r=SR(t,e);else if(Pf(e))r=CR(t,e);else if(Of(e))r=NR(t,e);else if(Tl(e))r=wR(t,e);else if(bm(e)){const i=t.consume++;r=()=>t.parser.consume(i,An,e)}else throw new Df(e.$cstNode,`Unexpected element type: ${e.$type}`);return qh(t,n?void 0:ha(e),r,e.cardinality)}function AR(t,e){const n=Ii(e);return()=>t.parser.action(n,e)}function SR(t,e){const n=e.rule.ref;if(Vi(n)){const r=t.subrule++,i=on(n)&&n.fragment,s=e.arguments.length>0?kR(n,e.arguments):()=>({});let a;return o=>{a??(a=Ol(t,n)),t.parser.subrule(r,a,i,e,s(o))}}else if(cn(n)){const r=t.consume++,i=Bc(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Ki();else throw new Df(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function kR(t,e){if(e.some(r=>r.calledByName)){const r=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:Ft(i.value)}));return i=>{const s={};for(const{parameterName:a,predicate:o}of r)a&&(s[a]=o(i));return s}}else{const r=e.map(i=>Ft(i.value));return i=>{const s={};for(let a=0;a<r.length;a++)if(a<t.parameters.length){const o=t.parameters[a].name,c=r[a];s[o]=c(i)}return s}}}function Ft(t){if(wm(t)){const e=Ft(t.left),n=Ft(t.right);return r=>e(r)||n(r)}else if(Nm(t)){const e=Ft(t.left),n=Ft(t.right);return r=>e(r)&&n(r)}else if($m(t)){const e=Ft(t.value);return n=>!e(n)}else if(Pm(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(km(t)){const e=!!t.true;return()=>e}Ki()}function CR(t,e){if(e.elements.length===1)return Xn(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Xn(t,i,!0)},a=ha(i);a&&(s.GATE=Ft(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function NR(t,e){if(e.elements.length===1)return Xn(t,e.elements[0]);const n=[];for(const o of e.elements){const c={ALT:Xn(t,o,!0)},l=ha(o);l&&(c.GATE=Ft(l)),n.push(c)}const r=t.or++,i=(o,c)=>{const l=c.getRuleStack().join("-");return`uGroup_${o}_${l}`},s=o=>t.parser.alternatives(r,n.map((c,l)=>{const d={ALT:()=>!0},h=t.parser;d.ALT=()=>{if(c.ALT(o),!h.isRecording()){const R=i(r,h);h.unorderedGroups.get(R)||h.unorderedGroups.set(R,[]);const k=h.unorderedGroups.get(R);typeof k?.[l]>"u"&&(k[l]=!0)}};const p=c.GATE;return p?d.GATE=()=>p(o):d.GATE=()=>!h.unorderedGroups.get(i(r,h))?.[l],d})),a=qh(t,ha(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function wR(t,e){const n=e.elements.map(r=>Xn(t,r));return r=>n.forEach(i=>i(r))}function ha(t){if(Tl(t))return t.guardCondition}function Bh(t,e,n=e.terminal){if(n)if(Kn(n)&&on(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;let s;return a=>{s??(s=Ol(t,r)),t.parser.subrule(i,s,!1,e,a)}}else if(Kn(n)&&cn(n.rule.ref)){const r=t.consume++,i=Bc(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Vn(n)){const r=t.consume++,i=Bc(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const i=zf(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Ii(e.type.ref));return Bh(t,e,i)}}function bR(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function qh(t,e,n,r){const i=e&&Ft(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:Cu(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:Cu(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else Ki()}function Ol(t,e){const n=_R(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function _R(t,e){if(Vi(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!on(r);)(Tl(r)||Pf(r)||Of(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function Bc(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function IR(t){const e=t.Grammar,n=t.parser.Lexer,r=new yR(t);return zh(e,r,n.definition),r.finalize(),r}function $R(t){const e=PR(t);return e.finalize(),e}function PR(t){const e=t.Grammar,n=t.parser.Lexer,r=new mR(t);return zh(e,r,n.definition)}class Wh{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=fe(Gf(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(cn).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=vl(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Ff(n)?rt.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(Vi).flatMap(i=>Wi(i).filter(Vn)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(ba(e.value),"i"):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&ng("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Vh{convert(e,n){let r=n.grammarSource;if(Na(r)&&(r=ag(r)),Kn(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){switch(e.name.toUpperCase()){case"INT":return Ht.convertInt(n);case"STRING":return Ht.convertString(n);case"ID":return Ht.convertID(n)}switch(hg(e)?.toLowerCase()){case"number":return Ht.convertNumber(n);case"boolean":return Ht.convertBoolean(n);case"bigint":return Ht.convertBigint(n);case"date":return Ht.convertDate(n);default:return n}}}var Ht;(function(t){function e(l){let d="";for(let h=1;h<l.length-1;h++){const p=l.charAt(h);if(p==="\\"){const R=l.charAt(++h);d+=n(R)}else d+=p}return d}t.convertString=e;function n(l){switch(l){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 l}}function r(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=r;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function a(l){return new Date(l)}t.convertDate=a;function o(l){return Number(l)}t.convertNumber=o;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(Ht||(Ht={}));var kn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});let qc;function Wc(){if(qc===void 0)throw new Error("No runtime abstraction layer installed");return qc}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");qc=n}t.install=e})(Wc||(Wc={}));ln.default=Wc;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.stringArray=Ie.array=Ie.func=Ie.error=Ie.number=Ie.string=Ie.boolean=void 0;function LR(t){return t===!0||t===!1}Ie.boolean=LR;function Kh(t){return typeof t=="string"||t instanceof String}Ie.string=Kh;function OR(t){return typeof t=="number"||t instanceof Number}Ie.number=OR;function xR(t){return t instanceof Error}Ie.error=xR;function DR(t){return typeof t=="function"}Ie.func=DR;function Hh(t){return Array.isArray(t)}Ie.array=Hh;function MR(t){return Hh(t)&&t.every(e=>Kh(e))}Ie.stringArray=MR;var jt={};Object.defineProperty(jt,"__esModule",{value:!0});var Yh=jt.Emitter=jt.Event=void 0;const FR=ln;var $u;(function(t){const e={dispose(){}};t.None=function(){return e}})($u||(jt.Event=$u={}));class GR{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)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 n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=r.length;s<a;s++)try{n.push(r[s].apply(i[s],e))}catch(o){(0,FR.default)().console.error(o)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class Da{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new GR),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=Da._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.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)}}Yh=jt.Emitter=Da;Da._noop=function(){};var pe;Object.defineProperty(kn,"__esModule",{value:!0});var xl=kn.CancellationTokenSource=pe=kn.CancellationToken=void 0;const UR=ln,jR=Ie,Vc=jt;var pa;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Vc.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Vc.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||jR.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(pa||(pe=kn.CancellationToken=pa={}));const zR=Object.freeze(function(t,e){const n=(0,UR.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class Pu{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?zR:(this._emitter||(this._emitter=new Vc.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class BR{get token(){return this._token||(this._token=new Pu),this._token}cancel(){this._token?this._token.cancel():this._token=pa.Cancelled}dispose(){this._token?this._token instanceof Pu&&this._token.dispose():this._token=pa.None}}xl=kn.CancellationTokenSource=BR;function qR(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let zs=0,WR=10;function VR(){return zs=performance.now(),new xl}const Cr=Symbol("OperationCancelled");function Ma(t){return t===Cr}async function Je(t){if(t===pe.None)return;const e=performance.now();if(e-zs>=WR&&(zs=e,await qR(),zs=performance.now()),t.isCancellationRequested)throw Cr}class Dl{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Fi{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(Fi.isIncremental(r)){const i=Jh(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let l=this._lineOffsets;const d=Lu(r.text,!1,s);if(c-o===d.length)for(let p=0,R=d.length;p<R;p++)l[p+o+1]=d[p];else d.length<1e4?l.splice(o+1,c-o,...d):this._lineOffsets=l=l.slice(0,o+1).concat(d,l.slice(c+1));const h=r.text.length-(a-s);if(h!==0)for(let p=o+1+d.length,R=l.length;p<R;p++)l[p]=l[p]+h}else if(Fi.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Lu(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){const a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&Xh(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Kc;(function(t){function e(i,s,a,o){return new Fi(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof Fi)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const a=i.getText(),o=Hc(s.map(KR),(d,h)=>{const p=d.range.start.line-h.range.start.line;return p===0?d.range.start.character-h.range.start.character:p});let c=0;const l=[];for(const d of o){const h=i.offsetAt(d.range.start);if(h<c)throw new Error("Overlapping edit");h>c&&l.push(a.substring(c,h)),d.newText.length&&l.push(d.newText),c=i.offsetAt(d.range.end)}return l.push(a.substr(c)),l.join("")}t.applyEdits=r})(Kc||(Kc={}));function Hc(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Hc(r,e),Hc(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function Lu(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);Xh(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function Xh(t){return t===13||t===10}function Jh(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function KR(t){const e=Jh(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Qh;(()=>{var t={975:C=>{function v(m){if(typeof m!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(m))}function g(m,y){for(var E,$="",x=0,P=-1,z=0,G=0;G<=m.length;++G){if(G<m.length)E=m.charCodeAt(G);else{if(E===47)break;E=47}if(E===47){if(!(P===G-1||z===1))if(P!==G-1&&z===2){if($.length<2||x!==2||$.charCodeAt($.length-1)!==46||$.charCodeAt($.length-2)!==46){if($.length>2){var se=$.lastIndexOf("/");if(se!==$.length-1){se===-1?($="",x=0):x=($=$.slice(0,se)).length-1-$.lastIndexOf("/"),P=G,z=0;continue}}else if($.length===2||$.length===1){$="",x=0,P=G,z=0;continue}}y&&($.length>0?$+="/..":$="..",x=2)}else $.length>0?$+="/"+m.slice(P+1,G):$=m.slice(P+1,G),x=G-P-1;P=G,z=0}else E===46&&z!==-1?++z:z=-1}return $}var S={resolve:function(){for(var m,y="",E=!1,$=arguments.length-1;$>=-1&&!E;$--){var x;$>=0?x=arguments[$]:(m===void 0&&(m=process.cwd()),x=m),v(x),x.length!==0&&(y=x+"/"+y,E=x.charCodeAt(0)===47)}return y=g(y,!E),E?y.length>0?"/"+y:"/":y.length>0?y:"."},normalize:function(m){if(v(m),m.length===0)return".";var y=m.charCodeAt(0)===47,E=m.charCodeAt(m.length-1)===47;return(m=g(m,!y)).length!==0||y||(m="."),m.length>0&&E&&(m+="/"),y?"/"+m:m},isAbsolute:function(m){return v(m),m.length>0&&m.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var m,y=0;y<arguments.length;++y){var E=arguments[y];v(E),E.length>0&&(m===void 0?m=E:m+="/"+E)}return m===void 0?".":S.normalize(m)},relative:function(m,y){if(v(m),v(y),m===y||(m=S.resolve(m))===(y=S.resolve(y)))return"";for(var E=1;E<m.length&&m.charCodeAt(E)===47;++E);for(var $=m.length,x=$-E,P=1;P<y.length&&y.charCodeAt(P)===47;++P);for(var z=y.length-P,G=x<z?x:z,se=-1,q=0;q<=G;++q){if(q===G){if(z>G){if(y.charCodeAt(P+q)===47)return y.slice(P+q+1);if(q===0)return y.slice(P+q)}else x>G&&(m.charCodeAt(E+q)===47?se=q:q===0&&(se=0));break}var te=m.charCodeAt(E+q);if(te!==y.charCodeAt(P+q))break;te===47&&(se=q)}var De="";for(q=E+se+1;q<=$;++q)q!==$&&m.charCodeAt(q)!==47||(De.length===0?De+="..":De+="/..");return De.length>0?De+y.slice(P+se):(P+=se,y.charCodeAt(P)===47&&++P,y.slice(P))},_makeLong:function(m){return m},dirname:function(m){if(v(m),m.length===0)return".";for(var y=m.charCodeAt(0),E=y===47,$=-1,x=!0,P=m.length-1;P>=1;--P)if((y=m.charCodeAt(P))===47){if(!x){$=P;break}}else x=!1;return $===-1?E?"/":".":E&&$===1?"//":m.slice(0,$)},basename:function(m,y){if(y!==void 0&&typeof y!="string")throw new TypeError('"ext" argument must be a string');v(m);var E,$=0,x=-1,P=!0;if(y!==void 0&&y.length>0&&y.length<=m.length){if(y.length===m.length&&y===m)return"";var z=y.length-1,G=-1;for(E=m.length-1;E>=0;--E){var se=m.charCodeAt(E);if(se===47){if(!P){$=E+1;break}}else G===-1&&(P=!1,G=E+1),z>=0&&(se===y.charCodeAt(z)?--z==-1&&(x=E):(z=-1,x=G))}return $===x?x=G:x===-1&&(x=m.length),m.slice($,x)}for(E=m.length-1;E>=0;--E)if(m.charCodeAt(E)===47){if(!P){$=E+1;break}}else x===-1&&(P=!1,x=E+1);return x===-1?"":m.slice($,x)},extname:function(m){v(m);for(var y=-1,E=0,$=-1,x=!0,P=0,z=m.length-1;z>=0;--z){var G=m.charCodeAt(z);if(G!==47)$===-1&&(x=!1,$=z+1),G===46?y===-1?y=z:P!==1&&(P=1):y!==-1&&(P=-1);else if(!x){E=z+1;break}}return y===-1||$===-1||P===0||P===1&&y===$-1&&y===E+1?"":m.slice(y,$)},format:function(m){if(m===null||typeof m!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof m);return function(y,E){var $=E.dir||E.root,x=E.base||(E.name||"")+(E.ext||"");return $?$===E.root?$+x:$+"/"+x:x}(0,m)},parse:function(m){v(m);var y={root:"",dir:"",base:"",ext:"",name:""};if(m.length===0)return y;var E,$=m.charCodeAt(0),x=$===47;x?(y.root="/",E=1):E=0;for(var P=-1,z=0,G=-1,se=!0,q=m.length-1,te=0;q>=E;--q)if(($=m.charCodeAt(q))!==47)G===-1&&(se=!1,G=q+1),$===46?P===-1?P=q:te!==1&&(te=1):P!==-1&&(te=-1);else if(!se){z=q+1;break}return P===-1||G===-1||te===0||te===1&&P===G-1&&P===z+1?G!==-1&&(y.base=y.name=z===0&&x?m.slice(1,G):m.slice(z,G)):(z===0&&x?(y.name=m.slice(1,P),y.base=m.slice(1,G)):(y.name=m.slice(z,P),y.base=m.slice(z,G)),y.ext=m.slice(P,G)),z>0?y.dir=m.slice(0,z-1):x&&(y.dir="/"),y},sep:"/",delimiter:":",win32:null,posix:null};S.posix=S,C.exports=S}},e={};function n(C){var v=e[C];if(v!==void 0)return v.exports;var g=e[C]={exports:{}};return t[C](g,g.exports,n),g.exports}n.d=(C,v)=>{for(var g in v)n.o(v,g)&&!n.o(C,g)&&Object.defineProperty(C,g,{enumerable:!0,get:v[g]})},n.o=(C,v)=>Object.prototype.hasOwnProperty.call(C,v),n.r=C=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>p,Utils:()=>Se}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function c(C,v){if(!C.scheme&&v)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!s.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!a.test(C.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(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",d="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{static isUri(v){return v instanceof p||!!v&&typeof v.authority=="string"&&typeof v.fragment=="string"&&typeof v.path=="string"&&typeof v.query=="string"&&typeof v.scheme=="string"&&typeof v.fsPath=="string"&&typeof v.with=="function"&&typeof v.toString=="function"}scheme;authority;path;query;fragment;constructor(v,g,S,m,y,E=!1){typeof v=="object"?(this.scheme=v.scheme||l,this.authority=v.authority||l,this.path=v.path||l,this.query=v.query||l,this.fragment=v.fragment||l):(this.scheme=function($,x){return $||x?$:"file"}(v,E),this.authority=g||l,this.path=function($,x){switch($){case"https":case"http":case"file":x?x[0]!==d&&(x=d+x):x=d}return x}(this.scheme,S||l),this.query=m||l,this.fragment=y||l,c(this,E))}get fsPath(){return L(this)}with(v){if(!v)return this;let{scheme:g,authority:S,path:m,query:y,fragment:E}=v;return g===void 0?g=this.scheme:g===null&&(g=l),S===void 0?S=this.authority:S===null&&(S=l),m===void 0?m=this.path:m===null&&(m=l),y===void 0?y=this.query:y===null&&(y=l),E===void 0?E=this.fragment:E===null&&(E=l),g===this.scheme&&S===this.authority&&m===this.path&&y===this.query&&E===this.fragment?this:new k(g,S,m,y,E)}static parse(v,g=!1){const S=h.exec(v);return S?new k(S[2]||l,re(S[4]||l),re(S[5]||l),re(S[7]||l),re(S[9]||l),g):new k(l,l,l,l,l)}static file(v){let g=l;if(i&&(v=v.replace(/\\/g,d)),v[0]===d&&v[1]===d){const S=v.indexOf(d,2);S===-1?(g=v.substring(2),v=d):(g=v.substring(2,S),v=v.substring(S)||d)}return new k("file",g,v,l,l)}static from(v){const g=new k(v.scheme,v.authority,v.path,v.query,v.fragment);return c(g,!0),g}toString(v=!1){return w(this,v)}toJSON(){return this}static revive(v){if(v){if(v instanceof p)return v;{const g=new k(v);return g._formatted=v.external,g._fsPath=v._sep===R?v.fsPath:null,g}}return v}}const R=i?1:void 0;class k extends p{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this)),this._fsPath}toString(v=!1){return v?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){const v={$mid:1};return this._fsPath&&(v.fsPath=this._fsPath,v._sep=R),this._formatted&&(v.external=this._formatted),this.path&&(v.path=this.path),this.scheme&&(v.scheme=this.scheme),this.authority&&(v.authority=this.authority),this.query&&(v.query=this.query),this.fragment&&(v.fragment=this.fragment),v}}const _={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 M(C,v,g){let S,m=-1;for(let y=0;y<C.length;y++){const E=C.charCodeAt(y);if(E>=97&&E<=122||E>=65&&E<=90||E>=48&&E<=57||E===45||E===46||E===95||E===126||v&&E===47||g&&E===91||g&&E===93||g&&E===58)m!==-1&&(S+=encodeURIComponent(C.substring(m,y)),m=-1),S!==void 0&&(S+=C.charAt(y));else{S===void 0&&(S=C.substr(0,y));const $=_[E];$!==void 0?(m!==-1&&(S+=encodeURIComponent(C.substring(m,y)),m=-1),S+=$):m===-1&&(m=y)}}return m!==-1&&(S+=encodeURIComponent(C.substring(m))),S!==void 0?S:C}function N(C){let v;for(let g=0;g<C.length;g++){const S=C.charCodeAt(g);S===35||S===63?(v===void 0&&(v=C.substr(0,g)),v+=_[S]):v!==void 0&&(v+=C[g])}return v!==void 0?v:C}function L(C,v){let g;return g=C.authority&&C.path.length>1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(g=g.replace(/\//g,"\\")),g}function w(C,v){const g=v?N:M;let S="",{scheme:m,authority:y,path:E,query:$,fragment:x}=C;if(m&&(S+=m,S+=":"),(y||m==="file")&&(S+=d,S+=d),y){let P=y.indexOf("@");if(P!==-1){const z=y.substr(0,P);y=y.substr(P+1),P=z.lastIndexOf(":"),P===-1?S+=g(z,!1,!1):(S+=g(z.substr(0,P),!1,!1),S+=":",S+=g(z.substr(P+1),!1,!0)),S+="@"}y=y.toLowerCase(),P=y.lastIndexOf(":"),P===-1?S+=g(y,!1,!0):(S+=g(y.substr(0,P),!1,!0),S+=y.substr(P))}if(E){if(E.length>=3&&E.charCodeAt(0)===47&&E.charCodeAt(2)===58){const P=E.charCodeAt(1);P>=65&&P<=90&&(E=`/${String.fromCharCode(P+32)}:${E.substr(3)}`)}else if(E.length>=2&&E.charCodeAt(1)===58){const P=E.charCodeAt(0);P>=65&&P<=90&&(E=`${String.fromCharCode(P+32)}:${E.substr(2)}`)}S+=g(E,!0,!1)}return $&&(S+="?",S+=g($,!1,!1)),x&&(S+="#",S+=v?x:M(x,!1,!1)),S}function O(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+O(C.substr(3)):C}}const J=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function re(C){return C.match(J)?C.replace(J,v=>O(v)):C}var ie=n(975);const we=ie.posix||ie,$e="/";var Se;(function(C){C.joinPath=function(v,...g){return v.with({path:we.join(v.path,...g)})},C.resolvePath=function(v,...g){let S=v.path,m=!1;S[0]!==$e&&(S=$e+S,m=!0);let y=we.resolve(S,...g);return m&&y[0]===$e&&!v.authority&&(y=y.substring(1)),v.with({path:y})},C.dirname=function(v){if(v.path.length===0||v.path===$e)return v;let g=we.dirname(v.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),v.with({path:g})},C.basename=function(v){return we.basename(v.path)},C.extname=function(v){return we.extname(v.path)}})(Se||(Se={})),Qh=r})();const{URI:It,Utils:hi}=Qh;var dt;(function(t){t.basename=hi.basename,t.dirname=hi.dirname,t.extname=hi.extname,t.joinPath=hi.joinPath,t.resolvePath=hi.resolvePath;const e=typeof process=="object"&&process?.platform==="win32";function n(a,o){return a?.toString()===o?.toString()}t.equals=n;function r(a,o){const c=typeof a=="string"?It.parse(a).path:a.path,l=typeof o=="string"?It.parse(o).path:o.path,d=c.split("/").filter(_=>_.length>0),h=l.split("/").filter(_=>_.length>0);if(e){const _=/^[A-Z]:$/;if(d[0]&&_.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]&&_.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]!==h[0])return l.substring(1)}let p=0;for(;p<d.length&&d[p]===h[p];p++);const R="../".repeat(d.length-p),k=h.slice(p).join("/");return R+k}t.relative=r;function i(a){return It.parse(a.toString()).toString()}t.normalize=i;function s(a,o){let c=typeof a=="string"?a:a.path,l=typeof o=="string"?o:o.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=s})(dt||(dt={}));class HR{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return dt.normalize(e)}clear(){this.root.children.clear()}insert(e,n){const r=this.getNode(this.normalizeUri(e),!0);r.element=n}delete(e){const n=this.getNode(this.normalizeUri(e),!1);n?.parent&&n.parent.children.delete(n.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);if(r)return{name:r.name,uri:dt.joinPath(It.parse(n),r.name).toString(),element:r.element}}findChildren(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:dt.joinPath(It.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const n=this.getNode(dt.normalize(e),!1);return n?this.collectValues(n):[]}getNode(e,n){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let i=this.root;for(const s of r){let a=i.children.get(s);if(!a)if(n)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const n=[];e.element&&n.push(e.element);for(const r of e.children.values())n.push(...this.collectValues(r));return n}}var K;(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"})(K||(K={}));class YR{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=pe.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??It.parse(e.uri),pe.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return pe.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:K.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:K.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){const r=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const a=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:a})}return r!==s&&(e.parseResult=await this.parseAsync(e.uri,s,n),e.parseResult.value.$document=e),e.state=K.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=Kc.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class XR{constructor(e){this.documentTrie=new HR,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return fe(this.documentTrie.all())}addDocument(e){const n=e.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,e)}getDocument(e){const n=e.toString();return this.documentTrie.find(n)}getDocuments(e){const n=e.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,K.Changed),r}deleteDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&(r.state=K.Changed,this.documentTrie.delete(n)),r}deleteDocuments(e){const n=e.toString(),r=this.documentTrie.findAll(n);for(const i of r)i.state=K.Changed;return this.documentTrie.delete(n),r}}const ar=Symbol("RefResolving");class JR{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,n=pe.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const i of Zt(e.parseResult.value))await Je(n),Vs(i).forEach(s=>{const a=`${i.$type}:${s.property}`;r.startSubTask(a);try{this.doLink(s,e)}finally{r.stopSubTask(a)}})}finally{r.stop()}}else for(const r of Zt(e.parseResult.value))await Je(n),Vs(r).forEach(i=>this.doLink(i,e))}doLink(e,n){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=ar;try{const i=this.getCandidate(e);if(oi(i))r._ref=i;else{r._nodeDescription=i;const s=this.loadAstNode(i);r._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);const s=i.message??String(i);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${s}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=ar;try{const i=this.getCandidates(e),s=[];if(oi(i))r._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}r._items=s}catch(i){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(e){for(const n of e.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_ref:void 0,get ref(){if(Ke(this._ref))return this._ref;if(vm(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=ar;const o=Is(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&o&&o.state<K.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,o?.references.push(this)}else this._ref===ar&&s.throwCyclicReferenceError(e,n,i);return Ke(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return oi(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=ar;const o=Is(e).$document,c=s.getCandidates({reference:a,container:e,property:n}),l=[];if(oi(c))this._linkingError=c;else for(const d of c){const h=s.loadAstNode(d);h&&l.push({ref:h,$nodeDescription:d})}this._items=l,o?.references.push(this)}else this._items===ar&&s.throwCyclicReferenceError(e,n,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:n})}};return a}throwCyclicReferenceError(e,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${r}')`)}getLinkedNode(e){try{const n=this.getCandidate(e);if(oi(n))return{error:n};const r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const r=n.message??String(n);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Is(e.container).$document;r&&r.state<K.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n}}}function QR(t){return typeof t.name=="string"}class ZR{getName(e){if(QR(e))return e.name}getNameNode(e){return jf(e.$cstNode,"name")}}class ev{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(n=>Na(n)&&n.isMulti)}findDeclarations(e){if(e){const n=dg(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(wt(i)||hn(i))return Wl(i);if(Array.isArray(i)){for(const s of i)if((wt(s)||hn(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return Wl(s)}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||zm(e,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(const i of Vs(r))if(hn(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const n=this.documents.getDocument(e.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const n=this.findDeclarations(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&r.push(s)}return r}findReferences(e,n){const r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>dt.equals(s.sourceUri,n.documentUri))),r.push(...i),fe(r)}getSelfReferences(e){const n=this.getSelfNodes(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i);if(s){const a=Qt(i),o=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:Hs(s),local:!0})}}return r}}class Gi{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return vo.sum(fe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const n=this.map.get(e);return n?fe(n):If}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return fe(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return fe(this.map.keys())}values(){return fe(this.map.values()).flat()}entriesGroupedByKey(){return fe(this.map.entries())}}class Ou{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class tv{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,n=pe.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,n)}async collectExportedSymbolsForNode(e,n,r=yl,i=pe.None){const s=[];this.addExportedSymbol(e,s,n);for(const a of r(e))await Je(i),this.addExportedSymbol(a,s,n);return s}addExportedSymbol(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async collectLocalSymbols(e,n=pe.None){const r=e.parseResult.value,i=new Gi;for(const s of Wi(r))await Je(n),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class xu{constructor(e,n,r){this.elements=e,this.outerScope=n,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}}class nv{constructor(e,n,r){this.elements=new Gi,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?fe(r).concat(this.outerScope.getElements(e)):fe(r)}getAllElements(){let e=fe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Zh{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 rv extends Zh{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class iv extends Zh{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class sv extends rv{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class av{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 sv(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=Qt(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&n.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,r))),a=a.$container;while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new xu(fe(e),n,r)}createScopeForNodes(e,n,r){const i=fe(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new xu(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new nv(this.indexManager.allElements(e)))}}function ov(t){return typeof t.$comment=="string"}function Du(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class cv{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,n){const r=n??{},i=n?.replacer,s=(o,c)=>this.replacer(o,c,r),a=i?(o,c)=>i(o,c,s):s;try{return this.currentDocument=Qt(e),JSON.stringify(e,a,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e))if(wt(n)){const c=n.ref,l=r?n.$refText:void 0;if(c){const d=Qt(c);let h="";this.currentDocument&&this.currentDocument!==d&&(o?h=o(d.uri,c):h=d.uri.toString());const p=this.astNodeLocator.getAstNodePath(c);return{$ref:`${h}#${p}`,$refText:l}}else return{$error:n.error?.message??"Could not resolve reference",$refText:l}}else if(hn(n)){const c=r?n.$refText:void 0,l=[];for(const d of n.items){const h=d.ref,p=Qt(d.ref);let R="";this.currentDocument&&this.currentDocument!==p&&(o?R=o(p.uri,h):R=p.uri.toString());const k=this.astNodeLocator.getAstNodePath(h);l.push(`${R}#${k}`)}return{$refs:l,$refText:c}}else if(Ke(n)){let c;if(s&&(c=this.addAstNodeRegionWithAssignmentsTo({...n}),(!e||n.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...n}),c.$sourceText=n.$cstNode?.text),a){c??(c={...n});const l=this.commentProvider.getComment(n);l&&(c.$comment=l.replace(/\r/g,""))}return c??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=cg(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let d=0;d<l.length;d++){const h=l[d];Du(h)?l[d]=this.reviveReference(e,c,n,h,r):Ke(h)&&this.linkNode(h,n,r,e,c,d)}else Du(l)?e[c]=this.reviveReference(e,c,n,l,r):Ke(l)&&this.linkNode(l,n,r,e,c);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error,c;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(Ke(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}else if(i.$refs){const l=[];for(const d of i.$refs){const h=this.getRefNode(r,d,s.uriConverter);Ke(h)&&l.push({ref:h})}if(l.length===0)c={$refText:a??"",items:l},o??(o="Could not resolve multi-reference");else return{$refText:a??"",items:l}}if(o)return c??(c={$refText:a??"",ref:void 0}),c.error={info:{container:e,property:n,reference:c},message:o},c}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):It.parse(n),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):It.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class lv{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);if(n.fileNames)for(const r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,e);this.languageIdMap.set(n.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const n=this.textDocuments?.get(e)?.languageId;if(n!==void 0){const a=this.languageIdMap.get(n);if(a)return a}const r=dt.extname(e),i=dt.basename(e),s=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!s)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Si(t){return{code:t}}var Yc;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Yc||(Yc={}));class uv{constructor(e){this.entries=new Gi,this.knownCategories=new Set(Yc.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(r);for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const c={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,c)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else Ki()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Ma(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=fe(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const dv=Object.freeze({validateNode:!0,validateChildren:!0});class fv{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,n={},r=pe.None){const i=e.parseResult,s=[];if(await Je(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>a.data?.code===Nt.LexingError)||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>a.data?.code===Nt.ParsingError))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>a.data?.code===Nt.LinkingError))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(Ma(a))throw a;console.error("An error occurred during validation:",a)}return await Je(r),s}processLexingErrors(e,n,r){const i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const s of i){const a=s.severity??"error",o={severity:lo(a),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:pv(a),source:this.getSource()};n.push(o)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=_o(i.token);if(s){const a={severity:lo("error"),range:s,message:i.message,data:Si(Nt.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.info.container,range:i.$refNode?.range,property:s.info.property,index:s.info.index,data:{code:Nt.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};n.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,n,r=pe.None){const i=[],s=(a,o,c)=>{i.push(this.toDiagnostic(a,o,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=pe.None){const s=this.validationRegistry.checksBefore;for(const a of s)await Je(i),await a(e,r,n.categories??[],i)}async validateAstNodes(e,n,r,i=pe.None){if(this.profiler?.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const a=Zt(e).iterator();for(const o of a){s.startSubTask(o.$type);const c=this.validateSingleNodeOptions(o,n);if(c.validateNode)try{const l=this.validationRegistry.getChecks(o.$type,n.categories);for(const d of l)await d(o,r,i)}finally{s.stopSubTask(o.$type)}c.validateChildren||a.prune()}}finally{s.stop()}}else{const s=Zt(e).iterator();for(const a of s){await Je(i);const o=this.validateSingleNodeOptions(a,n);if(o.validateNode){const c=this.validationRegistry.getChecks(a.$type,n.categories);for(const l of c)await l(a,r,i)}o.validateChildren||s.prune()}}}validateSingleNodeOptions(e,n){return dv}async validateAstAfter(e,n,r,i=pe.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Je(i),await a(e,r,n.categories??[],i)}toDiagnostic(e,n,r){return{message:n,range:hv(r),severity:lo(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function hv(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=jf(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=lg(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 lo(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 pv(t){switch(t){case"error":return Si(Nt.LexingError);case"warning":return Si(Nt.LexingWarning);case"info":return Si(Nt.LexingInfo);case"hint":return Si(Nt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Nt;(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"})(Nt||(Nt={}));class mv{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??Qt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>a??(a=Hs(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:n,get nameSegment(){return o()},selectionSegment:Hs(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class gv{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=pe.None){const r=[],i=e.parseResult.value;for(const s of Zt(i))await Je(n),Vs(s).forEach(a=>{a.reference.error||r.push(...this.createInfoDescriptions(a))});return r}createInfoDescriptions(e){const n=e.reference;if(n.error||!n.$refNode)return[];let r=[];wt(n)&&n.$nodeDescription?r=[n.$nodeDescription]:hn(n)&&(r=n.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));const i=Qt(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=Hs(n.$refNode);for(const c of r)a.push({sourceUri:i,sourcePath:s,targetUri:c.documentUri,targetPath:c.path,segment:o,local:dt.equals(c.documentUri,i)});return a}}class yv{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),c=parseInt(s.substring(a+1));return i[o]?.[c]}return i[s]},e)}}class Tv{constructor(e){this._ready=new Dl,this.onConfigurationSectionUpdateEmitter=new Yh,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var ki={},Zn={},Ml={},ma={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.Message=U.NotificationType9=U.NotificationType8=U.NotificationType7=U.NotificationType6=U.NotificationType5=U.NotificationType4=U.NotificationType3=U.NotificationType2=U.NotificationType1=U.NotificationType0=U.NotificationType=U.RequestType9=U.RequestType8=U.RequestType7=U.RequestType6=U.RequestType5=U.RequestType4=U.RequestType3=U.RequestType2=U.RequestType1=U.RequestType=U.RequestType0=U.AbstractMessageSignature=U.ParameterStructures=U.ResponseError=U.ErrorCodes=void 0;const Gn=Ie;var Xc;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Xc||(U.ErrorCodes=Xc={}));class Fl extends Error{constructor(e,n,r){super(n),this.code=Gn.number(e)?e:Xc.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Fl.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}U.ResponseError=Fl;class He{constructor(e){this.kind=e}static is(e){return e===He.auto||e===He.byName||e===He.byPosition}toString(){return this.kind}}U.ParameterStructures=He;He.auto=new He("auto");He.byPosition=new He("byPosition");He.byName=new He("byName");class me{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return He.auto}}U.AbstractMessageSignature=me;class Rv extends me{constructor(e){super(e,0)}}U.RequestType0=Rv;class vv extends me{constructor(e,n=He.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}U.RequestType=vv;class Ev extends me{constructor(e,n=He.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}U.RequestType1=Ev;class Av extends me{constructor(e){super(e,2)}}U.RequestType2=Av;class Sv extends me{constructor(e){super(e,3)}}U.RequestType3=Sv;class kv extends me{constructor(e){super(e,4)}}U.RequestType4=kv;class Cv extends me{constructor(e){super(e,5)}}U.RequestType5=Cv;class Nv extends me{constructor(e){super(e,6)}}U.RequestType6=Nv;class wv extends me{constructor(e){super(e,7)}}U.RequestType7=wv;class bv extends me{constructor(e){super(e,8)}}U.RequestType8=bv;class _v extends me{constructor(e){super(e,9)}}U.RequestType9=_v;class Iv extends me{constructor(e,n=He.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}U.NotificationType=Iv;class $v extends me{constructor(e){super(e,0)}}U.NotificationType0=$v;class Pv extends me{constructor(e,n=He.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}U.NotificationType1=Pv;class Lv extends me{constructor(e){super(e,2)}}U.NotificationType2=Lv;class Ov extends me{constructor(e){super(e,3)}}U.NotificationType3=Ov;class xv extends me{constructor(e){super(e,4)}}U.NotificationType4=xv;class Dv extends me{constructor(e){super(e,5)}}U.NotificationType5=Dv;class Mv extends me{constructor(e){super(e,6)}}U.NotificationType6=Mv;class Fv extends me{constructor(e){super(e,7)}}U.NotificationType7=Fv;class Gv extends me{constructor(e){super(e,8)}}U.NotificationType8=Gv;class Uv extends me{constructor(e){super(e,9)}}U.NotificationType9=Uv;var Mu;(function(t){function e(i){const s=i;return s&&Gn.string(s.method)&&(Gn.string(s.id)||Gn.number(s.id))}t.isRequest=e;function n(i){const s=i;return s&&Gn.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){const s=i;return s&&(s.result!==void 0||!!s.error)&&(Gn.string(s.id)||Gn.number(s.id)||s.id===null)}t.isResponse=r})(Mu||(U.Message=Mu={}));var tn={},Fu;Object.defineProperty(tn,"__esModule",{value:!0});tn.LRUCache=tn.LinkedMap=tn.Touch=void 0;var We;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(We||(tn.Touch=We={}));class ep{constructor(){this[Fu]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=We.None){const r=this._map.get(e);if(r)return n!==We.None&&this.touch(r,n),r.value}set(e,n,r=We.None){let i=this._map.get(e);if(i)i.value=n,r!==We.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case We.None:this.addItemLast(i);break;case We.First:this.addItemFirst(i);break;case We.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Fu=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==We.First&&n!==We.Last)){if(n===We.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===We.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}tn.LinkedMap=ep;class jv extends ep{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=We.AsNew){return super.get(e,n)}peek(e){return super.get(e,We.None)}set(e,n){return super.set(e,n,We.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}tn.LRUCache=jv;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.Disposable=void 0;var Gu;(function(t){function e(n){return{dispose:n}}t.create=e})(Gu||(Fa.Disposable=Gu={}));var Or={};Object.defineProperty(Or,"__esModule",{value:!0});Or.SharedArrayReceiverStrategy=Or.SharedArraySenderStrategy=void 0;const zv=kn;var Ui;(function(t){t.Continue=0,t.Cancelled=1})(Ui||(Ui={}));class Bv{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ui.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,Ui.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}Or.SharedArraySenderStrategy=Bv;class qv{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ui.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Wv{constructor(e){this.token=new qv(e)}cancel(){}dispose(){}}class Vv{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new zv.CancellationTokenSource:new Wv(n)}}Or.SharedArrayReceiverStrategy=Vv;var pn={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Semaphore=void 0;const Kv=ln;class Hv{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Kv.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}Zi.Semaphore=Hv;Object.defineProperty(pn,"__esModule",{value:!0});pn.ReadableStreamMessageReader=pn.AbstractMessageReader=pn.MessageReader=void 0;const Jc=ln,Tr=Ie,uo=jt,Yv=Zi;var Uu;(function(t){function e(n){let r=n;return r&&Tr.func(r.listen)&&Tr.func(r.dispose)&&Tr.func(r.onError)&&Tr.func(r.onClose)&&Tr.func(r.onPartialMessage)}t.is=e})(Uu||(pn.MessageReader=Uu={}));class tp{constructor(){this.errorEmitter=new uo.Emitter,this.closeEmitter=new uo.Emitter,this.partialMessageEmitter=new uo.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Tr.string(e.message)?e.message:"unknown"}`)}}pn.AbstractMessageReader=tp;var Qc;(function(t){function e(n){let r,i;const s=new Map;let a;const o=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,s.set(i.name,i)),n.contentDecoders!==void 0)for(const c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,o.set(a.name,a)),n.contentTypeDecoders!==void 0)for(const c of n.contentTypeDecoders)o.set(c.name,c)}return a===void 0&&(a=(0,Jc.default)().applicationJson.decoder,o.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:o}}t.fromOptions=e})(Qc||(Qc={}));class Xv extends tp{constructor(e,n){super(),this.readable=e,this.options=Qc.fromOptions(n),this.buffer=(0,Jc.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Yv.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
122
|
+
${JSON.stringify(Object.fromEntries(r))}`));return}const s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}const n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Jc.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}pn.ReadableStreamMessageReader=Xv;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.WriteableStreamMessageWriter=mn.AbstractMessageWriter=mn.MessageWriter=void 0;const ju=ln,Ci=Ie,Jv=Zi,zu=jt,Qv="Content-Length: ",Bu=`\r
|
|
123
|
+
`;var qu;(function(t){function e(n){let r=n;return r&&Ci.func(r.dispose)&&Ci.func(r.onClose)&&Ci.func(r.onError)&&Ci.func(r.write)}t.is=e})(qu||(mn.MessageWriter=qu={}));class np{constructor(){this.errorEmitter=new zu.Emitter,this.closeEmitter=new zu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Ci.string(e.message)?e.message:"unknown"}`)}}mn.AbstractMessageWriter=np;var Zc;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,ju.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,ju.default)().applicationJson.encoder}}t.fromOptions=e})(Zc||(Zc={}));class Zv extends np{constructor(e,n){super(),this.writable=e,this.options=Zc.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Jv.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{const i=[];return i.push(Qv,r.byteLength.toString(),Bu),i.push(Bu),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}}mn.WriteableStreamMessageWriter=Zv;var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.AbstractMessageBuffer=void 0;const eE=13,tE=10,nE=`\r
|
|
124
|
+
`;class rE{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){const l=this._chunks[r];for(i=0;i<l.length;){switch(l[i]){case eE:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case tE:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=l.byteLength,r++}if(n!==4)return;const a=this._read(s+i),o=new Map,c=this.toString(a,"ascii").split(nE);if(c.length<2)return o;for(let l=0;l<c.length-2;l++){const d=c[l],h=d.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
|
|
125
|
+
${d}`);const p=d.substr(0,h),R=d.substr(h+1).trim();o.set(e?p.toLowerCase():p,R)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){const s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}const n=this.allocNative(e);let r=0,i=0;for(;e>0;){const s=this._chunks[i];if(s.byteLength>e){const a=s.slice(0,e);n.set(a,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}}Ga.AbstractMessageBuffer=rE;var rp={};(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=ln,n=Ie,r=U,i=tn,s=jt,a=kn;var o;(function(g){g.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var c;(function(g){function S(m){return typeof m=="string"||typeof m=="number"}g.is=S})(c||(t.ProgressToken=c={}));var l;(function(g){g.type=new r.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}t.ProgressType=d;var h;(function(g){function S(m){return n.func(m)}g.is=S})(h||(h={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var R;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(R||(t.TraceValues=R={})),function(g){function S(y){if(!n.string(y))return g.Off;switch(y=y.toLowerCase(),y){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}g.fromString=S;function m(y){switch(y){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}g.toString=m}(p||(t.Trace=p={}));var k;(function(g){g.Text="text",g.JSON="json"})(k||(t.TraceFormat=k={})),function(g){function S(m){return n.string(m)?(m=m.toLowerCase(),m==="json"?g.JSON:g.Text):g.Text}g.fromString=S}(k||(t.TraceFormat=k={}));var _;(function(g){g.type=new r.NotificationType("$/setTrace")})(_||(t.SetTraceNotification=_={}));var M;(function(g){g.type=new r.NotificationType("$/logTrace")})(M||(t.LogTraceNotification=M={}));var N;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(N||(t.ConnectionErrors=N={}));class L extends Error{constructor(S,m){super(m),this.code=S,Object.setPrototypeOf(this,L.prototype)}}t.ConnectionError=L;var w;(function(g){function S(m){const y=m;return y&&n.func(y.cancelUndispatched)}g.is=S})(w||(t.ConnectionStrategy=w={}));var O;(function(g){function S(m){const y=m;return y&&(y.kind===void 0||y.kind==="id")&&n.func(y.createCancellationTokenSource)&&(y.dispose===void 0||n.func(y.dispose))}g.is=S})(O||(t.IdCancellationReceiverStrategy=O={}));var J;(function(g){function S(m){const y=m;return y&&y.kind==="request"&&n.func(y.createCancellationTokenSource)&&(y.dispose===void 0||n.func(y.dispose))}g.is=S})(J||(t.RequestCancellationReceiverStrategy=J={}));var re;(function(g){g.Message=Object.freeze({createCancellationTokenSource(m){return new a.CancellationTokenSource}});function S(m){return O.is(m)||J.is(m)}g.is=S})(re||(t.CancellationReceiverStrategy=re={}));var ie;(function(g){g.Message=Object.freeze({sendCancellation(m,y){return m.sendNotification(o.type,{id:y})},cleanup(m){}});function S(m){const y=m;return y&&n.func(y.sendCancellation)&&n.func(y.cleanup)}g.is=S})(ie||(t.CancellationSenderStrategy=ie={}));var we;(function(g){g.Message=Object.freeze({receiver:re.Message,sender:ie.Message});function S(m){const y=m;return y&&re.is(y.receiver)&&ie.is(y.sender)}g.is=S})(we||(t.CancellationStrategy=we={}));var $e;(function(g){function S(m){const y=m;return y&&n.func(y.handleMessage)}g.is=S})($e||(t.MessageStrategy=$e={}));var Se;(function(g){function S(m){const y=m;return y&&(we.is(y.cancellationStrategy)||w.is(y.connectionStrategy)||$e.is(y.messageStrategy))}g.is=S})(Se||(t.ConnectionOptions=Se={}));var C;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(C||(C={}));function v(g,S,m,y){const E=m!==void 0?m:t.NullLogger;let $=0,x=0,P=0;const z="2.0";let G;const se=new Map;let q;const te=new Map,De=new Map;let ge,ue=new i.LinkedMap,Pe=new Map,Me=new Set,be=new Map,Q=p.Off,ct=k.Text,ye,At=C.New;const nr=new s.Emitter,Xr=new s.Emitter,Jr=new s.Emitter,Qr=new s.Emitter,Zr=new s.Emitter,St=y&&y.cancellationStrategy?y.cancellationStrategy:we.Message;function ei(f){if(f===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+f.toString()}function es(f){return f===null?"res-unknown-"+(++P).toString():"res-"+f.toString()}function ts(){return"not-"+(++x).toString()}function ns(f,A){r.Message.isRequest(A)?f.set(ei(A.id),A):r.Message.isResponse(A)?f.set(es(A.id),A):f.set(ts(),A)}function rs(f){}function ti(){return At===C.Listening}function ni(){return At===C.Closed}function qt(){return At===C.Disposed}function ri(){(At===C.New||At===C.Listening)&&(At=C.Closed,Xr.fire(void 0))}function is(f){nr.fire([f,void 0,void 0])}function ss(f){nr.fire(f)}g.onClose(ri),g.onError(is),S.onClose(ri),S.onError(ss);function ii(){ge||ue.size===0||(ge=(0,e.default)().timer.setImmediate(()=>{ge=void 0,as()}))}function si(f){r.Message.isRequest(f)?cs(f):r.Message.isNotification(f)?us(f):r.Message.isResponse(f)?ls(f):ds(f)}function as(){if(ue.size===0)return;const f=ue.shift();try{const A=y?.messageStrategy;$e.is(A)?A.handleMessage(f,si):si(f)}finally{ii()}}const os=f=>{try{if(r.Message.isNotification(f)&&f.method===o.type.method){const A=f.params.id,I=ei(A),F=ue.get(I);if(r.Message.isRequest(F)){const ae=y?.connectionStrategy,Te=ae&&ae.cancelUndispatched?ae.cancelUndispatched(F,rs):void 0;if(Te&&(Te.error!==void 0||Te.result!==void 0)){ue.delete(I),be.delete(A),Te.id=F.id,$n(Te,f.method,Date.now()),S.write(Te).catch(()=>E.error("Sending response for canceled message failed."));return}}const ce=be.get(A);if(ce!==void 0){ce.cancel(),rr(f);return}else Me.add(A)}ns(ue,f)}finally{ii()}};function cs(f){if(qt())return;function A(X,de,ne){const Le={jsonrpc:z,id:f.id};X instanceof r.ResponseError?Le.error=X.toJson():Le.result=X===void 0?null:X,$n(Le,de,ne),S.write(Le).catch(()=>E.error("Sending response failed."))}function I(X,de,ne){const Le={jsonrpc:z,id:f.id,error:X.toJson()};$n(Le,de,ne),S.write(Le).catch(()=>E.error("Sending response failed."))}function F(X,de,ne){X===void 0&&(X=null);const Le={jsonrpc:z,id:f.id,result:X};$n(Le,de,ne),S.write(Le).catch(()=>E.error("Sending response failed."))}ps(f);const ce=se.get(f.method);let ae,Te;ce&&(ae=ce.type,Te=ce.handler);const Ne=Date.now();if(Te||G){const X=f.id??String(Date.now()),de=O.is(St.receiver)?St.receiver.createCancellationTokenSource(X):St.receiver.createCancellationTokenSource(f);f.id!==null&&Me.has(f.id)&&de.cancel(),f.id!==null&&be.set(X,de);try{let ne;if(Te)if(f.params===void 0){if(ae!==void 0&&ae.numberOfParams!==0){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines ${ae.numberOfParams} params but received none.`),f.method,Ne);return}ne=Te(de.token)}else if(Array.isArray(f.params)){if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byName){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines parameters by name but received parameters by position`),f.method,Ne);return}ne=Te(...f.params,de.token)}else{if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byPosition){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${f.method} defines parameters by position but received parameters by name`),f.method,Ne);return}ne=Te(f.params,de.token)}else G&&(ne=G(f.method,f.params,de.token));const Le=ne;ne?Le.then?Le.then(Xe=>{be.delete(X),A(Xe,f.method,Ne)},Xe=>{be.delete(X),Xe instanceof r.ResponseError?I(Xe,f.method,Ne):Xe&&n.string(Xe.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed with message: ${Xe.message}`),f.method,Ne):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed unexpectedly without providing any details.`),f.method,Ne)}):(be.delete(X),A(ne,f.method,Ne)):(be.delete(X),F(ne,f.method,Ne))}catch(ne){be.delete(X),ne instanceof r.ResponseError?A(ne,f.method,Ne):ne&&n.string(ne.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed with message: ${ne.message}`),f.method,Ne):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${f.method} failed unexpectedly without providing any details.`),f.method,Ne)}}else I(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${f.method}`),f.method,Ne)}function ls(f){if(!qt())if(f.id===null)f.error?E.error(`Received response message without id: Error is:
|
|
126
|
+
${JSON.stringify(f.error,void 0,4)}`):E.error("Received response message without id. No further error information provided.");else{const A=f.id,I=Pe.get(A);if(ms(f,I),I!==void 0){Pe.delete(A);try{if(f.error){const F=f.error;I.reject(new r.ResponseError(F.code,F.message,F.data))}else if(f.result!==void 0)I.resolve(f.result);else throw new Error("Should never happen.")}catch(F){F.message?E.error(`Response handler '${I.method}' failed with message: ${F.message}`):E.error(`Response handler '${I.method}' failed unexpectedly.`)}}}}function us(f){if(qt())return;let A,I;if(f.method===o.type.method){const F=f.params.id;Me.delete(F),rr(f);return}else{const F=te.get(f.method);F&&(I=F.handler,A=F.type)}if(I||q)try{if(rr(f),I)if(f.params===void 0)A!==void 0&&A.numberOfParams!==0&&A.parameterStructures!==r.ParameterStructures.byName&&E.error(`Notification ${f.method} defines ${A.numberOfParams} params but received none.`),I();else if(Array.isArray(f.params)){const F=f.params;f.method===l.type.method&&F.length===2&&c.is(F[0])?I({token:F[0],value:F[1]}):(A!==void 0&&(A.parameterStructures===r.ParameterStructures.byName&&E.error(`Notification ${f.method} defines parameters by name but received parameters by position`),A.numberOfParams!==f.params.length&&E.error(`Notification ${f.method} defines ${A.numberOfParams} params but received ${F.length} arguments`)),I(...F))}else A!==void 0&&A.parameterStructures===r.ParameterStructures.byPosition&&E.error(`Notification ${f.method} defines parameters by position but received parameters by name`),I(f.params);else q&&q(f.method,f.params)}catch(F){F.message?E.error(`Notification handler '${f.method}' failed with message: ${F.message}`):E.error(`Notification handler '${f.method}' failed unexpectedly.`)}else Jr.fire(f)}function ds(f){if(!f){E.error("Received empty message.");return}E.error(`Received message which is neither a response nor a notification message:
|
|
127
|
+
${JSON.stringify(f,null,4)}`);const A=f;if(n.string(A.id)||n.number(A.id)){const I=A.id,F=Pe.get(I);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}function kt(f){if(f!=null)switch(Q){case p.Verbose:return JSON.stringify(f,null,4);case p.Compact:return JSON.stringify(f);default:return}}function fs(f){if(!(Q===p.Off||!ye))if(ct===k.Text){let A;(Q===p.Verbose||Q===p.Compact)&&f.params&&(A=`Params: ${kt(f.params)}
|
|
128
|
+
|
|
129
|
+
`),ye.log(`Sending request '${f.method} - (${f.id})'.`,A)}else Wt("send-request",f)}function hs(f){if(!(Q===p.Off||!ye))if(ct===k.Text){let A;(Q===p.Verbose||Q===p.Compact)&&(f.params?A=`Params: ${kt(f.params)}
|
|
130
|
+
|
|
131
|
+
`:A=`No parameters provided.
|
|
132
|
+
|
|
133
|
+
`),ye.log(`Sending notification '${f.method}'.`,A)}else Wt("send-notification",f)}function $n(f,A,I){if(!(Q===p.Off||!ye))if(ct===k.Text){let F;(Q===p.Verbose||Q===p.Compact)&&(f.error&&f.error.data?F=`Error data: ${kt(f.error.data)}
|
|
134
|
+
|
|
135
|
+
`:f.result?F=`Result: ${kt(f.result)}
|
|
136
|
+
|
|
137
|
+
`:f.error===void 0&&(F=`No result returned.
|
|
138
|
+
|
|
139
|
+
`)),ye.log(`Sending response '${A} - (${f.id})'. Processing request took ${Date.now()-I}ms`,F)}else Wt("send-response",f)}function ps(f){if(!(Q===p.Off||!ye))if(ct===k.Text){let A;(Q===p.Verbose||Q===p.Compact)&&f.params&&(A=`Params: ${kt(f.params)}
|
|
140
|
+
|
|
141
|
+
`),ye.log(`Received request '${f.method} - (${f.id})'.`,A)}else Wt("receive-request",f)}function rr(f){if(!(Q===p.Off||!ye||f.method===M.type.method))if(ct===k.Text){let A;(Q===p.Verbose||Q===p.Compact)&&(f.params?A=`Params: ${kt(f.params)}
|
|
142
|
+
|
|
143
|
+
`:A=`No parameters provided.
|
|
144
|
+
|
|
145
|
+
`),ye.log(`Received notification '${f.method}'.`,A)}else Wt("receive-notification",f)}function ms(f,A){if(!(Q===p.Off||!ye))if(ct===k.Text){let I;if((Q===p.Verbose||Q===p.Compact)&&(f.error&&f.error.data?I=`Error data: ${kt(f.error.data)}
|
|
146
|
+
|
|
147
|
+
`:f.result?I=`Result: ${kt(f.result)}
|
|
148
|
+
|
|
149
|
+
`:f.error===void 0&&(I=`No result returned.
|
|
150
|
+
|
|
151
|
+
`)),A){const F=f.error?` Request failed: ${f.error.message} (${f.error.code}).`:"";ye.log(`Received response '${A.method} - (${f.id})' in ${Date.now()-A.timerStart}ms.${F}`,I)}else ye.log(`Received response ${f.id} without active response promise.`,I)}else Wt("receive-response",f)}function Wt(f,A){if(!ye||Q===p.Off)return;const I={isLSPMessage:!0,type:f,message:A,timestamp:Date.now()};ye.log(I)}function un(){if(ni())throw new L(N.Closed,"Connection is closed.");if(qt())throw new L(N.Disposed,"Connection is disposed.")}function gs(){if(ti())throw new L(N.AlreadyListening,"Connection is already listening")}function ys(){if(!ti())throw new Error("Call listen() first.")}function dn(f){return f===void 0?null:f}function ai(f){if(f!==null)return f}function u(f){return f!=null&&!Array.isArray(f)&&typeof f=="object"}function ke(f,A){switch(f){case r.ParameterStructures.auto:return u(A)?ai(A):[dn(A)];case r.ParameterStructures.byName:if(!u(A))throw new Error("Received parameters by name but param is not an object literal.");return ai(A);case r.ParameterStructures.byPosition:return[dn(A)];default:throw new Error(`Unknown parameter structure ${f.toString()}`)}}function Ce(f,A){let I;const F=f.numberOfParams;switch(F){case 0:I=void 0;break;case 1:I=ke(f.parameterStructures,A[0]);break;default:I=[];for(let ce=0;ce<A.length&&ce<F;ce++)I.push(dn(A[ce]));if(A.length<F)for(let ce=A.length;ce<F;ce++)I.push(null);break}return I}const V={sendNotification:(f,...A)=>{un();let I,F;if(n.string(f)){I=f;const ae=A[0];let Te=0,Ne=r.ParameterStructures.auto;r.ParameterStructures.is(ae)&&(Te=1,Ne=ae);let X=A.length;const de=X-Te;switch(de){case 0:F=void 0;break;case 1:F=ke(Ne,A[Te]);break;default:if(Ne===r.ParameterStructures.byName)throw new Error(`Received ${de} parameters for 'by Name' notification parameter structure.`);F=A.slice(Te,X).map(ne=>dn(ne));break}}else{const ae=A;I=f.method,F=Ce(f,ae)}const ce={jsonrpc:z,method:I,params:F};return hs(ce),S.write(ce).catch(ae=>{throw E.error("Sending notification failed."),ae})},onNotification:(f,A)=>{un();let I;return n.func(f)?q=f:A&&(n.string(f)?(I=f,te.set(f,{type:void 0,handler:A})):(I=f.method,te.set(f.method,{type:f,handler:A}))),{dispose:()=>{I!==void 0?te.delete(I):q=void 0}}},onProgress:(f,A,I)=>{if(De.has(A))throw new Error(`Progress handler for token ${A} already registered`);return De.set(A,I),{dispose:()=>{De.delete(A)}}},sendProgress:(f,A,I)=>V.sendNotification(l.type,{token:A,value:I}),onUnhandledProgress:Qr.event,sendRequest:(f,...A)=>{un(),ys();let I,F,ce;if(n.string(f)){I=f;const X=A[0],de=A[A.length-1];let ne=0,Le=r.ParameterStructures.auto;r.ParameterStructures.is(X)&&(ne=1,Le=X);let Xe=A.length;a.CancellationToken.is(de)&&(Xe=Xe-1,ce=de);const Ot=Xe-ne;switch(Ot){case 0:F=void 0;break;case 1:F=ke(Le,A[ne]);break;default:if(Le===r.ParameterStructures.byName)throw new Error(`Received ${Ot} parameters for 'by Name' request parameter structure.`);F=A.slice(ne,Xe).map(Lp=>dn(Lp));break}}else{const X=A;I=f.method,F=Ce(f,X);const de=f.numberOfParams;ce=a.CancellationToken.is(X[de])?X[de]:void 0}const ae=$++;let Te;ce&&(Te=ce.onCancellationRequested(()=>{const X=St.sender.sendCancellation(V,ae);return X===void 0?(E.log(`Received no promise from cancellation strategy when cancelling id ${ae}`),Promise.resolve()):X.catch(()=>{E.log(`Sending cancellation messages for id ${ae} failed`)})}));const Ne={jsonrpc:z,id:ae,method:I,params:F};return fs(Ne),typeof St.sender.enableCancellation=="function"&&St.sender.enableCancellation(Ne),new Promise(async(X,de)=>{const ne=Ot=>{X(Ot),St.sender.cleanup(ae),Te?.dispose()},Le=Ot=>{de(Ot),St.sender.cleanup(ae),Te?.dispose()},Xe={method:I,timerStart:Date.now(),resolve:ne,reject:Le};try{await S.write(Ne),Pe.set(ae,Xe)}catch(Ot){throw E.error("Sending request failed."),Xe.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Ot.message?Ot.message:"Unknown reason")),Ot}})},onRequest:(f,A)=>{un();let I=null;return h.is(f)?(I=void 0,G=f):n.string(f)?(I=null,A!==void 0&&(I=f,se.set(f,{handler:A,type:void 0}))):A!==void 0&&(I=f.method,se.set(f.method,{type:f,handler:A})),{dispose:()=>{I!==null&&(I!==void 0?se.delete(I):G=void 0)}}},hasPendingResponse:()=>Pe.size>0,trace:async(f,A,I)=>{let F=!1,ce=k.Text;I!==void 0&&(n.boolean(I)?F=I:(F=I.sendNotification||!1,ce=I.traceFormat||k.Text)),Q=f,ct=ce,Q===p.Off?ye=void 0:ye=A,F&&!ni()&&!qt()&&await V.sendNotification(_.type,{value:p.toString(f)})},onError:nr.event,onClose:Xr.event,onUnhandledNotification:Jr.event,onDispose:Zr.event,end:()=>{S.end()},dispose:()=>{if(qt())return;At=C.Disposed,Zr.fire(void 0);const f=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const A of Pe.values())A.reject(f);Pe=new Map,be=new Map,Me=new Set,ue=new i.LinkedMap,n.func(S.dispose)&&S.dispose(),n.func(g.dispose)&&g.dispose()},listen:()=>{un(),gs(),At=C.Listening,g.listen(os)},inspect:()=>{(0,e.default)().console.log("inspect")}};return V.onNotification(M.type,f=>{if(Q===p.Off||!ye)return;const A=Q===p.Verbose||Q===p.Compact;ye.log(f.message,A?f.verbose:void 0)}),V.onNotification(l.type,f=>{const A=De.get(f.token);A?A(f.value):Qr.fire(f)}),V}t.createMessageConnection=v})(rp);(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=U;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 n=tn;Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=Fa;Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=jt;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=kn;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=Or;Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=pn;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 c=mn;Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=Ga;Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=rp;Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=ln;t.RAL=h.default})(ma);Object.defineProperty(Ml,"__esModule",{value:!0});const Gt=ma;class Ua extends Gt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Ua.emptyBuffer}fromString(e,n){return new TextEncoder().encode(e)}toString(e,n){return n==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e:e.slice(0,n)}allocNative(e){return new Uint8Array(e)}}Ua.emptyBuffer=new Uint8Array(0);class iE{constructor(e){this.socket=e,this._onData=new Gt.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Gt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Gt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Gt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Gt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class sE{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Gt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Gt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Gt.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,n){if(typeof e=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const aE=new TextEncoder,ip=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ua(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(aE.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 iE(t),asWritableStream:t=>new sE(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function el(){return ip}(function(t){function e(){Gt.RAL.install(ip)}t.install=e})(el||(el={}));Ml.default=el;(function(t){var e=Rt&&Rt.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var p=Object.getOwnPropertyDescriptor(l,d);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,p)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),n=Rt&&Rt.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Ml.default.install();const i=ma;n(ma,t);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}t.BrowserMessageReader=s;class a extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}t.BrowserMessageWriter=a;function o(c,l,d,h){return d===void 0&&(d=i.NullLogger),i.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,i.createMessageConnection)(c,l,d,h)}t.createMessageConnection=o})(Zn);var Wu=Zn,sp={};const Gl=Bp(hR);var H={};Object.defineProperty(H,"__esModule",{value:!0});H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const xr=Zn;var Vu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Vu||(H.MessageDirection=Vu={}));class oE{constructor(e){this.method=e}}H.RegistrationType=oE;class cE extends xr.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=cE;class lE extends xr.RequestType{constructor(e){super(e,xr.ParameterStructures.byName)}}H.ProtocolRequestType=lE;class uE extends xr.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=uE;class dE extends xr.NotificationType{constructor(e){super(e,xr.ParameterStructures.byName)}}H.ProtocolNotificationType=dE;var ap={},ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.objectLiteral=ve.typedArray=ve.stringArray=ve.array=ve.func=ve.error=ve.number=ve.string=ve.boolean=void 0;function fE(t){return t===!0||t===!1}ve.boolean=fE;function op(t){return typeof t=="string"||t instanceof String}ve.string=op;function hE(t){return typeof t=="number"||t instanceof Number}ve.number=hE;function pE(t){return t instanceof Error}ve.error=pE;function mE(t){return typeof t=="function"}ve.func=mE;function cp(t){return Array.isArray(t)}ve.array=cp;function gE(t){return cp(t)&&t.every(e=>op(e))}ve.stringArray=gE;function yE(t,e){return Array.isArray(t)&&t.every(e)}ve.typedArray=yE;function TE(t){return t!==null&&typeof t=="object"}ve.objectLiteral=TE;var ja={};Object.defineProperty(ja,"__esModule",{value:!0});ja.ImplementationRequest=void 0;const Ku=H;var Hu;(function(t){t.method="textDocument/implementation",t.messageDirection=Ku.MessageDirection.clientToServer,t.type=new Ku.ProtocolRequestType(t.method)})(Hu||(ja.ImplementationRequest=Hu={}));var za={};Object.defineProperty(za,"__esModule",{value:!0});za.TypeDefinitionRequest=void 0;const Yu=H;var Xu;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Yu.MessageDirection.clientToServer,t.type=new Yu.ProtocolRequestType(t.method)})(Xu||(za.TypeDefinitionRequest=Xu={}));var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.DidChangeWorkspaceFoldersNotification=Dr.WorkspaceFoldersRequest=void 0;const ga=H;var Ju;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ga.MessageDirection.serverToClient,t.type=new ga.ProtocolRequestType0(t.method)})(Ju||(Dr.WorkspaceFoldersRequest=Ju={}));var Qu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ga.MessageDirection.clientToServer,t.type=new ga.ProtocolNotificationType(t.method)})(Qu||(Dr.DidChangeWorkspaceFoldersNotification=Qu={}));var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ConfigurationRequest=void 0;const Zu=H;var ed;(function(t){t.method="workspace/configuration",t.messageDirection=Zu.MessageDirection.serverToClient,t.type=new Zu.ProtocolRequestType(t.method)})(ed||(Ba.ConfigurationRequest=ed={}));var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.ColorPresentationRequest=Mr.DocumentColorRequest=void 0;const ya=H;var td;(function(t){t.method="textDocument/documentColor",t.messageDirection=ya.MessageDirection.clientToServer,t.type=new ya.ProtocolRequestType(t.method)})(td||(Mr.DocumentColorRequest=td={}));var nd;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=ya.MessageDirection.clientToServer,t.type=new ya.ProtocolRequestType(t.method)})(nd||(Mr.ColorPresentationRequest=nd={}));var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.FoldingRangeRefreshRequest=Fr.FoldingRangeRequest=void 0;const Ta=H;var rd;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ta.MessageDirection.clientToServer,t.type=new Ta.ProtocolRequestType(t.method)})(rd||(Fr.FoldingRangeRequest=rd={}));var id;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ta.MessageDirection.serverToClient,t.type=new Ta.ProtocolRequestType0(t.method)})(id||(Fr.FoldingRangeRefreshRequest=id={}));var qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.DeclarationRequest=void 0;const sd=H;var ad;(function(t){t.method="textDocument/declaration",t.messageDirection=sd.MessageDirection.clientToServer,t.type=new sd.ProtocolRequestType(t.method)})(ad||(qa.DeclarationRequest=ad={}));var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.SelectionRangeRequest=void 0;const od=H;var cd;(function(t){t.method="textDocument/selectionRange",t.messageDirection=od.MessageDirection.clientToServer,t.type=new od.ProtocolRequestType(t.method)})(cd||(Wa.SelectionRangeRequest=cd={}));var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.WorkDoneProgressCancelNotification=gn.WorkDoneProgressCreateRequest=gn.WorkDoneProgress=void 0;const RE=Zn,Ra=H;var ld;(function(t){t.type=new RE.ProgressType;function e(n){return n===t.type}t.is=e})(ld||(gn.WorkDoneProgress=ld={}));var ud;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Ra.MessageDirection.serverToClient,t.type=new Ra.ProtocolRequestType(t.method)})(ud||(gn.WorkDoneProgressCreateRequest=ud={}));var dd;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Ra.MessageDirection.clientToServer,t.type=new Ra.ProtocolNotificationType(t.method)})(dd||(gn.WorkDoneProgressCancelNotification=dd={}));var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.CallHierarchyOutgoingCallsRequest=yn.CallHierarchyIncomingCallsRequest=yn.CallHierarchyPrepareRequest=void 0;const Gr=H;var fd;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Gr.MessageDirection.clientToServer,t.type=new Gr.ProtocolRequestType(t.method)})(fd||(yn.CallHierarchyPrepareRequest=fd={}));var hd;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Gr.MessageDirection.clientToServer,t.type=new Gr.ProtocolRequestType(t.method)})(hd||(yn.CallHierarchyIncomingCallsRequest=hd={}));var pd;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Gr.MessageDirection.clientToServer,t.type=new Gr.ProtocolRequestType(t.method)})(pd||(yn.CallHierarchyOutgoingCallsRequest=pd={}));var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.SemanticTokensRefreshRequest=nt.SemanticTokensRangeRequest=nt.SemanticTokensDeltaRequest=nt.SemanticTokensRequest=nt.SemanticTokensRegistrationType=nt.TokenFormat=void 0;const an=H;var md;(function(t){t.Relative="relative"})(md||(nt.TokenFormat=md={}));var ji;(function(t){t.method="textDocument/semanticTokens",t.type=new an.RegistrationType(t.method)})(ji||(nt.SemanticTokensRegistrationType=ji={}));var gd;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ji.method})(gd||(nt.SemanticTokensRequest=gd={}));var yd;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ji.method})(yd||(nt.SemanticTokensDeltaRequest=yd={}));var Td;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=an.MessageDirection.clientToServer,t.type=new an.ProtocolRequestType(t.method),t.registrationMethod=ji.method})(Td||(nt.SemanticTokensRangeRequest=Td={}));var Rd;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=an.MessageDirection.serverToClient,t.type=new an.ProtocolRequestType0(t.method)})(Rd||(nt.SemanticTokensRefreshRequest=Rd={}));var Va={};Object.defineProperty(Va,"__esModule",{value:!0});Va.ShowDocumentRequest=void 0;const vd=H;var Ed;(function(t){t.method="window/showDocument",t.messageDirection=vd.MessageDirection.serverToClient,t.type=new vd.ProtocolRequestType(t.method)})(Ed||(Va.ShowDocumentRequest=Ed={}));var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.LinkedEditingRangeRequest=void 0;const Ad=H;var Sd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Ad.MessageDirection.clientToServer,t.type=new Ad.ProtocolRequestType(t.method)})(Sd||(Ka.LinkedEditingRangeRequest=Sd={}));var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.DidRenameFilesNotification=Ve.WillRenameFilesRequest=Ve.DidCreateFilesNotification=Ve.WillCreateFilesRequest=Ve.FileOperationPatternKind=void 0;const Et=H;var kd;(function(t){t.file="file",t.folder="folder"})(kd||(Ve.FileOperationPatternKind=kd={}));var Cd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolRequestType(t.method)})(Cd||(Ve.WillCreateFilesRequest=Cd={}));var Nd;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolNotificationType(t.method)})(Nd||(Ve.DidCreateFilesNotification=Nd={}));var wd;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolRequestType(t.method)})(wd||(Ve.WillRenameFilesRequest=wd={}));var bd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolNotificationType(t.method)})(bd||(Ve.DidRenameFilesNotification=bd={}));var _d;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolNotificationType(t.method)})(_d||(Ve.DidDeleteFilesNotification=_d={}));var Id;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Et.MessageDirection.clientToServer,t.type=new Et.ProtocolRequestType(t.method)})(Id||(Ve.WillDeleteFilesRequest=Id={}));var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.MonikerRequest=Tn.MonikerKind=Tn.UniquenessLevel=void 0;const $d=H;var Pd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Pd||(Tn.UniquenessLevel=Pd={}));var Ld;(function(t){t.$import="import",t.$export="export",t.local="local"})(Ld||(Tn.MonikerKind=Ld={}));var Od;(function(t){t.method="textDocument/moniker",t.messageDirection=$d.MessageDirection.clientToServer,t.type=new $d.ProtocolRequestType(t.method)})(Od||(Tn.MonikerRequest=Od={}));var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.TypeHierarchySubtypesRequest=Rn.TypeHierarchySupertypesRequest=Rn.TypeHierarchyPrepareRequest=void 0;const Ur=H;var xd;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Ur.MessageDirection.clientToServer,t.type=new Ur.ProtocolRequestType(t.method)})(xd||(Rn.TypeHierarchyPrepareRequest=xd={}));var Dd;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Ur.MessageDirection.clientToServer,t.type=new Ur.ProtocolRequestType(t.method)})(Dd||(Rn.TypeHierarchySupertypesRequest=Dd={}));var Md;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Ur.MessageDirection.clientToServer,t.type=new Ur.ProtocolRequestType(t.method)})(Md||(Rn.TypeHierarchySubtypesRequest=Md={}));var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.InlineValueRefreshRequest=jr.InlineValueRequest=void 0;const va=H;var Fd;(function(t){t.method="textDocument/inlineValue",t.messageDirection=va.MessageDirection.clientToServer,t.type=new va.ProtocolRequestType(t.method)})(Fd||(jr.InlineValueRequest=Fd={}));var Gd;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=va.MessageDirection.serverToClient,t.type=new va.ProtocolRequestType0(t.method)})(Gd||(jr.InlineValueRefreshRequest=Gd={}));var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.InlayHintRefreshRequest=vn.InlayHintResolveRequest=vn.InlayHintRequest=void 0;const zr=H;var Ud;(function(t){t.method="textDocument/inlayHint",t.messageDirection=zr.MessageDirection.clientToServer,t.type=new zr.ProtocolRequestType(t.method)})(Ud||(vn.InlayHintRequest=Ud={}));var jd;(function(t){t.method="inlayHint/resolve",t.messageDirection=zr.MessageDirection.clientToServer,t.type=new zr.ProtocolRequestType(t.method)})(jd||(vn.InlayHintResolveRequest=jd={}));var zd;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=zr.MessageDirection.serverToClient,t.type=new zr.ProtocolRequestType0(t.method)})(zd||(vn.InlayHintRefreshRequest=zd={}));var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.DiagnosticRefreshRequest=Tt.WorkspaceDiagnosticRequest=Tt.DocumentDiagnosticRequest=Tt.DocumentDiagnosticReportKind=Tt.DiagnosticServerCancellationData=void 0;const lp=Zn,vE=ve,Br=H;var Bd;(function(t){function e(n){const r=n;return r&&vE.boolean(r.retriggerRequest)}t.is=e})(Bd||(Tt.DiagnosticServerCancellationData=Bd={}));var qd;(function(t){t.Full="full",t.Unchanged="unchanged"})(qd||(Tt.DocumentDiagnosticReportKind=qd={}));var Wd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Br.MessageDirection.clientToServer,t.type=new Br.ProtocolRequestType(t.method),t.partialResult=new lp.ProgressType})(Wd||(Tt.DocumentDiagnosticRequest=Wd={}));var Vd;(function(t){t.method="workspace/diagnostic",t.messageDirection=Br.MessageDirection.clientToServer,t.type=new Br.ProtocolRequestType(t.method),t.partialResult=new lp.ProgressType})(Vd||(Tt.WorkspaceDiagnosticRequest=Vd={}));var Kd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Br.MessageDirection.serverToClient,t.type=new Br.ProtocolRequestType0(t.method)})(Kd||(Tt.DiagnosticRefreshRequest=Kd={}));var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.DidCloseNotebookDocumentNotification=Re.DidSaveNotebookDocumentNotification=Re.DidChangeNotebookDocumentNotification=Re.NotebookCellArrayChange=Re.DidOpenNotebookDocumentNotification=Re.NotebookDocumentSyncRegistrationType=Re.NotebookDocument=Re.NotebookCell=Re.ExecutionSummary=Re.NotebookCellKind=void 0;const zi=Gl,bt=ve,zt=H;var tl;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(tl||(Re.NotebookCellKind=tl={}));var nl;(function(t){function e(i,s){const a={executionOrder:i};return(s===!0||s===!1)&&(a.success=s),a}t.create=e;function n(i){const s=i;return bt.objectLiteral(s)&&zi.uinteger.is(s.executionOrder)&&(s.success===void 0||bt.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(nl||(Re.ExecutionSummary=nl={}));var Ea;(function(t){function e(s,a){return{kind:s,document:a}}t.create=e;function n(s){const a=s;return bt.objectLiteral(a)&&tl.is(a.kind)&&zi.DocumentUri.is(a.document)&&(a.metadata===void 0||bt.objectLiteral(a.metadata))}t.is=n;function r(s,a){const o=new Set;return s.document!==a.document&&o.add("document"),s.kind!==a.kind&&o.add("kind"),s.executionSummary!==a.executionSummary&&o.add("executionSummary"),(s.metadata!==void 0||a.metadata!==void 0)&&!i(s.metadata,a.metadata)&&o.add("metadata"),(s.executionSummary!==void 0||a.executionSummary!==void 0)&&!nl.equals(s.executionSummary,a.executionSummary)&&o.add("executionSummary"),o}t.diff=r;function i(s,a){if(s===a)return!0;if(s==null||a===null||a===void 0||typeof s!=typeof a||typeof s!="object")return!1;const o=Array.isArray(s),c=Array.isArray(a);if(o!==c)return!1;if(o&&c){if(s.length!==a.length)return!1;for(let l=0;l<s.length;l++)if(!i(s[l],a[l]))return!1}if(bt.objectLiteral(s)&&bt.objectLiteral(a)){const l=Object.keys(s),d=Object.keys(a);if(l.length!==d.length||(l.sort(),d.sort(),!i(l,d)))return!1;for(let h=0;h<l.length;h++){const p=l[h];if(!i(s[p],a[p]))return!1}}return!0}})(Ea||(Re.NotebookCell=Ea={}));var Hd;(function(t){function e(r,i,s,a){return{uri:r,notebookType:i,version:s,cells:a}}t.create=e;function n(r){const i=r;return bt.objectLiteral(i)&&bt.string(i.uri)&&zi.integer.is(i.version)&&bt.typedArray(i.cells,Ea.is)}t.is=n})(Hd||(Re.NotebookDocument=Hd={}));var qr;(function(t){t.method="notebookDocument/sync",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.RegistrationType(t.method)})(qr||(Re.NotebookDocumentSyncRegistrationType=qr={}));var Yd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=qr.method})(Yd||(Re.DidOpenNotebookDocumentNotification=Yd={}));var Xd;(function(t){function e(r){const i=r;return bt.objectLiteral(i)&&zi.uinteger.is(i.start)&&zi.uinteger.is(i.deleteCount)&&(i.cells===void 0||bt.typedArray(i.cells,Ea.is))}t.is=e;function n(r,i,s){const a={start:r,deleteCount:i};return s!==void 0&&(a.cells=s),a}t.create=n})(Xd||(Re.NotebookCellArrayChange=Xd={}));var Jd;(function(t){t.method="notebookDocument/didChange",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=qr.method})(Jd||(Re.DidChangeNotebookDocumentNotification=Jd={}));var Qd;(function(t){t.method="notebookDocument/didSave",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=qr.method})(Qd||(Re.DidSaveNotebookDocumentNotification=Qd={}));var Zd;(function(t){t.method="notebookDocument/didClose",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolNotificationType(t.method),t.registrationMethod=qr.method})(Zd||(Re.DidCloseNotebookDocumentNotification=Zd={}));var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.InlineCompletionRequest=void 0;const ef=H;var tf;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=ef.MessageDirection.clientToServer,t.type=new ef.ProtocolRequestType(t.method)})(tf||(Ha.InlineCompletionRequest=tf={}));(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=H,n=Gl,r=ve,i=ja;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=za;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=Dr;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=Ba;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const c=Mr;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=Fr;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const d=qa;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return d.DeclarationRequest}});const h=Wa;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const p=gn;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 R=yn;Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return R.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return R.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.CallHierarchyPrepareRequest}});const k=nt;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return k.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return k.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return k.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return k.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return k.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return k.SemanticTokensRegistrationType}});const _=Va;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return _.ShowDocumentRequest}});const M=Ka;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return M.LinkedEditingRangeRequest}});const N=Ve;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return N.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return N.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return N.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return N.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return N.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return N.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return N.WillDeleteFilesRequest}});const L=Tn;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 w=Rn;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return w.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return w.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return w.TypeHierarchySupertypesRequest}});const O=jr;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return O.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return O.InlineValueRefreshRequest}});const J=vn;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return J.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return J.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return J.InlayHintRefreshRequest}});const re=Tt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return re.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return re.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return re.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return re.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return re.DiagnosticRefreshRequest}});const ie=Re;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return ie.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return ie.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return ie.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return ie.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ie.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ie.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidCloseNotebookDocumentNotification}});const we=Ha;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return we.InlineCompletionRequest}});var $e;(function(u){function ke(Ce){const V=Ce;return r.string(V)||r.string(V.language)||r.string(V.scheme)||r.string(V.pattern)}u.is=ke})($e||(t.TextDocumentFilter=$e={}));var Se;(function(u){function ke(Ce){const V=Ce;return r.objectLiteral(V)&&(r.string(V.notebookType)||r.string(V.scheme)||r.string(V.pattern))}u.is=ke})(Se||(t.NotebookDocumentFilter=Se={}));var C;(function(u){function ke(Ce){const V=Ce;return r.objectLiteral(V)&&(r.string(V.notebook)||Se.is(V.notebook))&&(V.language===void 0||r.string(V.language))}u.is=ke})(C||(t.NotebookCellTextDocumentFilter=C={}));var v;(function(u){function ke(Ce){if(!Array.isArray(Ce))return!1;for(let V of Ce)if(!r.string(V)&&!$e.is(V)&&!C.is(V))return!1;return!0}u.is=ke})(v||(t.DocumentSelector=v={}));var g;(function(u){u.method="client/registerCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(g||(t.RegistrationRequest=g={}));var S;(function(u){u.method="client/unregisterCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(S||(t.UnregistrationRequest=S={}));var m;(function(u){u.Create="create",u.Rename="rename",u.Delete="delete"})(m||(t.ResourceOperationKind=m={}));var y;(function(u){u.Abort="abort",u.Transactional="transactional",u.TextOnlyTransactional="textOnlyTransactional",u.Undo="undo"})(y||(t.FailureHandlingKind=y={}));var E;(function(u){u.UTF8="utf-8",u.UTF16="utf-16",u.UTF32="utf-32"})(E||(t.PositionEncodingKind=E={}));var $;(function(u){function ke(Ce){const V=Ce;return V&&r.string(V.id)&&V.id.length>0}u.hasId=ke})($||(t.StaticRegistrationOptions=$={}));var x;(function(u){function ke(Ce){const V=Ce;return V&&(V.documentSelector===null||v.is(V.documentSelector))}u.is=ke})(x||(t.TextDocumentRegistrationOptions=x={}));var P;(function(u){function ke(V){const f=V;return r.objectLiteral(f)&&(f.workDoneProgress===void 0||r.boolean(f.workDoneProgress))}u.is=ke;function Ce(V){const f=V;return f&&r.boolean(f.workDoneProgress)}u.hasWorkDoneProgress=Ce})(P||(t.WorkDoneProgressOptions=P={}));var z;(function(u){u.method="initialize",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(z||(t.InitializeRequest=z={}));var G;(function(u){u.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var se;(function(u){u.method="initialized",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(se||(t.InitializedNotification=se={}));var q;(function(u){u.method="shutdown",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType0(u.method)})(q||(t.ShutdownRequest=q={}));var te;(function(u){u.method="exit",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType0(u.method)})(te||(t.ExitNotification=te={}));var De;(function(u){u.method="workspace/didChangeConfiguration",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(De||(t.DidChangeConfigurationNotification=De={}));var ge;(function(u){u.Error=1,u.Warning=2,u.Info=3,u.Log=4,u.Debug=5})(ge||(t.MessageType=ge={}));var ue;(function(u){u.method="window/showMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(ue||(t.ShowMessageNotification=ue={}));var Pe;(function(u){u.method="window/showMessageRequest",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(Pe||(t.ShowMessageRequest=Pe={}));var Me;(function(u){u.method="window/logMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Me||(t.LogMessageNotification=Me={}));var be;(function(u){u.method="telemetry/event",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(be||(t.TelemetryEventNotification=be={}));var Q;(function(u){u.None=0,u.Full=1,u.Incremental=2})(Q||(t.TextDocumentSyncKind=Q={}));var ct;(function(u){u.method="textDocument/didOpen",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(ct||(t.DidOpenTextDocumentNotification=ct={}));var ye;(function(u){function ke(V){let f=V;return f!=null&&typeof f.text=="string"&&f.range!==void 0&&(f.rangeLength===void 0||typeof f.rangeLength=="number")}u.isIncremental=ke;function Ce(V){let f=V;return f!=null&&typeof f.text=="string"&&f.range===void 0&&f.rangeLength===void 0}u.isFull=Ce})(ye||(t.TextDocumentContentChangeEvent=ye={}));var At;(function(u){u.method="textDocument/didChange",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(At||(t.DidChangeTextDocumentNotification=At={}));var nr;(function(u){u.method="textDocument/didClose",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(nr||(t.DidCloseTextDocumentNotification=nr={}));var Xr;(function(u){u.method="textDocument/didSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Xr||(t.DidSaveTextDocumentNotification=Xr={}));var Jr;(function(u){u.Manual=1,u.AfterDelay=2,u.FocusOut=3})(Jr||(t.TextDocumentSaveReason=Jr={}));var Qr;(function(u){u.method="textDocument/willSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Qr||(t.WillSaveTextDocumentNotification=Qr={}));var Zr;(function(u){u.method="textDocument/willSaveWaitUntil",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Zr||(t.WillSaveTextDocumentWaitUntilRequest=Zr={}));var St;(function(u){u.method="workspace/didChangeWatchedFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(St||(t.DidChangeWatchedFilesNotification=St={}));var ei;(function(u){u.Created=1,u.Changed=2,u.Deleted=3})(ei||(t.FileChangeType=ei={}));var es;(function(u){function ke(Ce){const V=Ce;return r.objectLiteral(V)&&(n.URI.is(V.baseUri)||n.WorkspaceFolder.is(V.baseUri))&&r.string(V.pattern)}u.is=ke})(es||(t.RelativePattern=es={}));var ts;(function(u){u.Create=1,u.Change=2,u.Delete=4})(ts||(t.WatchKind=ts={}));var ns;(function(u){u.method="textDocument/publishDiagnostics",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(ns||(t.PublishDiagnosticsNotification=ns={}));var rs;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.TriggerForIncompleteCompletions=3})(rs||(t.CompletionTriggerKind=rs={}));var ti;(function(u){u.method="textDocument/completion",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ti||(t.CompletionRequest=ti={}));var ni;(function(u){u.method="completionItem/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ni||(t.CompletionResolveRequest=ni={}));var qt;(function(u){u.method="textDocument/hover",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(qt||(t.HoverRequest=qt={}));var ri;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.ContentChange=3})(ri||(t.SignatureHelpTriggerKind=ri={}));var is;(function(u){u.method="textDocument/signatureHelp",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(is||(t.SignatureHelpRequest=is={}));var ss;(function(u){u.method="textDocument/definition",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ss||(t.DefinitionRequest=ss={}));var ii;(function(u){u.method="textDocument/references",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ii||(t.ReferencesRequest=ii={}));var si;(function(u){u.method="textDocument/documentHighlight",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(si||(t.DocumentHighlightRequest=si={}));var as;(function(u){u.method="textDocument/documentSymbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(as||(t.DocumentSymbolRequest=as={}));var os;(function(u){u.method="textDocument/codeAction",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(os||(t.CodeActionRequest=os={}));var cs;(function(u){u.method="codeAction/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(cs||(t.CodeActionResolveRequest=cs={}));var ls;(function(u){u.method="workspace/symbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ls||(t.WorkspaceSymbolRequest=ls={}));var us;(function(u){u.method="workspaceSymbol/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(us||(t.WorkspaceSymbolResolveRequest=us={}));var ds;(function(u){u.method="textDocument/codeLens",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ds||(t.CodeLensRequest=ds={}));var kt;(function(u){u.method="codeLens/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(kt||(t.CodeLensResolveRequest=kt={}));var fs;(function(u){u.method="workspace/codeLens/refresh",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType0(u.method)})(fs||(t.CodeLensRefreshRequest=fs={}));var hs;(function(u){u.method="textDocument/documentLink",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(hs||(t.DocumentLinkRequest=hs={}));var $n;(function(u){u.method="documentLink/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})($n||(t.DocumentLinkResolveRequest=$n={}));var ps;(function(u){u.method="textDocument/formatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ps||(t.DocumentFormattingRequest=ps={}));var rr;(function(u){u.method="textDocument/rangeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(rr||(t.DocumentRangeFormattingRequest=rr={}));var ms;(function(u){u.method="textDocument/rangesFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ms||(t.DocumentRangesFormattingRequest=ms={}));var Wt;(function(u){u.method="textDocument/onTypeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Wt||(t.DocumentOnTypeFormattingRequest=Wt={}));var un;(function(u){u.Identifier=1})(un||(t.PrepareSupportDefaultBehavior=un={}));var gs;(function(u){u.method="textDocument/rename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(gs||(t.RenameRequest=gs={}));var ys;(function(u){u.method="textDocument/prepareRename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ys||(t.PrepareRenameRequest=ys={}));var dn;(function(u){u.method="workspace/executeCommand",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(dn||(t.ExecuteCommandRequest=dn={}));var ai;(function(u){u.method="workspace/applyEdit",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType("workspace/applyEdit")})(ai||(t.ApplyWorkspaceEditRequest=ai={}))})(ap);var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.createProtocolConnection=void 0;const nf=Zn;function EE(t,e,n,r){return nf.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,nf.createMessageConnection)(t,e,n,r)}Ya.createProtocolConnection=EE;(function(t){var e=Rt&&Rt.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=Rt&&Rt.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Zn,t),n(Gl,t),n(H,t),n(ap,t);var r=Ya;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(sp);(function(t){var e=Rt&&Rt.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=Rt&&Rt.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Wu;n(Wu,t),n(sp,t);function i(s,a,o,c){return(0,r.createMessageConnection)(s,a,o,c)}t.createProtocolConnection=i})(ki);var wi;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(wi||(wi={}));class AE{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Gi,this.documentPhaseListeners=new Gi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=K.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,n={},r=pe.None){for(const i of e){const s=i.uri.toString();if(i.state===K.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(i,K.IndexedReferences);else if(typeof n.validation=="object"){const a=this.findMissingValidationCategories(i,n);a.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:a}},result:this.buildState.get(s)?.result}),i.state=K.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=K.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=pe.None){this.currentState=K.Changed;const i=[];for(const c of n){const l=this.langiumDocuments.deleteDocuments(c);for(const d of l)i.push(d.uri),this.cleanUpDeleted(d)}const s=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(const c of s){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=K.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,K.Changed)}const a=fe(s).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!a.has(c.uri.toString())&&this.shouldRelink(c,a)).forEach(c=>this.resetToState(c,K.ComputedScopes)),await this.emitUpdate(s,i),await Je(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<K.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,r)}resultsAreIncomplete(e,n){return this.findMissingValidationCategories(e,n).length>=1}findMissingValidationCategories(e,n){const r=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?i:new Set,a=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return fe(a).filter(o=>!s.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),wi.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}resetToState(e,n){switch(n){case K.Changed:case K.Parsed:this.indexManager.removeContent(e.uri);case K.IndexedContent:e.localSymbols=void 0;case K.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case K.Linked:this.indexManager.removeReferences(e.uri);case K.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case K.Validated:}e.state>n&&(e.state=n)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=K.Changed}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,K.Parsed,r,a=>this.langiumDocumentFactory.update(a,r)),await this.runCancelable(e,K.IndexedContent,r,a=>this.indexManager.updateContent(a,r)),await this.runCancelable(e,K.ComputedScopes,r,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,r)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,K.Linked,r,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,r)),await this.runCancelable(i,K.IndexedReferences,r,a=>this.indexManager.updateReferences(a,r));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,K.Validated,r,async a=>{await this.validate(a,r),this.markAsCompleted(a)})}markAsCompleted(e){const n=this.buildState.get(e.uri.toString());n&&(n.completed=!0)}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){for(const a of e)a.state<n&&(await Je(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r));const s=e.filter(a=>a.state===n);await this.notifyBuildPhase(s,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),wi.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),wi.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=pe.None),i?this.awaitDocumentState(e,i,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,n,r){const i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=e)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(Cr);if(this.currentState>=e&&e>i.state)return Promise.reject(new ki.ResponseError(ki.LSPErrorCodes.RequestFailed,`Document state of ${n.toString()} is ${K[i.state]}, requiring ${K[e]}, but workspace state is already ${K[this.currentState]}. Returning undefined.`))}else return Promise.reject(new ki.ResponseError(ki.LSPErrorCodes.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,l=>{dt.equals(l.uri,n)&&(o.dispose(),c.dispose(),s(l.uri))}),c=r.onCancellationRequested(()=>{o.dispose(),c.dispose(),a(Cr)})})}awaitBuilderState(e,n){return this.currentState>=e?Promise.resolve():n.isCancellationRequested?Promise.reject(Cr):new Promise((r,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),r()}),a=n.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(Cr)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await Je(r),await a(e,r)}catch(o){if(!Ma(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await Je(r),await a(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await r.validateDocument(e,s,n);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=fe(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}}class SE{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new iv,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=Qt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{dt.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),fe(i)}allElements(e,n){let r=fe(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){return n?this.symbolByTypeIndex.get(e,n,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,n))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(e){const n=e.toString();this.referenceIndex.delete(n)}async updateContent(e,n=pe.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=pe.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class kE{constructor(e){this.initialBuildOptions={},this._ready=new Dl,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(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(e,n=pe.None){const r=await this.performStartup(e);await Je(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=[],r=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,r);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=fe(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,r),this._ready.resolve(),n}async loadWorkspaceDocuments(e,n){await Promise.all(e.map(async r=>{const i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return It.parse(e.uri)}async traverseFolder(e,n){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const n=[];return await this.traverseFolder(e,n),n}shouldIncludeEntry(e){const n=dt.basename(e.uri);return n.startsWith(".")?!1:e.isDirectory?n!=="node_modules"&&n!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class CE{buildUnexpectedCharactersMessage(e,n,r,i,s){return Lo.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return Lo.buildUnableToPopLexerModeMessage(e)}}const NE={mode:"full"};class wE{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=rf(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new rt(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=NE){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(rf(e))return e;const n=up(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function bE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function up(t){return t&&"modes"in t&&"defaultMode"in t}function rf(t){return!bE(t)&&!up(t)}function _E(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=ee.create(0,0));const s=dp(t),a=Ul(r),o=PE({lines:s,position:i,options:a});return ME({index:0,tokens:o,position:i})}function IE(t,e){const n=Ul(e),r=dp(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!a?.exec(i)&&!!o?.exec(s)}function dp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Jm)}const sf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,$E=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function PE(t){const e=[];let n=t.position.line,r=t.position.character;for(let i=0;i<t.lines.length;i++){const s=i===0,a=i===t.lines.length-1;let o=t.lines[i],c=0;if(s&&t.options.start){const d=t.options.start?.exec(o);d&&(c=d.index+d[0].length)}else{const d=t.options.line?.exec(o);d&&(c=d.index+d[0].length)}if(a){const d=t.options.end?.exec(o);d&&(o=o.substring(0,d.index))}if(o=o.substring(0,DE(o)),rl(o,c)>=o.length){if(e.length>0){const d=ee.create(n,r);e.push({type:"break",content:"",range:Y.create(d,d)})}}else{sf.lastIndex=c;const d=sf.exec(o);if(d){const h=d[0],p=d[1],R=ee.create(n,r+c),k=ee.create(n,r+c+h.length);e.push({type:"tag",content:p,range:Y.create(R,k)}),c+=h.length,c=rl(o,c)}if(c<o.length){const h=o.substring(c),p=Array.from(h.matchAll($E));e.push(...LE(p,h,n,r+c))}}n++,r=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function LE(t,e,n,r){const i=[];if(t.length===0){const s=ee.create(n,r),a=ee.create(n,r+e.length);i.push({type:"text",content:e,range:Y.create(s,a)})}else{let s=0;for(const o of t){const c=o.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:Y.create(ee.create(n,s+r),ee.create(n,c+r))});let d=l.length+1;const h=o[1];if(i.push({type:"inline-tag",content:h,range:Y.create(ee.create(n,s+d+r),ee.create(n,s+d+h.length+r))}),d+=h.length,o.length===4){d+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:Y.create(ee.create(n,s+d+r),ee.create(n,s+d+p.length+r))})}else i.push({type:"text",content:"",range:Y.create(ee.create(n,s+d+r),ee.create(n,s+d+r))});s=c+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:Y.create(ee.create(n,s+r),ee.create(n,s+r+a.length))})}return i}const OE=/\S/,xE=/\s*$/;function rl(t,e){const n=t.substring(e).match(OE);return n?e+n.index:t.length}function DE(t){const e=t.match(xE);if(e&&typeof e.index=="number")return e.index}function ME(t){const e=ee.create(t.position.line,t.position.character);if(t.tokens.length===0)return new af([],Y.create(e,e));const n=[];for(;t.index<t.tokens.length;){const s=FE(t,n[n.length-1]);s&&n.push(s)}const r=n[0]?.range.start??e,i=n[n.length-1]?.range.end??e;return new af(n,Y.create(r,i))}function FE(t,e){const n=t.tokens[t.index];if(n.type==="tag")return hp(t,!1);if(n.type==="text"||n.type==="inline-tag")return fp(t);GE(n,e),t.index++}function GE(t,e){if(e){const n=new mp("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function fp(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(UE(t)),r=e,e=t.tokens[t.index];return new il(i,Y.create(n.range.start,r.range.end))}function UE(t){return t.tokens[t.index].type==="inline-tag"?hp(t,!0):pp(t)}function hp(t,e){const n=t.tokens[t.index++],r=n.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){const s=pp(t);return new ho(r,new il([s],s.range),e,Y.create(n.range.start,s.range.end))}else{const s=fp(t);return new ho(r,s,e,Y.create(n.range.start,s.range.end))}else{const s=n.range;return new ho(r,new il([],s),e,s)}}function pp(t){const e=t.tokens[t.index++];return new mp(e.content,e.range)}function Ul(t){if(!t)return Ul({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:fo(e,!0),end:fo(n,!1),line:fo(r,!0)}}function fo(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?ba(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class af{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=of(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=of(n)+i}return n.trim()}}class ho{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
|
|
152
|
+
${n}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=jE(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} — ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
153
|
+
${n}`),this.inline?`{${i}}`:i}}function jE(t,e,n){if(t==="linkplain"||t==="linkcode"||t==="link"){const r=e.indexOf(" ");let i=e;if(r>0){const a=rl(e,r);i=e.substring(a),e=e.substring(0,r)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(i=`\`${i}\``),n.renderLink?.(e,i)??zE(e,i)}}function zE(t,e){try{return It.parse(t,!0),`[${e}](${t})`}catch{return t}}class il{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
|
154
|
+
`)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
|
|
155
|
+
`)}return n}}class mp{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function of(t){return t.endsWith(`
|
|
156
|
+
`)?`
|
|
157
|
+
`:`
|
|
158
|
+
|
|
159
|
+
`}class BE{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&IE(n))return _E(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){const i=this.findNameInLocalSymbols(e,n)??this.findNameInGlobalScope(e,n);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,n){}findNameInLocalSymbols(e,n){const i=Qt(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(c=>c.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class qE{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return ov(e)?e.$comment:Vm(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}}class WE{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class VE{constructor(){this.previousTokenSource=new xl,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=VR();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=pe.None){const i=new Dl,s={action:n,deferred:i,cancellationToken:r};return e.push(s),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:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Ma(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class KE{constructor(e){this.grammarElementIdMap=new Ou,this.tokenTypeIdMap=new Ou,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(n=>({...n,message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Zt(e))n.set(i,{});if(e.$cstNode)for(const i of bo(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)Ke(o)?a.push(this.dehydrateAstNode(o,n)):wt(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else Ke(s)?r[i]=this.dehydrateAstNode(s,n):wt(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return _f(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),_i(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):bf(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Zt(e))n.set(s,{});let i;if(e.$cstNode)for(const s of bo(e.$cstNode)){let a;"fullText"in s?(a=new Mh(s.fullText),i=a):"content"in s?a=new Pl:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)Ke(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):wt(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else Ke(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):wt(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),_i(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,c=e.endColumn,l=e.hidden;return new jc(r,i,{start:{line:s,character:a},end:{line:o,character:c}},n,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Zt(this.grammar))Sm(n)&&this.grammarElementIdMap.set(n,e++)}}function wn(t){return{documentation:{CommentProvider:e=>new qE(e),DocumentationProvider:e=>new BE(e)},parser:{AsyncParser:e=>new WE(e),GrammarConfig:e=>Rg(e),LangiumParser:e=>$R(e),CompletionParser:e=>IR(e),ValueConverter:()=>new Vh,TokenBuilder:()=>new Wh,Lexer:e=>new wE(e),ParserErrorMessageProvider:()=>new Uh,LexerErrorMessageProvider:()=>new CE},workspace:{AstNodeLocator:()=>new yv,AstNodeDescriptionProvider:e=>new mv(e),ReferenceDescriptionProvider:e=>new gv(e)},references:{Linker:e=>new JR(e),NameProvider:()=>new ZR,ScopeProvider:e=>new av(e),ScopeComputation:e=>new tv(e),References:e=>new ev(e)},serializer:{Hydrator:e=>new KE(e),JsonSerializer:e=>new cv(e)},validation:{DocumentValidator:e=>new fv(e),ValidationRegistry:e=>new uv(e)},shared:()=>t.shared}}function bn(t){return{ServiceRegistry:e=>new lv(e),workspace:{LangiumDocuments:e=>new XR(e),LangiumDocumentFactory:e=>new YR(e),DocumentBuilder:e=>new AE(e),IndexManager:e=>new SE(e),WorkspaceManager:e=>new kE(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new VE,ConfigurationProvider:e=>new Tv(e)},profilers:{}}}var cf;(function(t){t.merge=(e,n)=>Bi(Bi({},e),n)})(cf||(cf={}));function Ye(t,e,n,r,i,s,a,o,c){const l=[t,e,n,r,i,s,a,o,c].reduce(Bi,{});return gp(l)}const HE=Symbol("isProxy");function gp(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===HE?!0:uf(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(uf(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const lf=Symbol();function uf(t,e,n,r){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]===lf)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 n){const i=n[e];t[e]=lf;try{t[e]=typeof i=="function"?i(r):gp(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Bi(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!=null)if(typeof r=="object"){const i=t[n];typeof i=="object"&&i!==null?t[n]=Bi(i,r):t[n]=Bi({},r)}else t[n]=r}return t}class YE{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 _n={fileSystemProvider:()=>new YE},XE={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},JE={AstReflection:()=>new xf};function QE(){const t=Ye(bn(_n),JE),e=Ye(wn({shared:t}),XE);return t.ServiceRegistry.register(e),e}function er(t){const e=QE(),n=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(n,It.parse(`memory:/${n.name??"grammar"}.langium`)),n}var ZE=Object.defineProperty,b=(t,e)=>ZE(t,"name",{value:e,configurable:!0}),sl;(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 ]+\]/}})(sl||(sl={}));var al;(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])?/}})(al||(al={}));var ol;(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]*/}})(ol||(ol={}));var cl;(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]*/}})(cl||(cl={}));var ll;(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]*/}})(ll||(ll={}));var ul;(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]*/}})(ul||(ul={}));var dl;(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:/"[^"]*"|'[^']*'/}})(dl||(dl={}));({...sl.Terminals,...al.Terminals,...ol.Terminals,...cl.Terminals,...ll.Terminals,...ul.Terminals,...dl.Terminals});var Kt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function eA(t){return Lt.isInstance(t,Kt.$type)}b(eA,"isArchitecture");var Ns={$type:"Axis",label:"label",name:"name"},Bs={$type:"Branch",name:"name",order:"order"};function tA(t){return Lt.isInstance(t,Bs.$type)}b(tA,"isBranch");var df={$type:"Checkout",branch:"branch"},ws={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},po={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Rr={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function nA(t){return Lt.isInstance(t,Rr.$type)}b(nA,"isCommit");var bs={$type:"Curve",entries:"entries",label:"label",name:"name"},or={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},xt={$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"},Un={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function rA(t){return Lt.isInstance(t,Un.$type)}b(rA,"isGitGraph");var pi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ni={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function iA(t){return Lt.isInstance(t,Ni.$type)}b(iA,"isInfo");var mi={$type:"Item",classSelector:"classSelector",name:"name"},go={$type:"Junction",id:"id",in:"in"},_s={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},vr={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function sA(t){return Lt.isInstance(t,vr.$type)}b(sA,"isMerge");var yo={$type:"Option",name:"name",value:"value"},Er={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function aA(t){return Lt.isInstance(t,Er.$type)}b(aA,"isPacket");var Ar={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function oA(t){return Lt.isInstance(t,Ar.$type)}b(oA,"isPacketBlock");var jn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function cA(t){return Lt.isInstance(t,jn.$type)}b(cA,"isPie");var qs={$type:"PieSection",label:"label",value:"value"};function lA(t){return Lt.isInstance(t,qs.$type)}b(lA,"isPieSection");var On={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},To={$type:"Section",classSelector:"classSelector",name:"name"},cr={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},lr={$type:"Statement"},Sr={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function uA(t){return Lt.isInstance(t,Sr.$type)}b(uA,"isTreemap");var Ro={$type:"TreemapRow",indent:"indent",item:"item"},yp=class extends wf{constructor(){super(...arguments),this.types={Architecture:{name:Kt.$type,properties:{accDescr:{name:Kt.accDescr},accTitle:{name:Kt.accTitle},edges:{name:Kt.edges,defaultValue:[]},groups:{name:Kt.groups,defaultValue:[]},junctions:{name:Kt.junctions,defaultValue:[]},services:{name:Kt.services,defaultValue:[]},title:{name:Kt.title}},superTypes:[]},Axis:{name:Ns.$type,properties:{label:{name:Ns.label},name:{name:Ns.name}},superTypes:[]},Branch:{name:Bs.$type,properties:{name:{name:Bs.name},order:{name:Bs.order}},superTypes:[lr.$type]},Checkout:{name:df.$type,properties:{branch:{name:df.branch}},superTypes:[lr.$type]},CherryPicking:{name:ws.$type,properties:{id:{name:ws.id},parent:{name:ws.parent},tags:{name:ws.tags,defaultValue:[]}},superTypes:[lr.$type]},ClassDefStatement:{name:po.$type,properties:{className:{name:po.className},styleText:{name:po.styleText}},superTypes:[]},Commit:{name:Rr.$type,properties:{id:{name:Rr.id},message:{name:Rr.message},tags:{name:Rr.tags,defaultValue:[]},type:{name:Rr.type}},superTypes:[lr.$type]},Curve:{name:bs.$type,properties:{entries:{name:bs.entries,defaultValue:[]},label:{name:bs.label},name:{name:bs.name}},superTypes:[]},Direction:{name:or.$type,properties:{accDescr:{name:or.accDescr},accTitle:{name:or.accTitle},dir:{name:or.dir},statements:{name:or.statements,defaultValue:[]},title:{name:or.title}},superTypes:[Un.$type]},Edge:{name:xt.$type,properties:{lhsDir:{name:xt.lhsDir},lhsGroup:{name:xt.lhsGroup,defaultValue:!1},lhsId:{name:xt.lhsId},lhsInto:{name:xt.lhsInto,defaultValue:!1},rhsDir:{name:xt.rhsDir},rhsGroup:{name:xt.rhsGroup,defaultValue:!1},rhsId:{name:xt.rhsId},rhsInto:{name:xt.rhsInto,defaultValue:!1},title:{name:xt.title}},superTypes:[]},Entry:{name:mo.$type,properties:{axis:{name:mo.axis,referenceType:Ns.$type},value:{name:mo.value}},superTypes:[]},GitGraph:{name:Un.$type,properties:{accDescr:{name:Un.accDescr},accTitle:{name:Un.accTitle},statements:{name:Un.statements,defaultValue:[]},title:{name:Un.title}},superTypes:[]},Group:{name:pi.$type,properties:{icon:{name:pi.icon},id:{name:pi.id},in:{name:pi.in},title:{name:pi.title}},superTypes:[]},Info:{name:Ni.$type,properties:{accDescr:{name:Ni.accDescr},accTitle:{name:Ni.accTitle},title:{name:Ni.title}},superTypes:[]},Item:{name:mi.$type,properties:{classSelector:{name:mi.classSelector},name:{name:mi.name}},superTypes:[]},Junction:{name:go.$type,properties:{id:{name:go.id},in:{name:go.in}},superTypes:[]},Leaf:{name:_s.$type,properties:{classSelector:{name:_s.classSelector},name:{name:_s.name},value:{name:_s.value}},superTypes:[mi.$type]},Merge:{name:vr.$type,properties:{branch:{name:vr.branch},id:{name:vr.id},tags:{name:vr.tags,defaultValue:[]},type:{name:vr.type}},superTypes:[lr.$type]},Option:{name:yo.$type,properties:{name:{name:yo.name},value:{name:yo.value,defaultValue:!1}},superTypes:[]},Packet:{name:Er.$type,properties:{accDescr:{name:Er.accDescr},accTitle:{name:Er.accTitle},blocks:{name:Er.blocks,defaultValue:[]},title:{name:Er.title}},superTypes:[]},PacketBlock:{name:Ar.$type,properties:{bits:{name:Ar.bits},end:{name:Ar.end},label:{name:Ar.label},start:{name:Ar.start}},superTypes:[]},Pie:{name:jn.$type,properties:{accDescr:{name:jn.accDescr},accTitle:{name:jn.accTitle},sections:{name:jn.sections,defaultValue:[]},showData:{name:jn.showData,defaultValue:!1},title:{name:jn.title}},superTypes:[]},PieSection:{name:qs.$type,properties:{label:{name:qs.label},value:{name:qs.value}},superTypes:[]},Radar:{name:On.$type,properties:{accDescr:{name:On.accDescr},accTitle:{name:On.accTitle},axes:{name:On.axes,defaultValue:[]},curves:{name:On.curves,defaultValue:[]},options:{name:On.options,defaultValue:[]},title:{name:On.title}},superTypes:[]},Section:{name:To.$type,properties:{classSelector:{name:To.classSelector},name:{name:To.name}},superTypes:[mi.$type]},Service:{name:cr.$type,properties:{icon:{name:cr.icon},iconText:{name:cr.iconText},id:{name:cr.id},in:{name:cr.in},title:{name:cr.title}},superTypes:[]},Statement:{name:lr.$type,properties:{},superTypes:[]},Treemap:{name:Sr.$type,properties:{accDescr:{name:Sr.accDescr},accTitle:{name:Sr.accTitle},title:{name:Sr.title},TreemapRows:{name:Sr.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Ro.$type,properties:{indent:{name:Ro.indent},item:{name:Ro.item}},superTypes:[]}}}static{b(this,"MermaidAstReflection")}},Lt=new yp,ff,dA=b(()=>ff??(ff=er(`{"$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"),hf,fA=b(()=>hf??(hf=er(`{"$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"),pf,hA=b(()=>pf??(pf=er(`{"$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"),mf,pA=b(()=>mf??(mf=er(`{"$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"),gf,mA=b(()=>gf??(gf=er(`{"$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"),yf,gA=b(()=>yf??(yf=er(`{"$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"),Tf,yA=b(()=>Tf??(Tf=er(`{"$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"),TA={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},RA={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vA={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},EA={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},AA={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},SA={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kA={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tr={AstReflection:b(()=>new yp,"AstReflection")},CA={Grammar:b(()=>dA(),"Grammar"),LanguageMetaData:b(()=>TA,"LanguageMetaData"),parser:{}},NA={Grammar:b(()=>fA(),"Grammar"),LanguageMetaData:b(()=>RA,"LanguageMetaData"),parser:{}},wA={Grammar:b(()=>hA(),"Grammar"),LanguageMetaData:b(()=>vA,"LanguageMetaData"),parser:{}},bA={Grammar:b(()=>pA(),"Grammar"),LanguageMetaData:b(()=>EA,"LanguageMetaData"),parser:{}},_A={Grammar:b(()=>mA(),"Grammar"),LanguageMetaData:b(()=>AA,"LanguageMetaData"),parser:{}},IA={Grammar:b(()=>gA(),"Grammar"),LanguageMetaData:b(()=>SA,"LanguageMetaData"),parser:{}},$A={Grammar:b(()=>yA(),"Grammar"),LanguageMetaData:b(()=>kA,"LanguageMetaData"),parser:{}},PA=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,LA=/accTitle[\t ]*:([^\n\r]*)/,OA=/title([\t ][^\n\r]*|)/,xA={ACC_DESCR:PA,ACC_TITLE:LA,TITLE:OA},Xa=class extends Vh{static{b(this,"AbstractMermaidValueConverter")}runConverter(t,e,n){let r=this.runCommonConverter(t,e,n);return r===void 0&&(r=this.runCustomConverter(t,e,n)),r===void 0?super.runConverter(t,e,n):r}runCommonConverter(t,e,n){const r=xA[t.name];if(r===void 0)return;const i=r.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
160
|
+
`)}}},Ja=class extends Xa{static{b(this,"CommonValueConverter")}runCustomConverter(t,e,n){}},In=class extends Wh{static{b(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,n){const r=super.buildKeywordTokens(t,e,n);return r.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),r}};(class extends In{static{b(this,"CommonTokenBuilder")}});var DA=class extends In{static{b(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Tp={parser:{TokenBuilder:b(()=>new DA,"TokenBuilder"),ValueConverter:b(()=>new Ja,"ValueConverter")}};function Rp(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),NA,Tp);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}b(Rp,"createGitGraphServices");var MA=class extends In{static{b(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},vp={parser:{TokenBuilder:b(()=>new MA,"TokenBuilder"),ValueConverter:b(()=>new Ja,"ValueConverter")}};function Ep(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),wA,vp);return e.ServiceRegistry.register(n),{shared:e,Info:n}}b(Ep,"createInfoServices");var FA=class extends In{static{b(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},Ap={parser:{TokenBuilder:b(()=>new FA,"TokenBuilder"),ValueConverter:b(()=>new Ja,"ValueConverter")}};function Sp(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),bA,Ap);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}b(Sp,"createPacketServices");var GA=class extends In{static{b(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},UA=class extends Xa{static{b(this,"PieValueConverter")}runCustomConverter(t,e,n){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},kp={parser:{TokenBuilder:b(()=>new GA,"TokenBuilder"),ValueConverter:b(()=>new UA,"ValueConverter")}};function Cp(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),_A,kp);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}b(Cp,"createPieServices");var jA=class extends In{static{b(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},zA=class extends Xa{static{b(this,"ArchitectureValueConverter")}runCustomConverter(t,e,n){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},Np={parser:{TokenBuilder:b(()=>new jA,"TokenBuilder"),ValueConverter:b(()=>new zA,"ValueConverter")}};function wp(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),CA,Np);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}b(wp,"createArchitectureServices");var BA=class extends In{static{b(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},bp={parser:{TokenBuilder:b(()=>new BA,"TokenBuilder"),ValueConverter:b(()=>new Ja,"ValueConverter")}};function _p(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),IA,bp);return e.ServiceRegistry.register(n),{shared:e,Radar:n}}b(_p,"createRadarServices");var qA=class extends In{static{b(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},WA=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,VA=class extends Xa{static{b(this,"TreemapValueConverter")}runCustomConverter(t,e,n){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR")return e.substring(1,e.length-1);if(t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const r=WA.exec(e);if(r)return{$type:"ClassDefStatement",className:r[1],styleText:r[2]||void 0}}}};function Ip(t){const e=t.validation.TreemapValidator,n=t.validation.ValidationRegistry;if(n){const r={Treemap:e.checkSingleRoot.bind(e)};n.register(r,e)}}b(Ip,"registerValidationChecks");var KA=class{static{b(this,"TreemapValidator")}checkSingleRoot(t,e){let n;for(const r of t.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:r.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}):n!==void 0&&n>=parseInt(r.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}))}},$p={parser:{TokenBuilder:b(()=>new qA,"TokenBuilder"),ValueConverter:b(()=>new VA,"ValueConverter")},validation:{TreemapValidator:b(()=>new KA,"TreemapValidator")}};function Pp(t=_n){const e=Ye(bn(t),tr),n=Ye(wn({shared:e}),$A,$p);return e.ServiceRegistry.register(n),Ip(n),{shared:e,Treemap:n}}b(Pp,"createTreemapServices");var Yt={},HA={info:b(async()=>{const{createInfoServices:t}=await Pn(async()=>{const{createInfoServices:n}=await Promise.resolve().then(()=>JA);return{createInfoServices:n}},void 0),e=t().Info.parser.LangiumParser;Yt.info=e},"info"),packet:b(async()=>{const{createPacketServices:t}=await Pn(async()=>{const{createPacketServices:n}=await Promise.resolve().then(()=>QA);return{createPacketServices:n}},void 0),e=t().Packet.parser.LangiumParser;Yt.packet=e},"packet"),pie:b(async()=>{const{createPieServices:t}=await Pn(async()=>{const{createPieServices:n}=await Promise.resolve().then(()=>ZA);return{createPieServices:n}},void 0),e=t().Pie.parser.LangiumParser;Yt.pie=e},"pie"),architecture:b(async()=>{const{createArchitectureServices:t}=await Pn(async()=>{const{createArchitectureServices:n}=await Promise.resolve().then(()=>eS);return{createArchitectureServices:n}},void 0),e=t().Architecture.parser.LangiumParser;Yt.architecture=e},"architecture"),gitGraph:b(async()=>{const{createGitGraphServices:t}=await Pn(async()=>{const{createGitGraphServices:n}=await Promise.resolve().then(()=>tS);return{createGitGraphServices:n}},void 0),e=t().GitGraph.parser.LangiumParser;Yt.gitGraph=e},"gitGraph"),radar:b(async()=>{const{createRadarServices:t}=await Pn(async()=>{const{createRadarServices:n}=await Promise.resolve().then(()=>nS);return{createRadarServices:n}},void 0),e=t().Radar.parser.LangiumParser;Yt.radar=e},"radar"),treemap:b(async()=>{const{createTreemapServices:t}=await Pn(async()=>{const{createTreemapServices:n}=await Promise.resolve().then(()=>rS);return{createTreemapServices:n}},void 0),e=t().Treemap.parser.LangiumParser;Yt.treemap=e},"treemap")};async function YA(t,e){const n=HA[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);Yt[t]||await n();const i=Yt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new XA(i);return i.value}b(YA,"parse");var XA=class extends Error{constructor(t){const e=t.lexerErrors.map(r=>r.message).join(`
|
|
161
|
+
`),n=t.parserErrors.map(r=>r.message).join(`
|
|
162
|
+
`);super(`Parsing failed: ${e} ${n}`),this.result=t}static{b(this,"MermaidParseError")}};const JA=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:vp,createInfoServices:Ep},Symbol.toStringTag,{value:"Module"})),QA=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Ap,createPacketServices:Sp},Symbol.toStringTag,{value:"Module"})),ZA=Object.freeze(Object.defineProperty({__proto__:null,PieModule:kp,createPieServices:Cp},Symbol.toStringTag,{value:"Module"})),eS=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Np,createArchitectureServices:wp},Symbol.toStringTag,{value:"Module"})),tS=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Tp,createGitGraphServices:Rp},Symbol.toStringTag,{value:"Module"})),nS=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:bp,createRadarServices:_p},Symbol.toStringTag,{value:"Module"})),rS=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:$p,createTreemapServices:Pp},Symbol.toStringTag,{value:"Module"}));export{YA as p};
|