zenstack 0.6.0-pre.5 → 0.6.0-pre.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli/index.js +71 -71
  2. package/package.json +3 -3
package/cli/index.js CHANGED
@@ -1,22 +1,22 @@
1
- "use strict";var uN=Object.create;var ks=Object.defineProperty;var lN=Object.getOwnPropertyDescriptor;var cN=Object.getOwnPropertyNames,MT=Object.getOwnPropertySymbols,FT=Object.getPrototypeOf,qT=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,dN=Reflect.get;var LT=(t,e,r)=>e in t?ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rl=(t,e)=>{for(var r in e||={})qT.call(e,r)&&LT(t,r,e[r]);if(MT)for(var r of MT(e))fN.call(e,r)&&LT(t,r,e[r]);return t};var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pN=(t,e)=>{for(var r in e)ks(t,r,{get:e[r],enumerable:!0})},jT=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cN(e))!qT.call(t,i)&&i!==r&&ks(t,i,{get:()=>e[i],enumerable:!(n=lN(e,i))||n.enumerable});return t};var te=(t,e,r)=>(r=t!=null?uN(FT(t)):{},jT(e||!t||!t.__esModule?ks(r,"default",{value:t,enumerable:!0}):r,t)),hN=t=>jT(ks({},"__esModule",{value:!0}),t);var bl=(t,e,r)=>dN(FT(t),r,e);var wt=(t,e,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(l){i(l)}},a=u=>{try{s(r.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(t,e)).next())});var BT=b((wV,HT)=>{var UT={};HT.exports=UT;var GT={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(GT).forEach(function(t){var e=GT[t],r=UT[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var KT=b((SV,WT)=>{"use strict";WT.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var VT=b((kV,zT)=>{"use strict";var mN=require("os"),An=KT(),br=process.env,pa=void 0;An("no-color")||An("no-colors")||An("color=false")?pa=!1:(An("color")||An("colors")||An("color=true")||An("color=always"))&&(pa=!0);"FORCE_COLOR"in br&&(pa=br.FORCE_COLOR.length===0||parseInt(br.FORCE_COLOR,10)!==0);function gN(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function yN(t){if(pa===!1)return 0;if(An("color=16m")||An("color=full")||An("color=truecolor"))return 3;if(An("color=256"))return 2;if(t&&!t.isTTY&&pa!==!0)return 0;var e=pa?1:0;if(process.platform==="win32"){var r=mN.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in br)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in br})||br.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in br)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(br.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in br){var n=parseInt((br.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(br.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(br.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(br.TERM)||"COLORTERM"in br?1:(br.TERM==="dumb",e)}function Np(t){var e=yN(t);return gN(e)}zT.exports={supportsColor:Np,stdout:Np(process.stdout),stderr:Np(process.stderr)}});var XT=b((PV,YT)=>{YT.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var a=i[o]||[" "],s=Math.floor(Math.random()*a.length);typeof i[o]<"u"?n+=i[o][s]:n+=o}),n}});var JT=b((DV,ZT)=>{ZT.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function a(u){var l=!1;return i.filter(function(c){l=c===u}),l}function s(u,l){var c="",f,p;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(p in u)if(!a(p)){switch(c=c+u[p],f={up:0,down:0,mid:0},l.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var h=["up","mid","down"];for(var d in h)for(var g=h[d],C=0;C<=f[g];C++)l[g]&&(c=c+n[g][o(n[g].length)])}return c}return s(e,r)}});var e0=b((NV,QT)=>{QT.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var r0=b((OV,t0)=>{t0.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var i0=b((IV,n0)=>{n0.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var a0=b(($V,o0)=>{o0.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var Op=b((LV,f0)=>{var Te={};f0.exports=Te;Te.themes={};var vN=require("util"),wo=Te.styles=BT(),u0=Object.defineProperties,_N=new RegExp(/[\r\n]+/g);Te.supportsColor=VT().supportsColor;typeof Te.enabled>"u"&&(Te.enabled=Te.supportsColor()!==!1);Te.enable=function(){Te.enabled=!0};Te.disable=function(){Te.enabled=!1};Te.stripColors=Te.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var MV=Te.stylize=function(e,r){if(!Te.enabled)return e+"";var n=wo[r];return!n&&r in Te?Te[r](e):n.open+e+n.close},TN=/[|\\{}()[\]^$+*?.]/g,RN=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(TN,"\\$&")};function l0(t){var e=function r(){return AN.apply(r,arguments)};return e._styles=t,e.__proto__=bN,e}var c0=function(){var t={};return wo.grey=wo.gray,Object.keys(wo).forEach(function(e){wo[e].closeRe=new RegExp(RN(wo[e].close),"g"),t[e]={get:function(){return l0(this._styles.concat(e))}}}),t}(),bN=u0(function(){},c0);function AN(){var t=Array.prototype.slice.call(arguments),e=t.map(function(a){return a!=null&&a.constructor===String?a:vN.inspect(a)}).join(" ");if(!Te.enabled||!e)return e;for(var r=e.indexOf(`
2
- `)!=-1,n=this._styles,i=n.length;i--;){var o=wo[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(_N,function(a){return o.close+a+o.open}))}return e}Te.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){Te[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=Te[t[r][o]](i);return i}return Te[t[r]](n)}})(e)};function EN(){var t={};return Object.keys(c0).forEach(function(e){t[e]={get:function(){return l0([e])}}}),t}var CN=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};Te.trap=XT();Te.zalgo=JT();Te.maps={};Te.maps.america=e0()(Te);Te.maps.zebra=r0()(Te);Te.maps.rainbow=i0()(Te);Te.maps.random=a0()(Te);for(s0 in Te.maps)(function(t){Te[t]=function(e){return CN(Te.maps[t],e)}})(s0);var s0;u0(Te,EN())});var p0=b((FV,d0)=>{var fr=Op();d0.exports=function(){var t=function(n,i){String.prototype.__defineGetter__(n,i)};t("strip",function(){return fr.strip(this)}),t("stripColors",function(){return fr.strip(this)}),t("trap",function(){return fr.trap(this)}),t("zalgo",function(){return fr.zalgo(this)}),t("zebra",function(){return fr.zebra(this)}),t("rainbow",function(){return fr.rainbow(this)}),t("random",function(){return fr.random(this)}),t("america",function(){return fr.america(this)});var e=Object.keys(fr.styles);e.forEach(function(n){t(n,function(){return fr.stylize(this,n)})});function r(n){var i=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(n).forEach(function(o){if(i.indexOf(o)!==-1)console.log("warn: ".red+("String.prototype"+o).magenta+" is probably something you don't want to override. Ignoring style name");else if(typeof n[o]=="string")fr[o]=fr[n[o]],t(o,function(){return fr[o](this)});else{var a=function(s){for(var u=s||this,l=0;l<n[o].length;l++)u=fr[n[o][l]](u);return u};t(o,a),fr[o]=function(s){return a(s)}}})}fr.setTheme=function(n){if(typeof n=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}else r(n)}}});var Al=b((qV,h0)=>{var xN=Op();h0.exports=xN;p0()()});var Ps=b($p=>{var El=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Ip=class extends El{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};$p.CommanderError=El;$p.InvalidArgumentError=Ip});var Cl=b(Lp=>{var{InvalidArgumentError:wN}=Ps(),Mp=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(r,n)=>{if(!e.includes(r))throw new wN(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function SN(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Lp.Argument=Mp;Lp.humanReadableArgName=SN});var qp=b(m0=>{var{humanReadableArgName:kN}=Cl(),Fp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden);if(e._hasImplicitHelpCommand()){let[,n,i]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(n).helpOption(!1);o.description(e._helpCommandDescription),i&&o.arguments(i),r.push(o)}return this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}visibleOptions(e){let r=e.options.filter(o=>!o.hidden),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),i=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||i){let o;n?i?o=e.createOption(e._helpFlags,e._helpDescription):o=e.createOption(e._helpShortFlag,e._helpDescription):o=e.createOption(e._helpLongFlag,e._helpDescription),r.push(o)}if(this.sortOptions){let o=a=>a.short?a.short.replace(/^-/,""):a.long.replace(/^--/,"");r.sort((a,s)=>o(a).localeCompare(o(s)))}return r}visibleArguments(e){return e._argsDescription&&e._args.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e._args.find(r=>r.description)?e._args:[]}subcommandTerm(e){let r=e._args.map(n=>kN(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){let r=[];return e.argChoices&&!e.negate&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&!e.negate&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,a=2;function s(d,g){if(g){let C=`${d.padEnd(n+a)}${g}`;return r.wrap(C,i-o,n+a)}return d}function u(d){return d.join(`
1
+ "use strict";var sN=Object.create;var ks=Object.defineProperty;var uN=Object.getOwnPropertyDescriptor;var lN=Object.getOwnPropertyNames,MT=Object.getOwnPropertySymbols,FT=Object.getPrototypeOf,qT=Object.prototype.hasOwnProperty,cN=Object.prototype.propertyIsEnumerable,fN=Reflect.get;var LT=(t,e,r)=>e in t?ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rl=(t,e)=>{for(var r in e||={})qT.call(e,r)&&LT(t,r,e[r]);if(MT)for(var r of MT(e))cN.call(e,r)&&LT(t,r,e[r]);return t};var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dN=(t,e)=>{for(var r in e)ks(t,r,{get:e[r],enumerable:!0})},jT=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lN(e))!qT.call(t,i)&&i!==r&&ks(t,i,{get:()=>e[i],enumerable:!(n=uN(e,i))||n.enumerable});return t};var te=(t,e,r)=>(r=t!=null?sN(FT(t)):{},jT(e||!t||!t.__esModule?ks(r,"default",{value:t,enumerable:!0}):r,t)),pN=t=>jT(ks({},"__esModule",{value:!0}),t);var bl=(t,e,r)=>fN(FT(t),r,e);var wt=(t,e,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(l){i(l)}},a=u=>{try{s(r.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(t,e)).next())});var BT=b((xV,HT)=>{var UT={};HT.exports=UT;var GT={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(GT).forEach(function(t){var e=GT[t],r=UT[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var KT=b((wV,WT)=>{"use strict";WT.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var VT=b((SV,zT)=>{"use strict";var hN=require("os"),An=KT(),br=process.env,pa=void 0;An("no-color")||An("no-colors")||An("color=false")?pa=!1:(An("color")||An("colors")||An("color=true")||An("color=always"))&&(pa=!0);"FORCE_COLOR"in br&&(pa=br.FORCE_COLOR.length===0||parseInt(br.FORCE_COLOR,10)!==0);function mN(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function gN(t){if(pa===!1)return 0;if(An("color=16m")||An("color=full")||An("color=truecolor"))return 3;if(An("color=256"))return 2;if(t&&!t.isTTY&&pa!==!0)return 0;var e=pa?1:0;if(process.platform==="win32"){var r=hN.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in br)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in br})||br.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in br)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(br.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in br){var n=parseInt((br.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(br.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(br.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(br.TERM)||"COLORTERM"in br?1:(br.TERM==="dumb",e)}function Np(t){var e=gN(t);return mN(e)}zT.exports={supportsColor:Np,stdout:Np(process.stdout),stderr:Np(process.stderr)}});var XT=b((kV,YT)=>{YT.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var a=i[o]||[" "],s=Math.floor(Math.random()*a.length);typeof i[o]<"u"?n+=i[o][s]:n+=o}),n}});var JT=b((PV,ZT)=>{ZT.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function a(u){var l=!1;return i.filter(function(c){l=c===u}),l}function s(u,l){var c="",f,p;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(p in u)if(!a(p)){switch(c=c+u[p],f={up:0,down:0,mid:0},l.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var h=["up","mid","down"];for(var d in h)for(var g=h[d],C=0;C<=f[g];C++)l[g]&&(c=c+n[g][o(n[g].length)])}return c}return s(e,r)}});var e0=b((DV,QT)=>{QT.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var r0=b((NV,t0)=>{t0.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var i0=b((OV,n0)=>{n0.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var a0=b((IV,o0)=>{o0.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var Op=b((MV,f0)=>{var Te={};f0.exports=Te;Te.themes={};var yN=require("util"),wo=Te.styles=BT(),u0=Object.defineProperties,vN=new RegExp(/[\r\n]+/g);Te.supportsColor=VT().supportsColor;typeof Te.enabled>"u"&&(Te.enabled=Te.supportsColor()!==!1);Te.enable=function(){Te.enabled=!0};Te.disable=function(){Te.enabled=!1};Te.stripColors=Te.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var $V=Te.stylize=function(e,r){if(!Te.enabled)return e+"";var n=wo[r];return!n&&r in Te?Te[r](e):n.open+e+n.close},_N=/[|\\{}()[\]^$+*?.]/g,TN=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(_N,"\\$&")};function l0(t){var e=function r(){return bN.apply(r,arguments)};return e._styles=t,e.__proto__=RN,e}var c0=function(){var t={};return wo.grey=wo.gray,Object.keys(wo).forEach(function(e){wo[e].closeRe=new RegExp(TN(wo[e].close),"g"),t[e]={get:function(){return l0(this._styles.concat(e))}}}),t}(),RN=u0(function(){},c0);function bN(){var t=Array.prototype.slice.call(arguments),e=t.map(function(a){return a!=null&&a.constructor===String?a:yN.inspect(a)}).join(" ");if(!Te.enabled||!e)return e;for(var r=e.indexOf(`
2
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=wo[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(vN,function(a){return o.close+a+o.open}))}return e}Te.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){Te[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=Te[t[r][o]](i);return i}return Te[t[r]](n)}})(e)};function AN(){var t={};return Object.keys(c0).forEach(function(e){t[e]={get:function(){return l0([e])}}}),t}var EN=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};Te.trap=XT();Te.zalgo=JT();Te.maps={};Te.maps.america=e0()(Te);Te.maps.zebra=r0()(Te);Te.maps.rainbow=i0()(Te);Te.maps.random=a0()(Te);for(s0 in Te.maps)(function(t){Te[t]=function(e){return EN(Te.maps[t],e)}})(s0);var s0;u0(Te,AN())});var p0=b((LV,d0)=>{var fr=Op();d0.exports=function(){var t=function(n,i){String.prototype.__defineGetter__(n,i)};t("strip",function(){return fr.strip(this)}),t("stripColors",function(){return fr.strip(this)}),t("trap",function(){return fr.trap(this)}),t("zalgo",function(){return fr.zalgo(this)}),t("zebra",function(){return fr.zebra(this)}),t("rainbow",function(){return fr.rainbow(this)}),t("random",function(){return fr.random(this)}),t("america",function(){return fr.america(this)});var e=Object.keys(fr.styles);e.forEach(function(n){t(n,function(){return fr.stylize(this,n)})});function r(n){var i=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(n).forEach(function(o){if(i.indexOf(o)!==-1)console.log("warn: ".red+("String.prototype"+o).magenta+" is probably something you don't want to override. Ignoring style name");else if(typeof n[o]=="string")fr[o]=fr[n[o]],t(o,function(){return fr[o](this)});else{var a=function(s){for(var u=s||this,l=0;l<n[o].length;l++)u=fr[n[o][l]](u);return u};t(o,a),fr[o]=function(s){return a(s)}}})}fr.setTheme=function(n){if(typeof n=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}else r(n)}}});var Al=b((FV,h0)=>{var CN=Op();h0.exports=CN;p0()()});var Ps=b($p=>{var El=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Ip=class extends El{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};$p.CommanderError=El;$p.InvalidArgumentError=Ip});var Cl=b(Lp=>{var{InvalidArgumentError:xN}=Ps(),Mp=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(r,n)=>{if(!e.includes(r))throw new xN(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function wN(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Lp.Argument=Mp;Lp.humanReadableArgName=wN});var qp=b(m0=>{var{humanReadableArgName:SN}=Cl(),Fp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden);if(e._hasImplicitHelpCommand()){let[,n,i]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(n).helpOption(!1);o.description(e._helpCommandDescription),i&&o.arguments(i),r.push(o)}return this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}visibleOptions(e){let r=e.options.filter(o=>!o.hidden),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),i=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||i){let o;n?i?o=e.createOption(e._helpFlags,e._helpDescription):o=e.createOption(e._helpShortFlag,e._helpDescription):o=e.createOption(e._helpLongFlag,e._helpDescription),r.push(o)}if(this.sortOptions){let o=a=>a.short?a.short.replace(/^-/,""):a.long.replace(/^--/,"");r.sort((a,s)=>o(a).localeCompare(o(s)))}return r}visibleArguments(e){return e._argsDescription&&e._args.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e._args.find(r=>r.description)?e._args:[]}subcommandTerm(e){let r=e._args.map(n=>SN(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){let r=[];return e.argChoices&&!e.negate&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&!e.negate&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,a=2;function s(d,g){if(g){let C=`${d.padEnd(n+a)}${g}`;return r.wrap(C,i-o,n+a)}return d}function u(d){return d.join(`
3
3
  `).replace(/^/gm," ".repeat(o))}let l=[`Usage: ${r.commandUsage(e)}`,""],c=r.commandDescription(e);c.length>0&&(l=l.concat([c,""]));let f=r.visibleArguments(e).map(d=>s(r.argumentTerm(d),r.argumentDescription(d)));f.length>0&&(l=l.concat(["Arguments:",u(f),""]));let p=r.visibleOptions(e).map(d=>s(r.optionTerm(d),r.optionDescription(d)));p.length>0&&(l=l.concat(["Options:",u(p),""]));let h=r.visibleCommands(e).map(d=>s(r.subcommandTerm(d),r.subcommandDescription(d)));return h.length>0&&(l=l.concat(["Commands:",u(h),""])),l.join(`
4
4
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,i=40){if(e.match(/[\n]\s+/))return e;let o=r-n;if(o<i)return e;let a=e.substr(0,n),s=e.substr(n),u=" ".repeat(n),l=new RegExp(".{1,"+(o-1)+"}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)","g"),c=s.match(l)||[];return a+c.map((f,p)=>(f.slice(-1)===`
5
5
  `&&(f=f.slice(0,f.length-1)),(p>0?u:"")+f.trimRight())).join(`
6
- `)}};m0.Help=Fp});var Up=b(Gp=>{var{InvalidArgumentError:PN}=Ps(),jp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=g0(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e,this.parseArg=(r,n)=>{if(!e.includes(r))throw new PN(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return DN(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}};function DN(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function g0(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Gp.Option=jp;Gp.splitOptionFlags=g0});var v0=b(y0=>{function NN(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function ON(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(a=>a.slice(2)));let n=[],i=3,o=.4;return e.forEach(a=>{if(a.length<=1)return;let s=NN(t,a),u=Math.max(t.length,a.length);(u-s)/u>o&&(s<i?(i=s,n=[a]):s===i&&n.push(a))}),n.sort((a,s)=>a.localeCompare(s)),r&&(n=n.map(a=>`--${a}`)),n.length>1?`
6
+ `)}};m0.Help=Fp});var Up=b(Gp=>{var{InvalidArgumentError:kN}=Ps(),jp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=g0(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e,this.parseArg=(r,n)=>{if(!e.includes(r))throw new kN(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return PN(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}};function PN(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function g0(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Gp.Option=jp;Gp.splitOptionFlags=g0});var v0=b(y0=>{function DN(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function NN(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(a=>a.slice(2)));let n=[],i=3,o=.4;return e.forEach(a=>{if(a.length<=1)return;let s=DN(t,a),u=Math.max(t.length,a.length);(u-s)/u>o&&(s<i?(i=s,n=[a]):s===i&&n.push(a))}),n.sort((a,s)=>a.localeCompare(s)),r&&(n=n.map(a=>`--${a}`)),n.length>1?`
7
7
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
8
- (Did you mean ${n[0]}?)`:""}y0.suggestSimilar=ON});var A0=b(b0=>{var IN=require("events").EventEmitter,Hp=require("child_process"),So=require("path"),Bp=require("fs"),{Argument:$N,humanReadableArgName:MN}=Cl(),{CommanderError:Wp}=Ps(),{Help:LN}=qp(),{Option:FN,splitOptionFlags:qN}=Up(),{suggestSimilar:_0}=v0(),Ds=class extends IN{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!1,this._outputConfiguration={writeOut:r=>process.stdout.write(r),writeErr:r=>process.stderr.write(r),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,a,s]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(a);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,s&&u.arguments(s),this.commands.push(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new Ds(e)}createHelp(){return Object.assign(new LN,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function n(i){i.forEach(o=>{if(o._executableHandler&&!o._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${o.name()}`);n(o.commands)})}return n(e.commands),r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,r){return new $N(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this._args.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,r){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=r||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,r){let n=["preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
9
- Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Wp(e,r,n)),process.exit(e)}action(e){let r=n=>{let i=this._args.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new FN(e,r)}addOption(e){let r=e.name(),n=e.attributeName(),i=e.defaultValue;if(e.negate||e.optional||e.required||typeof i=="boolean"){if(e.negate){let a=e.long.replace(/^--no-/,"--");i=this._findOption(a)?this.getOptionValue(n):!0}i!==void 0&&this.setOptionValueWithSource(n,i,"default")}this.options.push(e);let o=(a,s,u)=>{let l=this.getOptionValue(n);if(a!==null&&e.parseArg)try{a=e.parseArg(a,l===void 0?i:l)}catch(c){if(c.code==="commander.invalidArgument"){let f=`${s} ${c.message}`;this._displayError(c.exitCode,c.code,f)}throw c}else a!==null&&e.variadic&&(a=e._concatValue(a,l));typeof l=="boolean"||typeof l>"u"?a==null?this.setOptionValueWithSource(n,e.negate?!1:i||!0,u):this.setOptionValueWithSource(n,a,u):a!==null&&this.setOptionValueWithSource(n,e.negate?!1:a,u)};return this.on("option:"+r,a=>{let s=`error: option '${e.flags}' argument '${a}' is invalid.`;o(a,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,a=>{let s=`error: option '${e.flags}' value '${a}' from env '${e.envVar}' is invalid.`;o(a,s,"env")}),this}_optionEx(e,r,n,i,o){let a=this.createOption(r,n);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(o).argParser(i);else if(i instanceof RegExp){let s=i;i=(u,l)=>{let c=s.exec(u);return c?c[0]:l},a.default(o).argParser(i)}else a.default(i);return this.addOption(a)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,!!this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this}setOptionValueWithSource(e,r,n){return this.setOptionValue(e,r),this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");r=r||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(r.from="electron")),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._scriptPath&&require.main&&(this._scriptPath=require.main.filename),this._name=this._name||this._scriptPath&&So.basename(this._scriptPath,So.extname(this._scriptPath)),n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let o=this._scriptPath;!o&&require.main&&(o=require.main.filename);let a;try{let p=Bp.realpathSync(o);a=So.dirname(p)}catch{a="."}let s=So.basename(o,So.extname(o))+"-"+e._name;e._executableFile&&(s=e._executableFile);let u=So.join(a,s);Bp.existsSync(u)?s=u:i.forEach(p=>{Bp.existsSync(`${u}${p}`)&&(s=`${u}${p}`)}),n=i.includes(So.extname(s));let l;process.platform!=="win32"?n?(r.unshift(s),r=R0(process.execArgv).concat(r),l=Hp.spawn(process.argv[0],r,{stdio:"inherit"})):l=Hp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=R0(process.execArgv).concat(r),l=Hp.spawn(process.execPath,r,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{process.on(p,()=>{l.killed===!1&&l.exitCode===null&&l.kill(p)})});let f=this._exitCallback;f?l.on("close",()=>{f(new Wp(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):l.on("close",process.exit.bind(process)),l.on("error",p=>{if(p.code==="ENOENT"){let h=`'${s}' does not exist
8
+ (Did you mean ${n[0]}?)`:""}y0.suggestSimilar=NN});var A0=b(b0=>{var ON=require("events").EventEmitter,Hp=require("child_process"),So=require("path"),Bp=require("fs"),{Argument:IN,humanReadableArgName:$N}=Cl(),{CommanderError:Wp}=Ps(),{Help:MN}=qp(),{Option:LN,splitOptionFlags:FN}=Up(),{suggestSimilar:_0}=v0(),Ds=class extends ON{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!1,this._outputConfiguration={writeOut:r=>process.stdout.write(r),writeErr:r=>process.stderr.write(r),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,a,s]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(a);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,s&&u.arguments(s),this.commands.push(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new Ds(e)}createHelp(){return Object.assign(new MN,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function n(i){i.forEach(o=>{if(o._executableHandler&&!o._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${o.name()}`);n(o.commands)})}return n(e.commands),r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,r){return new IN(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this._args.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,r){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=r||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,r){let n=["preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
9
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Wp(e,r,n)),process.exit(e)}action(e){let r=n=>{let i=this._args.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new LN(e,r)}addOption(e){let r=e.name(),n=e.attributeName(),i=e.defaultValue;if(e.negate||e.optional||e.required||typeof i=="boolean"){if(e.negate){let a=e.long.replace(/^--no-/,"--");i=this._findOption(a)?this.getOptionValue(n):!0}i!==void 0&&this.setOptionValueWithSource(n,i,"default")}this.options.push(e);let o=(a,s,u)=>{let l=this.getOptionValue(n);if(a!==null&&e.parseArg)try{a=e.parseArg(a,l===void 0?i:l)}catch(c){if(c.code==="commander.invalidArgument"){let f=`${s} ${c.message}`;this._displayError(c.exitCode,c.code,f)}throw c}else a!==null&&e.variadic&&(a=e._concatValue(a,l));typeof l=="boolean"||typeof l>"u"?a==null?this.setOptionValueWithSource(n,e.negate?!1:i||!0,u):this.setOptionValueWithSource(n,a,u):a!==null&&this.setOptionValueWithSource(n,e.negate?!1:a,u)};return this.on("option:"+r,a=>{let s=`error: option '${e.flags}' argument '${a}' is invalid.`;o(a,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,a=>{let s=`error: option '${e.flags}' value '${a}' from env '${e.envVar}' is invalid.`;o(a,s,"env")}),this}_optionEx(e,r,n,i,o){let a=this.createOption(r,n);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(o).argParser(i);else if(i instanceof RegExp){let s=i;i=(u,l)=>{let c=s.exec(u);return c?c[0]:l},a.default(o).argParser(i)}else a.default(i);return this.addOption(a)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,!!this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this}setOptionValueWithSource(e,r,n){return this.setOptionValue(e,r),this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");r=r||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(r.from="electron")),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._scriptPath&&require.main&&(this._scriptPath=require.main.filename),this._name=this._name||this._scriptPath&&So.basename(this._scriptPath,So.extname(this._scriptPath)),n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let o=this._scriptPath;!o&&require.main&&(o=require.main.filename);let a;try{let p=Bp.realpathSync(o);a=So.dirname(p)}catch{a="."}let s=So.basename(o,So.extname(o))+"-"+e._name;e._executableFile&&(s=e._executableFile);let u=So.join(a,s);Bp.existsSync(u)?s=u:i.forEach(p=>{Bp.existsSync(`${u}${p}`)&&(s=`${u}${p}`)}),n=i.includes(So.extname(s));let l;process.platform!=="win32"?n?(r.unshift(s),r=R0(process.execArgv).concat(r),l=Hp.spawn(process.argv[0],r,{stdio:"inherit"})):l=Hp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=R0(process.execArgv).concat(r),l=Hp.spawn(process.execPath,r,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{process.on(p,()=>{l.killed===!1&&l.exitCode===null&&l.kill(p)})});let f=this._exitCallback;f?l.on("close",()=>{f(new Wp(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):l.on("close",process.exit.bind(process)),l.on("error",p=>{if(p.code==="ENOENT"){let h=`'${s}' does not exist
10
10
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
11
11
  - if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(h)}else if(p.code==="EACCES")throw new Error(`'${s}' not executable`);if(!f)process.exit(1);else{let h=new Wp(1,"commander.executeSubCommandAsync","(error)");h.nestedError=p,f(h)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);if(i||this.help({error:!0}),i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}_checkNumberOfArguments(){this._args.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let a=i;if(i!==null&&n.parseArg)try{a=n.parseArg(i,o)}catch(s){if(s.code==="commander.invalidArgument"){let u=`error: command-argument value '${i}' is invalid for argument '${n.name()}'. ${s.message}`;this._displayError(s.exitCode,s.code,u)}throw s}return a};this._checkNumberOfArguments();let r=[];this._args.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((a,s)=>e(n,s,a),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return Kp(this).reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(a=>{i.push({hookedCommand:o,callback:a})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return e.length===1&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return T0(this,r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),T0(this,n.unknown),this._checkForMissingMandatoryOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&this.parent.emit(o,e,r),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent&&this.parent.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(!!e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})}parseOptions(e){let r=[],n=[],i=r,o=e.slice();function a(u){return u.length>1&&u[0]==="-"}let s=null;for(;o.length;){let u=o.shift();if(u==="--"){i===n&&i.push(u),i.push(...o);break}if(s&&!a(u)){this.emit(`option:${s.name()}`,u);continue}if(s=null,a(u)){let l=this._findOption(u);if(l){if(l.required){let c=o.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;o.length>0&&!a(o[0])&&(c=o.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);s=l.variadic?l:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let l=this._findOption(`-${u[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,u.slice(2)):(this.emit(`option:${l.name()}`),o.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let l=u.indexOf("="),c=this._findOption(u.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,u.slice(l+1));continue}}if(a(u)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),o.length>0&&n.push(...o);break}else if(u===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(u),o.length>0&&r.push(...o);break}else if(this._defaultCommandName){n.push(u),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){i.push(u),o.length>0&&i.push(...o);break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}_displayError(e,r,n){this._outputConfiguration.outputError(`${n}
12
12
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
13
13
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
14
14
  `),this.outputHelp({error:!0})),this._exit(e,r,n)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in process.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,process.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}missingArgument(e){let r=`error: missing required argument '${e}'`;this._displayError(1,"commander.missingArgument",r)}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this._displayError(1,"commander.optionMissingArgument",r)}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this._displayError(1,"commander.missingMandatoryOptionValue",r)}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let a=o.createHelp().visibleOptions(o).filter(s=>s.long).map(s=>s.long);i=i.concat(a),o=o.parent}while(o&&!o._enablePositionalOptions);r=_0(e,i)}let n=`error: unknown option '${e}'${r}`;this._displayError(1,"commander.unknownOption",n)}_excessArguments(e){if(this._allowExcessArguments)return;let r=this._args.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this._displayError(1,"commander.excessArguments",o)}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=_0(e,i)}let n=`error: unknown command '${e}'${r}`;this._displayError(1,"commander.unknownCommand",n)}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this.options.push(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
15
- `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this._args.map(n=>MN(n));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);Kp(this).reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this.emit(this._helpLongFlag),this.emit("afterHelp",n),Kp(this).forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=r||this._helpDescription;let n=qN(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let r=process.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
15
+ `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this._args.map(n=>$N(n));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);Kp(this).reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this.emit(this._helpLongFlag),this.emit("afterHelp",n),Kp(this).forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=r||this._helpDescription;let n=FN(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let r=process.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
16
16
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let a;typeof r=="function"?a=r({error:o.error,command:o.command}):a=r,a&&o.write(`${a}
17
- `)}),this}};function T0(t,e){t._hasHelpOption&&e.find(n=>n===t._helpLongFlag||n===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function R0(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Kp(t){let e=[];for(let r=t;r;r=r.parent)e.push(r);return e}b0.Command=Ds});var zp=b((En,x0)=>{var{Argument:jN}=Cl(),{Command:E0}=A0(),{CommanderError:GN,InvalidArgumentError:C0}=Ps(),{Help:UN}=qp(),{Option:HN}=Up();En=x0.exports=new E0;En.program=En;En.Argument=jN;En.Command=E0;En.CommanderError=GN;En.Help=UN;En.InvalidArgumentError=C0;En.InvalidOptionArgumentError=C0;En.Option=HN});var xl=b(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.thenable=It.typedArray=It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function BN(t){return t===!0||t===!1}It.boolean=BN;function w0(t){return typeof t=="string"||t instanceof String}It.string=w0;function WN(t){return typeof t=="number"||t instanceof Number}It.number=WN;function KN(t){return t instanceof Error}It.error=KN;function S0(t){return typeof t=="function"}It.func=S0;function k0(t){return Array.isArray(t)}It.array=k0;function zN(t){return k0(t)&&t.every(e=>w0(e))}It.stringArray=zN;function VN(t,e){return Array.isArray(t)&&t.every(e)}It.typedArray=VN;function YN(t){return t&&S0(t.then)}It.thenable=YN});var wi=b(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Vp;function Yp(){if(Vp===void 0)throw new Error("No runtime abstraction layer installed");return Vp}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Vp=r}t.install=e})(Yp||(Yp={}));Xp.default=Yp});var Zp=b(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.Disposable=void 0;var XN;(function(t){function e(r){return{dispose:r}}t.create=e})(XN=Ns.Disposable||(Ns.Disposable={}))});var P0=b(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.AbstractMessageBuffer=void 0;var ZN=13,JN=10,QN=`\r
18
- `,Jp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,r=0,n=0,i=0;e:for(;r<this._chunks.length;){let u=this._chunks[r];n=0;t:for(;n<u.length;){switch(u[n]){case ZN:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case JN:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}i+=u.byteLength,r++}if(e!==4)return;let o=this._read(i+n),a=new Map,s=this.toString(o,"ascii").split(QN);if(s.length<2)return a;for(let u=0;u<s.length-2;u++){let l=s[u],c=l.indexOf(":");if(c===-1)throw new Error("Message header must separate key and value using :");let f=l.substr(0,c),p=l.substr(c+1).trim();a.set(f,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],a=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let a=o.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};wl.AbstractMessageBuffer=Jp});var O0=b(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var eO=wi(),D0=require("util"),ko=Zp(),tO=P0(),ha=class extends tO.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return ha.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new D0.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};ha.emptyBuffer=Buffer.allocUnsafe(0);var Qp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ko.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ko.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ko.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ko.Disposable.create(()=>this.stream.off("data",e))}},eh=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ko.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ko.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ko.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let o=a=>{a==null?n():i(a)};typeof e=="string"?this.stream.write(e,r,o):this.stream.write(e,o)})}end(){this.stream.end()}},N0=Object.freeze({messageBuffer:Object.freeze({create:t=>new ha(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new D0.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new Qp(t),asWritableStream:t=>new eh(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function th(){return N0}(function(t){function e(){eO.default.install(N0)}t.install=e})(th||(th={}));rh.default=th});var ma=b(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.stringArray=dr.array=dr.func=dr.error=dr.number=dr.string=dr.boolean=void 0;function rO(t){return t===!0||t===!1}dr.boolean=rO;function I0(t){return typeof t=="string"||t instanceof String}dr.string=I0;function nO(t){return typeof t=="number"||t instanceof Number}dr.number=nO;function iO(t){return t instanceof Error}dr.error=iO;function oO(t){return typeof t=="function"}dr.func=oO;function $0(t){return Array.isArray(t)}dr.array=$0;function aO(t){return $0(t)&&t.every(e=>I0(e))}dr.stringArray=aO});var Ch=b(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.Message=ee.NotificationType9=ee.NotificationType8=ee.NotificationType7=ee.NotificationType6=ee.NotificationType5=ee.NotificationType4=ee.NotificationType3=ee.NotificationType2=ee.NotificationType1=ee.NotificationType0=ee.NotificationType=ee.RequestType9=ee.RequestType8=ee.RequestType7=ee.RequestType6=ee.RequestType5=ee.RequestType4=ee.RequestType3=ee.RequestType2=ee.RequestType1=ee.RequestType=ee.RequestType0=ee.AbstractMessageSignature=ee.ParameterStructures=ee.ResponseError=ee.ErrorCodes=void 0;var Po=ma(),M0;(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})(M0=ee.ErrorCodes||(ee.ErrorCodes={}));var Os=class extends Error{constructor(e,r,n){super(r),this.code=Po.number(e)?e:M0.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,Os.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ee.ResponseError=Os;var zt=class{constructor(e){this.kind=e}static is(e){return e===zt.auto||e===zt.byName||e===zt.byPosition}toString(){return this.kind}};ee.ParameterStructures=zt;zt.auto=new zt("auto");zt.byPosition=new zt("byPosition");zt.byName=new zt("byName");var lt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return zt.auto}};ee.AbstractMessageSignature=lt;var nh=class extends lt{constructor(e){super(e,0)}};ee.RequestType0=nh;var ih=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType=ih;var oh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType1=oh;var ah=class extends lt{constructor(e){super(e,2)}};ee.RequestType2=ah;var sh=class extends lt{constructor(e){super(e,3)}};ee.RequestType3=sh;var uh=class extends lt{constructor(e){super(e,4)}};ee.RequestType4=uh;var lh=class extends lt{constructor(e){super(e,5)}};ee.RequestType5=lh;var ch=class extends lt{constructor(e){super(e,6)}};ee.RequestType6=ch;var fh=class extends lt{constructor(e){super(e,7)}};ee.RequestType7=fh;var dh=class extends lt{constructor(e){super(e,8)}};ee.RequestType8=dh;var ph=class extends lt{constructor(e){super(e,9)}};ee.RequestType9=ph;var hh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType=hh;var mh=class extends lt{constructor(e){super(e,0)}};ee.NotificationType0=mh;var gh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType1=gh;var yh=class extends lt{constructor(e){super(e,2)}};ee.NotificationType2=yh;var vh=class extends lt{constructor(e){super(e,3)}};ee.NotificationType3=vh;var _h=class extends lt{constructor(e){super(e,4)}};ee.NotificationType4=_h;var Th=class extends lt{constructor(e){super(e,5)}};ee.NotificationType5=Th;var Rh=class extends lt{constructor(e){super(e,6)}};ee.NotificationType6=Rh;var bh=class extends lt{constructor(e){super(e,7)}};ee.NotificationType7=bh;var Ah=class extends lt{constructor(e){super(e,8)}};ee.NotificationType8=Ah;var Eh=class extends lt{constructor(e){super(e,9)}};ee.NotificationType9=Eh;var sO;(function(t){function e(i){let o=i;return o&&Po.string(o.method)&&(Po.string(o.id)||Po.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Po.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Po.string(o.id)||Po.number(o.id)||o.id===null)}t.isResponse=n})(sO=ee.Message||(ee.Message={}))});var wh=b(Si=>{"use strict";var L0;Object.defineProperty(Si,"__esModule",{value:!0});Si.LRUCache=Si.LinkedMap=Si.Touch=void 0;var Ar;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ar=Si.Touch||(Si.Touch={}));var Sl=class{constructor(){this[L0]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Ar.None){let n=this._map.get(e);if(!!n)return r!==Ar.None&&this.touch(n,r),n.value}set(e,r,n=Ar.None){let i=this._map.get(e);if(i)i.value=r,n!==Ar.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ar.None:this.addItemLast(i);break;case Ar.First:this.addItemFirst(i);break;case Ar.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(!!r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(L0=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ar.First&&r!==Ar.Last)){if(r===Ar.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ar.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Si.LinkedMap=Sl;var xh=class extends Sl{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Ar.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ar.None)}set(e,r){return super.set(e,r,Ar.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Si.LRUCache=xh});var ya=b(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.Emitter=Do.Event=void 0;var uO=wi(),lO;(function(t){let e={dispose(){}};t.None=function(){return e}})(lO=Do.Event||(Do.Event={}));var Sh=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,a=n.length;o<a;o++)try{r.push(n[o].apply(i[o],e))}catch(s){(0,uO.default)().console.error(s)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ga=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Sh),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,r),i.dispose=ga._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Do.Emitter=ga;ga._noop=function(){}});var Nh=b(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.CancellationTokenSource=No.CancellationToken=void 0;var cO=wi(),fO=ma(),kh=ya(),Ph;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kh.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:kh.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||fO.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Ph=No.CancellationToken||(No.CancellationToken={}));var dO=Object.freeze(function(t,e){let r=(0,cO.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),kl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?dO:(this._emitter||(this._emitter=new kh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Dh=class{get token(){return this._token||(this._token=new kl),this._token}cancel(){this._token?this._token.cancel():this._token=Ph.Cancelled}dispose(){this._token?this._token instanceof kl&&this._token.dispose():this._token=Ph.None}};No.CancellationTokenSource=Dh});var F0=b(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ReadableStreamMessageReader=ki.AbstractMessageReader=ki.MessageReader=void 0;var Ih=wi(),va=ma(),Oh=ya(),pO;(function(t){function e(r){let n=r;return n&&va.func(n.listen)&&va.func(n.dispose)&&va.func(n.onError)&&va.func(n.onClose)&&va.func(n.onPartialMessage)}t.is=e})(pO=ki.MessageReader||(ki.MessageReader={}));var Pl=class{constructor(){this.errorEmitter=new Oh.Emitter,this.closeEmitter=new Oh.Emitter,this.partialMessageEmitter=new Oh.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: ${va.string(e.message)?e.message:"unknown"}`)}};ki.AbstractMessageReader=Pl;var $h;(function(t){function e(r){let n,i,o,a=new Map,s,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,a.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)a.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(s=r.contentTypeDecoder,u.set(s.name,s)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)u.set(l.name,l)}return s===void 0&&(s=(0,Ih.default)().applicationJson.decoder,u.set(s.name,s)),{charset:n,contentDecoder:o,contentDecoders:a,contentTypeDecoder:s,contentTypeDecoders:u}}t.fromOptions=e})($h||($h={}));var Mh=class extends Pl{constructor(e,r){super(),this.readable=e,this.options=$h.fromOptions(r),this.buffer=(0,Ih.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let o=i.get("Content-Length");if(!o)throw new Error("Header must provide a Content-Length property.");let a=parseInt(o);if(isNaN(a))throw new Error("Content-Length value must be a number.");this.nextMessageLength=a}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let n;this.options.contentDecoder!==void 0?n=this.options.contentDecoder.decode(r):n=Promise.resolve(r),n.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(o=>{this.callback(o)},o=>{this.fireError(o)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ih.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ki.ReadableStreamMessageReader=Mh});var q0=b(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.Semaphore=void 0;var hO=wi(),Lh=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,hO.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Dl.Semaphore=Lh});var H0=b(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.WriteableStreamMessageWriter=Pi.AbstractMessageWriter=Pi.MessageWriter=void 0;var j0=wi(),Is=ma(),mO=q0(),G0=ya(),gO="Content-Length: ",U0=`\r
19
- `,yO;(function(t){function e(r){let n=r;return n&&Is.func(n.dispose)&&Is.func(n.onClose)&&Is.func(n.onError)&&Is.func(n.write)}t.is=e})(yO=Pi.MessageWriter||(Pi.MessageWriter={}));var Nl=class{constructor(){this.errorEmitter=new G0.Emitter,this.closeEmitter=new G0.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Is.string(e.message)?e.message:"unknown"}`)}};Pi.AbstractMessageWriter=Nl;var Fh;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,j0.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,j0.default)().applicationJson.encoder}}t.fromOptions=e})(Fh||(Fh={}));var qh=class extends Nl{constructor(e,r){super(),this.writable=e,this.options=Fh.fromOptions(r),this.errorCount=0,this.writeSemaphore=new mO.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(gO,n.byteLength.toString(),U0),i.push(U0),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Pi.WriteableStreamMessageWriter=qh});var Y0=b(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.ConnectionOptions=ae.CancellationStrategy=ae.CancellationSenderStrategy=ae.CancellationReceiverStrategy=ae.ConnectionStrategy=ae.ConnectionError=ae.ConnectionErrors=ae.LogTraceNotification=ae.SetTraceNotification=ae.TraceFormat=ae.TraceValues=ae.Trace=ae.NullLogger=ae.ProgressType=ae.ProgressToken=void 0;var B0=wi(),Ht=ma(),ue=Ch(),W0=wh(),$s=ya(),jh=Nh(),Ls;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(Ls||(Ls={}));var K0;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(K0=ae.ProgressToken||(ae.ProgressToken={}));var Ms;(function(t){t.type=new ue.NotificationType("$/progress")})(Ms||(Ms={}));var Gh=class{constructor(){}};ae.ProgressType=Gh;var Uh;(function(t){function e(r){return Ht.func(r)}t.is=e})(Uh||(Uh={}));ae.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var He;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(He=ae.Trace||(ae.Trace={}));var vO;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(vO=ae.TraceValues||(ae.TraceValues={}));(function(t){function e(n){if(!Ht.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(He=ae.Trace||(ae.Trace={}));var Cn;(function(t){t.Text="text",t.JSON="json"})(Cn=ae.TraceFormat||(ae.TraceFormat={}));(function(t){function e(r){return Ht.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Cn=ae.TraceFormat||(ae.TraceFormat={}));var z0;(function(t){t.type=new ue.NotificationType("$/setTrace")})(z0=ae.SetTraceNotification||(ae.SetTraceNotification={}));var Hh;(function(t){t.type=new ue.NotificationType("$/logTrace")})(Hh=ae.LogTraceNotification||(ae.LogTraceNotification={}));var Ol;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ol=ae.ConnectionErrors||(ae.ConnectionErrors={}));var Xi=class extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,Xi.prototype)}};ae.ConnectionError=Xi;var V0;(function(t){function e(r){let n=r;return n&&Ht.func(n.cancelUndispatched)}t.is=e})(V0=ae.ConnectionStrategy||(ae.ConnectionStrategy={}));var Bh;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new jh.CancellationTokenSource}});function e(r){let n=r;return n&&Ht.func(n.createCancellationTokenSource)}t.is=e})(Bh=ae.CancellationReceiverStrategy||(ae.CancellationReceiverStrategy={}));var Wh;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Ls.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Ht.func(n.sendCancellation)&&Ht.func(n.cleanup)}t.is=e})(Wh=ae.CancellationSenderStrategy||(ae.CancellationSenderStrategy={}));var Kh;(function(t){t.Message=Object.freeze({receiver:Bh.Message,sender:Wh.Message});function e(r){let n=r;return n&&Bh.is(n.receiver)&&Wh.is(n.sender)}t.is=e})(Kh=ae.CancellationStrategy||(ae.CancellationStrategy={}));var _O;(function(t){function e(r){let n=r;return n&&(Kh.is(n.cancellationStrategy)||V0.is(n.connectionStrategy))}t.is=e})(_O=ae.ConnectionOptions||(ae.ConnectionOptions={}));var xn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(xn||(xn={}));function TO(t,e,r,n){let i=r!==void 0?r:ae.NullLogger,o=0,a=0,s=0,u="2.0",l,c=new Map,f,p=new Map,h=new Map,d,g=new W0.LinkedMap,C=new Map,x=new Set,T=new Map,v=He.Off,k=Cn.Text,j,O=xn.New,$=new $s.Emitter,X=new $s.Emitter,J=new $s.Emitter,le=new $s.Emitter,pe=new $s.Emitter,G=n&&n.cancellationStrategy?n.cancellationStrategy:Kh.Message;function I(w){if(w===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+w.toString()}function U(w){return w===null?"res-unknown-"+(++s).toString():"res-"+w.toString()}function z(){return"not-"+(++a).toString()}function de(w,F){ue.Message.isRequest(F)?w.set(I(F.id),F):ue.Message.isResponse(F)?w.set(U(F.id),F):w.set(z(),F)}function ie(w){}function re(){return O===xn.Listening}function he(){return O===xn.Closed}function me(){return O===xn.Disposed}function ze(){(O===xn.New||O===xn.Listening)&&(O=xn.Closed,X.fire(void 0))}function H(w){$.fire([w,void 0,void 0])}function K(w){$.fire(w)}t.onClose(ze),t.onError(H),e.onClose(ze),e.onError(K);function ne(){d||g.size===0||(d=(0,B0.default)().timer.setImmediate(()=>{d=void 0,Me()}))}function Me(){if(g.size===0)return;let w=g.shift();try{ue.Message.isRequest(w)?Nr(w):ue.Message.isNotification(w)?Or(w):ue.Message.isResponse(w)?Ur(w):_t(w)}finally{ne()}}let Ne=w=>{try{if(ue.Message.isNotification(w)&&w.method===Ls.type.method){let F=w.params.id,W=I(F),Q=g.get(W);if(ue.Message.isRequest(Q)){let Ye=n?.connectionStrategy,dt=Ye&&Ye.cancelUndispatched?Ye.cancelUndispatched(Q,ie):void 0;if(dt&&(dt.error!==void 0||dt.result!==void 0)){g.delete(W),T.delete(F),dt.id=Q.id,Qt(dt,w.method,Date.now()),e.write(dt).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ve=T.get(F);if(Ve!==void 0){Ve.cancel(),_n(w);return}else x.add(F)}de(g,w)}finally{ne()}};function Nr(w){if(me())return;function F(Ee,tt,Pe){let Dt={jsonrpc:u,id:w.id};Ee instanceof ue.ResponseError?Dt.error=Ee.toJson():Dt.result=Ee===void 0?null:Ee,Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}function W(Ee,tt,Pe){let Dt={jsonrpc:u,id:w.id,error:Ee.toJson()};Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}function Q(Ee,tt,Pe){Ee===void 0&&(Ee=null);let Dt={jsonrpc:u,id:w.id,result:Ee};Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}Br(w);let Ve=c.get(w.method),Ye,dt;Ve&&(Ye=Ve.type,dt=Ve.handler);let Ot=Date.now();if(dt||l){let Ee=w.id??String(Date.now()),tt=G.receiver.createCancellationTokenSource(Ee);w.id!==null&&x.has(w.id)&&tt.cancel(),w.id!==null&&T.set(Ee,tt);try{let Pe;if(dt)if(w.params===void 0){if(Ye!==void 0&&Ye.numberOfParams!==0){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines ${Ye.numberOfParams} params but received none.`),w.method,Ot);return}Pe=dt(tt.token)}else if(Array.isArray(w.params)){if(Ye!==void 0&&Ye.parameterStructures===ue.ParameterStructures.byName){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by name but received parameters by position`),w.method,Ot);return}Pe=dt(...w.params,tt.token)}else{if(Ye!==void 0&&Ye.parameterStructures===ue.ParameterStructures.byPosition){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by position but received parameters by name`),w.method,Ot);return}Pe=dt(w.params,tt.token)}else l&&(Pe=l(w.method,w.params,tt.token));let Dt=Pe;Pe?Dt.then?Dt.then(cr=>{T.delete(Ee),F(cr,w.method,Ot)},cr=>{T.delete(Ee),cr instanceof ue.ResponseError?W(cr,w.method,Ot):cr&&Ht.string(cr.message)?W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${cr.message}`),w.method,Ot):W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,Ot)}):(T.delete(Ee),F(Pe,w.method,Ot)):(T.delete(Ee),Q(Pe,w.method,Ot))}catch(Pe){T.delete(Ee),Pe instanceof ue.ResponseError?F(Pe,w.method,Ot):Pe&&Ht.string(Pe.message)?W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${Pe.message}`),w.method,Ot):W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,Ot)}}else W(new ue.ResponseError(ue.ErrorCodes.MethodNotFound,`Unhandled method ${w.method}`),w.method,Ot)}function Ur(w){if(!me())if(w.id===null)w.error?i.error(`Received response message without id: Error is:
17
+ `)}),this}};function T0(t,e){t._hasHelpOption&&e.find(n=>n===t._helpLongFlag||n===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function R0(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Kp(t){let e=[];for(let r=t;r;r=r.parent)e.push(r);return e}b0.Command=Ds});var zp=b((En,x0)=>{var{Argument:qN}=Cl(),{Command:E0}=A0(),{CommanderError:jN,InvalidArgumentError:C0}=Ps(),{Help:GN}=qp(),{Option:UN}=Up();En=x0.exports=new E0;En.program=En;En.Argument=qN;En.Command=E0;En.CommanderError=jN;En.Help=GN;En.InvalidArgumentError=C0;En.InvalidOptionArgumentError=C0;En.Option=UN});var xl=b(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.thenable=It.typedArray=It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function HN(t){return t===!0||t===!1}It.boolean=HN;function w0(t){return typeof t=="string"||t instanceof String}It.string=w0;function BN(t){return typeof t=="number"||t instanceof Number}It.number=BN;function WN(t){return t instanceof Error}It.error=WN;function S0(t){return typeof t=="function"}It.func=S0;function k0(t){return Array.isArray(t)}It.array=k0;function KN(t){return k0(t)&&t.every(e=>w0(e))}It.stringArray=KN;function zN(t,e){return Array.isArray(t)&&t.every(e)}It.typedArray=zN;function VN(t){return t&&S0(t.then)}It.thenable=VN});var wi=b(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Vp;function Yp(){if(Vp===void 0)throw new Error("No runtime abstraction layer installed");return Vp}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Vp=r}t.install=e})(Yp||(Yp={}));Xp.default=Yp});var Zp=b(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.Disposable=void 0;var YN;(function(t){function e(r){return{dispose:r}}t.create=e})(YN=Ns.Disposable||(Ns.Disposable={}))});var P0=b(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.AbstractMessageBuffer=void 0;var XN=13,ZN=10,JN=`\r
18
+ `,Jp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,r=0,n=0,i=0;e:for(;r<this._chunks.length;){let u=this._chunks[r];n=0;t:for(;n<u.length;){switch(u[n]){case XN:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case ZN:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}i+=u.byteLength,r++}if(e!==4)return;let o=this._read(i+n),a=new Map,s=this.toString(o,"ascii").split(JN);if(s.length<2)return a;for(let u=0;u<s.length-2;u++){let l=s[u],c=l.indexOf(":");if(c===-1)throw new Error("Message header must separate key and value using :");let f=l.substr(0,c),p=l.substr(c+1).trim();a.set(f,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],a=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let a=o.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};wl.AbstractMessageBuffer=Jp});var O0=b(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var QN=wi(),D0=require("util"),ko=Zp(),eO=P0(),ha=class extends eO.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return ha.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new D0.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};ha.emptyBuffer=Buffer.allocUnsafe(0);var Qp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ko.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ko.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ko.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ko.Disposable.create(()=>this.stream.off("data",e))}},eh=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ko.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ko.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ko.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let o=a=>{a==null?n():i(a)};typeof e=="string"?this.stream.write(e,r,o):this.stream.write(e,o)})}end(){this.stream.end()}},N0=Object.freeze({messageBuffer:Object.freeze({create:t=>new ha(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new D0.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new Qp(t),asWritableStream:t=>new eh(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function th(){return N0}(function(t){function e(){QN.default.install(N0)}t.install=e})(th||(th={}));rh.default=th});var ma=b(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.stringArray=dr.array=dr.func=dr.error=dr.number=dr.string=dr.boolean=void 0;function tO(t){return t===!0||t===!1}dr.boolean=tO;function I0(t){return typeof t=="string"||t instanceof String}dr.string=I0;function rO(t){return typeof t=="number"||t instanceof Number}dr.number=rO;function nO(t){return t instanceof Error}dr.error=nO;function iO(t){return typeof t=="function"}dr.func=iO;function $0(t){return Array.isArray(t)}dr.array=$0;function oO(t){return $0(t)&&t.every(e=>I0(e))}dr.stringArray=oO});var Ch=b(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.Message=ee.NotificationType9=ee.NotificationType8=ee.NotificationType7=ee.NotificationType6=ee.NotificationType5=ee.NotificationType4=ee.NotificationType3=ee.NotificationType2=ee.NotificationType1=ee.NotificationType0=ee.NotificationType=ee.RequestType9=ee.RequestType8=ee.RequestType7=ee.RequestType6=ee.RequestType5=ee.RequestType4=ee.RequestType3=ee.RequestType2=ee.RequestType1=ee.RequestType=ee.RequestType0=ee.AbstractMessageSignature=ee.ParameterStructures=ee.ResponseError=ee.ErrorCodes=void 0;var Po=ma(),M0;(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})(M0=ee.ErrorCodes||(ee.ErrorCodes={}));var Os=class extends Error{constructor(e,r,n){super(r),this.code=Po.number(e)?e:M0.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,Os.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ee.ResponseError=Os;var zt=class{constructor(e){this.kind=e}static is(e){return e===zt.auto||e===zt.byName||e===zt.byPosition}toString(){return this.kind}};ee.ParameterStructures=zt;zt.auto=new zt("auto");zt.byPosition=new zt("byPosition");zt.byName=new zt("byName");var lt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return zt.auto}};ee.AbstractMessageSignature=lt;var nh=class extends lt{constructor(e){super(e,0)}};ee.RequestType0=nh;var ih=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType=ih;var oh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType1=oh;var ah=class extends lt{constructor(e){super(e,2)}};ee.RequestType2=ah;var sh=class extends lt{constructor(e){super(e,3)}};ee.RequestType3=sh;var uh=class extends lt{constructor(e){super(e,4)}};ee.RequestType4=uh;var lh=class extends lt{constructor(e){super(e,5)}};ee.RequestType5=lh;var ch=class extends lt{constructor(e){super(e,6)}};ee.RequestType6=ch;var fh=class extends lt{constructor(e){super(e,7)}};ee.RequestType7=fh;var dh=class extends lt{constructor(e){super(e,8)}};ee.RequestType8=dh;var ph=class extends lt{constructor(e){super(e,9)}};ee.RequestType9=ph;var hh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType=hh;var mh=class extends lt{constructor(e){super(e,0)}};ee.NotificationType0=mh;var gh=class extends lt{constructor(e,r=zt.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType1=gh;var yh=class extends lt{constructor(e){super(e,2)}};ee.NotificationType2=yh;var vh=class extends lt{constructor(e){super(e,3)}};ee.NotificationType3=vh;var _h=class extends lt{constructor(e){super(e,4)}};ee.NotificationType4=_h;var Th=class extends lt{constructor(e){super(e,5)}};ee.NotificationType5=Th;var Rh=class extends lt{constructor(e){super(e,6)}};ee.NotificationType6=Rh;var bh=class extends lt{constructor(e){super(e,7)}};ee.NotificationType7=bh;var Ah=class extends lt{constructor(e){super(e,8)}};ee.NotificationType8=Ah;var Eh=class extends lt{constructor(e){super(e,9)}};ee.NotificationType9=Eh;var aO;(function(t){function e(i){let o=i;return o&&Po.string(o.method)&&(Po.string(o.id)||Po.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Po.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Po.string(o.id)||Po.number(o.id)||o.id===null)}t.isResponse=n})(aO=ee.Message||(ee.Message={}))});var wh=b(Si=>{"use strict";var L0;Object.defineProperty(Si,"__esModule",{value:!0});Si.LRUCache=Si.LinkedMap=Si.Touch=void 0;var Ar;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ar=Si.Touch||(Si.Touch={}));var Sl=class{constructor(){this[L0]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Ar.None){let n=this._map.get(e);if(!!n)return r!==Ar.None&&this.touch(n,r),n.value}set(e,r,n=Ar.None){let i=this._map.get(e);if(i)i.value=r,n!==Ar.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ar.None:this.addItemLast(i);break;case Ar.First:this.addItemFirst(i);break;case Ar.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(!!r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(L0=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ar.First&&r!==Ar.Last)){if(r===Ar.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ar.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Si.LinkedMap=Sl;var xh=class extends Sl{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Ar.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ar.None)}set(e,r){return super.set(e,r,Ar.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Si.LRUCache=xh});var ya=b(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.Emitter=Do.Event=void 0;var sO=wi(),uO;(function(t){let e={dispose(){}};t.None=function(){return e}})(uO=Do.Event||(Do.Event={}));var Sh=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,a=n.length;o<a;o++)try{r.push(n[o].apply(i[o],e))}catch(s){(0,sO.default)().console.error(s)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ga=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Sh),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,r),i.dispose=ga._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Do.Emitter=ga;ga._noop=function(){}});var Nh=b(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.CancellationTokenSource=No.CancellationToken=void 0;var lO=wi(),cO=ma(),kh=ya(),Ph;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kh.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:kh.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||cO.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Ph=No.CancellationToken||(No.CancellationToken={}));var fO=Object.freeze(function(t,e){let r=(0,lO.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),kl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?fO:(this._emitter||(this._emitter=new kh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Dh=class{get token(){return this._token||(this._token=new kl),this._token}cancel(){this._token?this._token.cancel():this._token=Ph.Cancelled}dispose(){this._token?this._token instanceof kl&&this._token.dispose():this._token=Ph.None}};No.CancellationTokenSource=Dh});var F0=b(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ReadableStreamMessageReader=ki.AbstractMessageReader=ki.MessageReader=void 0;var Ih=wi(),va=ma(),Oh=ya(),dO;(function(t){function e(r){let n=r;return n&&va.func(n.listen)&&va.func(n.dispose)&&va.func(n.onError)&&va.func(n.onClose)&&va.func(n.onPartialMessage)}t.is=e})(dO=ki.MessageReader||(ki.MessageReader={}));var Pl=class{constructor(){this.errorEmitter=new Oh.Emitter,this.closeEmitter=new Oh.Emitter,this.partialMessageEmitter=new Oh.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: ${va.string(e.message)?e.message:"unknown"}`)}};ki.AbstractMessageReader=Pl;var $h;(function(t){function e(r){let n,i,o,a=new Map,s,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,a.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)a.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(s=r.contentTypeDecoder,u.set(s.name,s)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)u.set(l.name,l)}return s===void 0&&(s=(0,Ih.default)().applicationJson.decoder,u.set(s.name,s)),{charset:n,contentDecoder:o,contentDecoders:a,contentTypeDecoder:s,contentTypeDecoders:u}}t.fromOptions=e})($h||($h={}));var Mh=class extends Pl{constructor(e,r){super(),this.readable=e,this.options=$h.fromOptions(r),this.buffer=(0,Ih.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let o=i.get("Content-Length");if(!o)throw new Error("Header must provide a Content-Length property.");let a=parseInt(o);if(isNaN(a))throw new Error("Content-Length value must be a number.");this.nextMessageLength=a}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let n;this.options.contentDecoder!==void 0?n=this.options.contentDecoder.decode(r):n=Promise.resolve(r),n.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(o=>{this.callback(o)},o=>{this.fireError(o)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ih.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ki.ReadableStreamMessageReader=Mh});var q0=b(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.Semaphore=void 0;var pO=wi(),Lh=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,pO.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Dl.Semaphore=Lh});var H0=b(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.WriteableStreamMessageWriter=Pi.AbstractMessageWriter=Pi.MessageWriter=void 0;var j0=wi(),Is=ma(),hO=q0(),G0=ya(),mO="Content-Length: ",U0=`\r
19
+ `,gO;(function(t){function e(r){let n=r;return n&&Is.func(n.dispose)&&Is.func(n.onClose)&&Is.func(n.onError)&&Is.func(n.write)}t.is=e})(gO=Pi.MessageWriter||(Pi.MessageWriter={}));var Nl=class{constructor(){this.errorEmitter=new G0.Emitter,this.closeEmitter=new G0.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Is.string(e.message)?e.message:"unknown"}`)}};Pi.AbstractMessageWriter=Nl;var Fh;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,j0.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,j0.default)().applicationJson.encoder}}t.fromOptions=e})(Fh||(Fh={}));var qh=class extends Nl{constructor(e,r){super(),this.writable=e,this.options=Fh.fromOptions(r),this.errorCount=0,this.writeSemaphore=new hO.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(mO,n.byteLength.toString(),U0),i.push(U0),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Pi.WriteableStreamMessageWriter=qh});var Y0=b(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.ConnectionOptions=ae.CancellationStrategy=ae.CancellationSenderStrategy=ae.CancellationReceiverStrategy=ae.ConnectionStrategy=ae.ConnectionError=ae.ConnectionErrors=ae.LogTraceNotification=ae.SetTraceNotification=ae.TraceFormat=ae.TraceValues=ae.Trace=ae.NullLogger=ae.ProgressType=ae.ProgressToken=void 0;var B0=wi(),Ht=ma(),ue=Ch(),W0=wh(),$s=ya(),jh=Nh(),Ls;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(Ls||(Ls={}));var K0;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(K0=ae.ProgressToken||(ae.ProgressToken={}));var Ms;(function(t){t.type=new ue.NotificationType("$/progress")})(Ms||(Ms={}));var Gh=class{constructor(){}};ae.ProgressType=Gh;var Uh;(function(t){function e(r){return Ht.func(r)}t.is=e})(Uh||(Uh={}));ae.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var He;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(He=ae.Trace||(ae.Trace={}));var yO;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(yO=ae.TraceValues||(ae.TraceValues={}));(function(t){function e(n){if(!Ht.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(He=ae.Trace||(ae.Trace={}));var Cn;(function(t){t.Text="text",t.JSON="json"})(Cn=ae.TraceFormat||(ae.TraceFormat={}));(function(t){function e(r){return Ht.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Cn=ae.TraceFormat||(ae.TraceFormat={}));var z0;(function(t){t.type=new ue.NotificationType("$/setTrace")})(z0=ae.SetTraceNotification||(ae.SetTraceNotification={}));var Hh;(function(t){t.type=new ue.NotificationType("$/logTrace")})(Hh=ae.LogTraceNotification||(ae.LogTraceNotification={}));var Ol;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ol=ae.ConnectionErrors||(ae.ConnectionErrors={}));var Xi=class extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,Xi.prototype)}};ae.ConnectionError=Xi;var V0;(function(t){function e(r){let n=r;return n&&Ht.func(n.cancelUndispatched)}t.is=e})(V0=ae.ConnectionStrategy||(ae.ConnectionStrategy={}));var Bh;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new jh.CancellationTokenSource}});function e(r){let n=r;return n&&Ht.func(n.createCancellationTokenSource)}t.is=e})(Bh=ae.CancellationReceiverStrategy||(ae.CancellationReceiverStrategy={}));var Wh;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Ls.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Ht.func(n.sendCancellation)&&Ht.func(n.cleanup)}t.is=e})(Wh=ae.CancellationSenderStrategy||(ae.CancellationSenderStrategy={}));var Kh;(function(t){t.Message=Object.freeze({receiver:Bh.Message,sender:Wh.Message});function e(r){let n=r;return n&&Bh.is(n.receiver)&&Wh.is(n.sender)}t.is=e})(Kh=ae.CancellationStrategy||(ae.CancellationStrategy={}));var vO;(function(t){function e(r){let n=r;return n&&(Kh.is(n.cancellationStrategy)||V0.is(n.connectionStrategy))}t.is=e})(vO=ae.ConnectionOptions||(ae.ConnectionOptions={}));var xn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(xn||(xn={}));function _O(t,e,r,n){let i=r!==void 0?r:ae.NullLogger,o=0,a=0,s=0,u="2.0",l,c=new Map,f,p=new Map,h=new Map,d,g=new W0.LinkedMap,C=new Map,x=new Set,T=new Map,v=He.Off,k=Cn.Text,j,O=xn.New,$=new $s.Emitter,X=new $s.Emitter,J=new $s.Emitter,le=new $s.Emitter,pe=new $s.Emitter,G=n&&n.cancellationStrategy?n.cancellationStrategy:Kh.Message;function I(w){if(w===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+w.toString()}function U(w){return w===null?"res-unknown-"+(++s).toString():"res-"+w.toString()}function z(){return"not-"+(++a).toString()}function de(w,F){ue.Message.isRequest(F)?w.set(I(F.id),F):ue.Message.isResponse(F)?w.set(U(F.id),F):w.set(z(),F)}function ie(w){}function re(){return O===xn.Listening}function he(){return O===xn.Closed}function me(){return O===xn.Disposed}function ze(){(O===xn.New||O===xn.Listening)&&(O=xn.Closed,X.fire(void 0))}function H(w){$.fire([w,void 0,void 0])}function K(w){$.fire(w)}t.onClose(ze),t.onError(H),e.onClose(ze),e.onError(K);function ne(){d||g.size===0||(d=(0,B0.default)().timer.setImmediate(()=>{d=void 0,Me()}))}function Me(){if(g.size===0)return;let w=g.shift();try{ue.Message.isRequest(w)?Nr(w):ue.Message.isNotification(w)?Or(w):ue.Message.isResponse(w)?Ur(w):_t(w)}finally{ne()}}let Ne=w=>{try{if(ue.Message.isNotification(w)&&w.method===Ls.type.method){let F=w.params.id,W=I(F),Q=g.get(W);if(ue.Message.isRequest(Q)){let Ye=n?.connectionStrategy,dt=Ye&&Ye.cancelUndispatched?Ye.cancelUndispatched(Q,ie):void 0;if(dt&&(dt.error!==void 0||dt.result!==void 0)){g.delete(W),T.delete(F),dt.id=Q.id,Qt(dt,w.method,Date.now()),e.write(dt).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ve=T.get(F);if(Ve!==void 0){Ve.cancel(),_n(w);return}else x.add(F)}de(g,w)}finally{ne()}};function Nr(w){if(me())return;function F(Ee,tt,Pe){let Dt={jsonrpc:u,id:w.id};Ee instanceof ue.ResponseError?Dt.error=Ee.toJson():Dt.result=Ee===void 0?null:Ee,Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}function W(Ee,tt,Pe){let Dt={jsonrpc:u,id:w.id,error:Ee.toJson()};Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}function Q(Ee,tt,Pe){Ee===void 0&&(Ee=null);let Dt={jsonrpc:u,id:w.id,result:Ee};Qt(Dt,tt,Pe),e.write(Dt).catch(()=>i.error("Sending response failed."))}Br(w);let Ve=c.get(w.method),Ye,dt;Ve&&(Ye=Ve.type,dt=Ve.handler);let Ot=Date.now();if(dt||l){let Ee=w.id??String(Date.now()),tt=G.receiver.createCancellationTokenSource(Ee);w.id!==null&&x.has(w.id)&&tt.cancel(),w.id!==null&&T.set(Ee,tt);try{let Pe;if(dt)if(w.params===void 0){if(Ye!==void 0&&Ye.numberOfParams!==0){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines ${Ye.numberOfParams} params but received none.`),w.method,Ot);return}Pe=dt(tt.token)}else if(Array.isArray(w.params)){if(Ye!==void 0&&Ye.parameterStructures===ue.ParameterStructures.byName){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by name but received parameters by position`),w.method,Ot);return}Pe=dt(...w.params,tt.token)}else{if(Ye!==void 0&&Ye.parameterStructures===ue.ParameterStructures.byPosition){W(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by position but received parameters by name`),w.method,Ot);return}Pe=dt(w.params,tt.token)}else l&&(Pe=l(w.method,w.params,tt.token));let Dt=Pe;Pe?Dt.then?Dt.then(cr=>{T.delete(Ee),F(cr,w.method,Ot)},cr=>{T.delete(Ee),cr instanceof ue.ResponseError?W(cr,w.method,Ot):cr&&Ht.string(cr.message)?W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${cr.message}`),w.method,Ot):W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,Ot)}):(T.delete(Ee),F(Pe,w.method,Ot)):(T.delete(Ee),Q(Pe,w.method,Ot))}catch(Pe){T.delete(Ee),Pe instanceof ue.ResponseError?F(Pe,w.method,Ot):Pe&&Ht.string(Pe.message)?W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${Pe.message}`),w.method,Ot):W(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,Ot)}}else W(new ue.ResponseError(ue.ErrorCodes.MethodNotFound,`Unhandled method ${w.method}`),w.method,Ot)}function Ur(w){if(!me())if(w.id===null)w.error?i.error(`Received response message without id: Error is:
20
20
  ${JSON.stringify(w.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=w.id,W=C.get(F);if(xo(w,W),W!==void 0){C.delete(F);try{if(w.error){let Q=w.error;W.reject(new ue.ResponseError(Q.code,Q.message,Q.data))}else if(w.result!==void 0)W.resolve(w.result);else throw new Error("Should never happen.")}catch(Q){Q.message?i.error(`Response handler '${W.method}' failed with message: ${Q.message}`):i.error(`Response handler '${W.method}' failed unexpectedly.`)}}}}function Or(w){if(me())return;let F,W;if(w.method===Ls.type.method){let Q=w.params.id;x.delete(Q),_n(w);return}else{let Q=p.get(w.method);Q&&(W=Q.handler,F=Q.type)}if(W||f)try{if(_n(w),W)if(w.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==ue.ParameterStructures.byName&&i.error(`Notification ${w.method} defines ${F.numberOfParams} params but received none.`),W();else if(Array.isArray(w.params)){let Q=w.params;w.method===Ms.type.method&&Q.length===2&&K0.is(Q[0])?W({token:Q[0],value:Q[1]}):(F!==void 0&&(F.parameterStructures===ue.ParameterStructures.byName&&i.error(`Notification ${w.method} defines parameters by name but received parameters by position`),F.numberOfParams!==w.params.length&&i.error(`Notification ${w.method} defines ${F.numberOfParams} params but received ${Q.length} arguments`)),W(...Q))}else F!==void 0&&F.parameterStructures===ue.ParameterStructures.byPosition&&i.error(`Notification ${w.method} defines parameters by position but received parameters by name`),W(w.params);else f&&f(w.method,w.params)}catch(Q){Q.message?i.error(`Notification handler '${w.method}' failed with message: ${Q.message}`):i.error(`Notification handler '${w.method}' failed unexpectedly.`)}else J.fire(w)}function _t(w){if(!w){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
21
21
  ${JSON.stringify(w,null,4)}`);let F=w;if(Ht.string(F.id)||Ht.number(F.id)){let W=F.id,Q=C.get(W);Q&&Q.reject(new Error("The received response has neither a result nor an error property."))}}function Tt(w){if(w!=null)switch(v){case He.Verbose:return JSON.stringify(w,null,4);case He.Compact:return JSON.stringify(w);default:return}}function vn(w){if(!(v===He.Off||!j))if(k===Cn.Text){let F;(v===He.Verbose||v===He.Compact)&&w.params&&(F=`Params: ${Tt(w.params)}
22
22
 
@@ -42,11 +42,11 @@ ${JSON.stringify(w,null,4)}`);let F=w;if(Ht.string(F.id)||Ht.number(F.id)){let W
42
42
 
43
43
  `:w.error===void 0&&(W=`No result returned.
44
44
 
45
- `)),F){let Q=w.error?` Request failed: ${w.error.message} (${w.error.code}).`:"";j.log(`Received response '${F.method} - (${w.id})' in ${Date.now()-F.timerStart}ms.${Q}`,W)}else j.log(`Received response ${w.id} without active response promise.`,W)}else Yr("receive-response",w)}function Yr(w,F){if(!j||v===He.Off)return;let W={isLSPMessage:!0,type:w,message:F,timestamp:Date.now()};j.log(W)}function Zn(){if(he())throw new Xi(Ol.Closed,"Connection is closed.");if(me())throw new Xi(Ol.Disposed,"Connection is disposed.")}function ca(){if(re())throw new Xi(Ol.AlreadyListening,"Connection is already listening")}function Ei(){if(!re())throw new Error("Call listen() first.")}function Tn(w){return w===void 0?null:w}function Ct(w){if(w!==null)return w}function Jn(w){return w!=null&&!Array.isArray(w)&&typeof w=="object"}function Xr(w,F){switch(w){case ue.ParameterStructures.auto:return Jn(F)?Ct(F):[Tn(F)];case ue.ParameterStructures.byName:if(!Jn(F))throw new Error("Received parameters by name but param is not an object literal.");return Ct(F);case ue.ParameterStructures.byPosition:return[Tn(F)];default:throw new Error(`Unknown parameter structure ${w.toString()}`)}}function fa(w,F){let W,Q=w.numberOfParams;switch(Q){case 0:W=void 0;break;case 1:W=Xr(w.parameterStructures,F[0]);break;default:W=[];for(let Ve=0;Ve<F.length&&Ve<Q;Ve++)W.push(Tn(F[Ve]));if(F.length<Q)for(let Ve=F.length;Ve<Q;Ve++)W.push(null);break}return W}let Yi={sendNotification:(w,...F)=>{Zn();let W,Q;if(Ht.string(w)){W=w;let Ye=F[0],dt=0,Ot=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ye)&&(dt=1,Ot=Ye);let Ee=F.length,tt=Ee-dt;switch(tt){case 0:Q=void 0;break;case 1:Q=Xr(Ot,F[dt]);break;default:if(Ot===ue.ParameterStructures.byName)throw new Error(`Received ${tt} parameters for 'by Name' notification parameter structure.`);Q=F.slice(dt,Ee).map(Pe=>Tn(Pe));break}}else{let Ye=F;W=w.method,Q=fa(w,Ye)}let Ve={jsonrpc:u,method:W,params:Q};return Hr(Ve),e.write(Ve).catch(()=>i.error("Sending notification failed."))},onNotification:(w,F)=>{Zn();let W;return Ht.func(w)?f=w:F&&(Ht.string(w)?(W=w,p.set(w,{type:void 0,handler:F})):(W=w.method,p.set(w.method,{type:w,handler:F}))),{dispose:()=>{W!==void 0?p.delete(W):f=void 0}}},onProgress:(w,F,W)=>{if(h.has(F))throw new Error(`Progress handler for token ${F} already registered`);return h.set(F,W),{dispose:()=>{h.delete(F)}}},sendProgress:(w,F,W)=>Yi.sendNotification(Ms.type,{token:F,value:W}),onUnhandledProgress:le.event,sendRequest:(w,...F)=>{Zn(),Ei();let W,Q,Ve;if(Ht.string(w)){W=w;let Ee=F[0],tt=F[F.length-1],Pe=0,Dt=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ee)&&(Pe=1,Dt=Ee);let cr=F.length;jh.CancellationToken.is(tt)&&(cr=cr-1,Ve=tt);let Ci=cr-Pe;switch(Ci){case 0:Q=void 0;break;case 1:Q=Xr(Dt,F[Pe]);break;default:if(Dt===ue.ParameterStructures.byName)throw new Error(`Received ${Ci} parameters for 'by Name' request parameter structure.`);Q=F.slice(Pe,cr).map(Qn=>Tn(Qn));break}}else{let Ee=F;W=w.method,Q=fa(w,Ee);let tt=w.numberOfParams;Ve=jh.CancellationToken.is(Ee[tt])?Ee[tt]:void 0}let Ye=o++,dt;return Ve&&(dt=Ve.onCancellationRequested(()=>{let Ee=G.sender.sendCancellation(Yi,Ye);return Ee===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ye}`),Promise.resolve()):Ee.catch(()=>{i.log(`Sending cancellation messages for id ${Ye} failed`)})})),new Promise((Ee,tt)=>{let Pe={jsonrpc:u,id:Ye,method:W,params:Q},Dt=Qn=>{Ee(Qn),G.sender.cleanup(Ye),dt?.dispose()},cr=Qn=>{tt(Qn),G.sender.cleanup(Ye),dt?.dispose()},Ci={method:W,timerStart:Date.now(),resolve:Dt,reject:cr};vn(Pe);try{e.write(Pe).catch(()=>i.error("Sending request failed."))}catch(Qn){Ci.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,Qn.message?Qn.message:"Unknown reason")),Ci=null}Ci&&C.set(Ye,Ci)})},onRequest:(w,F)=>{Zn();let W=null;return Uh.is(w)?(W=void 0,l=w):Ht.string(w)?(W=null,F!==void 0&&(W=w,c.set(w,{handler:F,type:void 0}))):F!==void 0&&(W=w.method,c.set(w.method,{type:w,handler:F})),{dispose:()=>{W!==null&&(W!==void 0?c.delete(W):l=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(w,F,W)=>{let Q=!1,Ve=Cn.Text;W!==void 0&&(Ht.boolean(W)?Q=W:(Q=W.sendNotification||!1,Ve=W.traceFormat||Cn.Text)),v=w,k=Ve,v===He.Off?j=void 0:j=F,Q&&!he()&&!me()&&await Yi.sendNotification(z0.type,{value:He.toString(w)})},onError:$.event,onClose:X.event,onUnhandledNotification:J.event,onDispose:pe.event,end:()=>{e.end()},dispose:()=>{if(me())return;O=xn.Disposed,pe.fire(void 0);let w=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(w);C=new Map,T=new Map,x=new Set,g=new W0.LinkedMap,Ht.func(e.dispose)&&e.dispose(),Ht.func(t.dispose)&&t.dispose()},listen:()=>{Zn(),ca(),O=xn.Listening,t.listen(Ne)},inspect:()=>{(0,B0.default)().console.log("inspect")}};return Yi.onNotification(Hh.type,w=>{if(v===He.Off||!j)return;let F=v===He.Verbose||v===He.Compact;j.log(w.message,F?w.verbose:void 0)}),Yi.onNotification(Ms.type,w=>{let F=h.get(w.token);F?F(w.value):le.fire(w)}),Yi}ae.createMessageConnection=TO});var Xh=b(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.TraceFormat=M.TraceValues=M.Trace=M.ProgressType=M.ProgressToken=M.createMessageConnection=M.NullLogger=M.ConnectionOptions=M.ConnectionStrategy=M.WriteableStreamMessageWriter=M.AbstractMessageWriter=M.MessageWriter=M.ReadableStreamMessageReader=M.AbstractMessageReader=M.MessageReader=M.CancellationToken=M.CancellationTokenSource=M.Emitter=M.Event=M.Disposable=M.LRUCache=M.Touch=M.LinkedMap=M.ParameterStructures=M.NotificationType9=M.NotificationType8=M.NotificationType7=M.NotificationType6=M.NotificationType5=M.NotificationType4=M.NotificationType3=M.NotificationType2=M.NotificationType1=M.NotificationType0=M.NotificationType=M.ErrorCodes=M.ResponseError=M.RequestType9=M.RequestType8=M.RequestType7=M.RequestType6=M.RequestType5=M.RequestType4=M.RequestType3=M.RequestType2=M.RequestType1=M.RequestType0=M.RequestType=M.Message=M.RAL=void 0;M.CancellationStrategy=M.CancellationSenderStrategy=M.CancellationReceiverStrategy=M.ConnectionError=M.ConnectionErrors=M.LogTraceNotification=M.SetTraceNotification=void 0;var nt=Ch();Object.defineProperty(M,"Message",{enumerable:!0,get:function(){return nt.Message}});Object.defineProperty(M,"RequestType",{enumerable:!0,get:function(){return nt.RequestType}});Object.defineProperty(M,"RequestType0",{enumerable:!0,get:function(){return nt.RequestType0}});Object.defineProperty(M,"RequestType1",{enumerable:!0,get:function(){return nt.RequestType1}});Object.defineProperty(M,"RequestType2",{enumerable:!0,get:function(){return nt.RequestType2}});Object.defineProperty(M,"RequestType3",{enumerable:!0,get:function(){return nt.RequestType3}});Object.defineProperty(M,"RequestType4",{enumerable:!0,get:function(){return nt.RequestType4}});Object.defineProperty(M,"RequestType5",{enumerable:!0,get:function(){return nt.RequestType5}});Object.defineProperty(M,"RequestType6",{enumerable:!0,get:function(){return nt.RequestType6}});Object.defineProperty(M,"RequestType7",{enumerable:!0,get:function(){return nt.RequestType7}});Object.defineProperty(M,"RequestType8",{enumerable:!0,get:function(){return nt.RequestType8}});Object.defineProperty(M,"RequestType9",{enumerable:!0,get:function(){return nt.RequestType9}});Object.defineProperty(M,"ResponseError",{enumerable:!0,get:function(){return nt.ResponseError}});Object.defineProperty(M,"ErrorCodes",{enumerable:!0,get:function(){return nt.ErrorCodes}});Object.defineProperty(M,"NotificationType",{enumerable:!0,get:function(){return nt.NotificationType}});Object.defineProperty(M,"NotificationType0",{enumerable:!0,get:function(){return nt.NotificationType0}});Object.defineProperty(M,"NotificationType1",{enumerable:!0,get:function(){return nt.NotificationType1}});Object.defineProperty(M,"NotificationType2",{enumerable:!0,get:function(){return nt.NotificationType2}});Object.defineProperty(M,"NotificationType3",{enumerable:!0,get:function(){return nt.NotificationType3}});Object.defineProperty(M,"NotificationType4",{enumerable:!0,get:function(){return nt.NotificationType4}});Object.defineProperty(M,"NotificationType5",{enumerable:!0,get:function(){return nt.NotificationType5}});Object.defineProperty(M,"NotificationType6",{enumerable:!0,get:function(){return nt.NotificationType6}});Object.defineProperty(M,"NotificationType7",{enumerable:!0,get:function(){return nt.NotificationType7}});Object.defineProperty(M,"NotificationType8",{enumerable:!0,get:function(){return nt.NotificationType8}});Object.defineProperty(M,"NotificationType9",{enumerable:!0,get:function(){return nt.NotificationType9}});Object.defineProperty(M,"ParameterStructures",{enumerable:!0,get:function(){return nt.ParameterStructures}});var zh=wh();Object.defineProperty(M,"LinkedMap",{enumerable:!0,get:function(){return zh.LinkedMap}});Object.defineProperty(M,"LRUCache",{enumerable:!0,get:function(){return zh.LRUCache}});Object.defineProperty(M,"Touch",{enumerable:!0,get:function(){return zh.Touch}});var RO=Zp();Object.defineProperty(M,"Disposable",{enumerable:!0,get:function(){return RO.Disposable}});var X0=ya();Object.defineProperty(M,"Event",{enumerable:!0,get:function(){return X0.Event}});Object.defineProperty(M,"Emitter",{enumerable:!0,get:function(){return X0.Emitter}});var Z0=Nh();Object.defineProperty(M,"CancellationTokenSource",{enumerable:!0,get:function(){return Z0.CancellationTokenSource}});Object.defineProperty(M,"CancellationToken",{enumerable:!0,get:function(){return Z0.CancellationToken}});var Vh=F0();Object.defineProperty(M,"MessageReader",{enumerable:!0,get:function(){return Vh.MessageReader}});Object.defineProperty(M,"AbstractMessageReader",{enumerable:!0,get:function(){return Vh.AbstractMessageReader}});Object.defineProperty(M,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Vh.ReadableStreamMessageReader}});var Yh=H0();Object.defineProperty(M,"MessageWriter",{enumerable:!0,get:function(){return Yh.MessageWriter}});Object.defineProperty(M,"AbstractMessageWriter",{enumerable:!0,get:function(){return Yh.AbstractMessageWriter}});Object.defineProperty(M,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Yh.WriteableStreamMessageWriter}});var pr=Y0();Object.defineProperty(M,"ConnectionStrategy",{enumerable:!0,get:function(){return pr.ConnectionStrategy}});Object.defineProperty(M,"ConnectionOptions",{enumerable:!0,get:function(){return pr.ConnectionOptions}});Object.defineProperty(M,"NullLogger",{enumerable:!0,get:function(){return pr.NullLogger}});Object.defineProperty(M,"createMessageConnection",{enumerable:!0,get:function(){return pr.createMessageConnection}});Object.defineProperty(M,"ProgressToken",{enumerable:!0,get:function(){return pr.ProgressToken}});Object.defineProperty(M,"ProgressType",{enumerable:!0,get:function(){return pr.ProgressType}});Object.defineProperty(M,"Trace",{enumerable:!0,get:function(){return pr.Trace}});Object.defineProperty(M,"TraceValues",{enumerable:!0,get:function(){return pr.TraceValues}});Object.defineProperty(M,"TraceFormat",{enumerable:!0,get:function(){return pr.TraceFormat}});Object.defineProperty(M,"SetTraceNotification",{enumerable:!0,get:function(){return pr.SetTraceNotification}});Object.defineProperty(M,"LogTraceNotification",{enumerable:!0,get:function(){return pr.LogTraceNotification}});Object.defineProperty(M,"ConnectionErrors",{enumerable:!0,get:function(){return pr.ConnectionErrors}});Object.defineProperty(M,"ConnectionError",{enumerable:!0,get:function(){return pr.ConnectionError}});Object.defineProperty(M,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return pr.CancellationReceiverStrategy}});Object.defineProperty(M,"CancellationSenderStrategy",{enumerable:!0,get:function(){return pr.CancellationSenderStrategy}});Object.defineProperty(M,"CancellationStrategy",{enumerable:!0,get:function(){return pr.CancellationStrategy}});var bO=wi();M.RAL=bO.default});var ti=b(Le=>{"use strict";var AO=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),EO=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AO(e,t,r)};Object.defineProperty(Le,"__esModule",{value:!0});Le.createMessageConnection=Le.createServerSocketTransport=Le.createClientSocketTransport=Le.createServerPipeTransport=Le.createClientPipeTransport=Le.generateRandomPipeName=Le.StreamMessageWriter=Le.StreamMessageReader=Le.SocketMessageWriter=Le.SocketMessageReader=Le.IPCMessageWriter=Le.IPCMessageReader=void 0;var _a=O0();_a.default.install();var ei=Xh(),J0=require("path"),CO=require("os"),xO=require("crypto"),Ml=require("net");EO(Xh(),Le);var Zh=class extends ei.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),ei.Disposable.create(()=>this.process.off("message",e))}};Le.IPCMessageReader=Zh;var Jh=class extends ei.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Le.IPCMessageWriter=Jh;var Oo=class extends ei.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,_a.default)().stream.asReadableStream(e),r)}};Le.SocketMessageReader=Oo;var Io=class extends ei.WriteableStreamMessageWriter{constructor(e,r){super((0,_a.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Le.SocketMessageWriter=Io;var Il=class extends ei.ReadableStreamMessageReader{constructor(e,r){super((0,_a.default)().stream.asReadableStream(e),r)}};Le.StreamMessageReader=Il;var $l=class extends ei.WriteableStreamMessageWriter{constructor(e,r){super((0,_a.default)().stream.asWritableStream(e),r)}};Le.StreamMessageWriter=$l;var Q0=process.env.XDG_RUNTIME_DIR,wO=new Map([["linux",107],["darwin",103]]);function SO(){let t=(0,xO.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Q0?e=J0.join(Q0,`vscode-ipc-${t}.sock`):e=J0.join(CO.tmpdir(),`vscode-${t}.sock`);let r=wO.get(process.platform);return r!==void 0&&e.length>=r&&(0,_a.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Le.generateRandomPipeName=SO;function kO(t,e="utf-8"){let r,n=new Promise((i,o)=>{r=i});return new Promise((i,o)=>{let a=(0,Ml.createServer)(s=>{a.close(),r([new Oo(s,e),new Io(s,e)])});a.on("error",o),a.listen(t,()=>{a.removeListener("error",o),i({onConnected:()=>n})})})}Le.createClientPipeTransport=kO;function PO(t,e="utf-8"){let r=(0,Ml.createConnection)(t);return[new Oo(r,e),new Io(r,e)]}Le.createServerPipeTransport=PO;function DO(t,e="utf-8"){let r,n=new Promise((i,o)=>{r=i});return new Promise((i,o)=>{let a=(0,Ml.createServer)(s=>{a.close(),r([new Oo(s,e),new Io(s,e)])});a.on("error",o),a.listen(t,"127.0.0.1",()=>{a.removeListener("error",o),i({onConnected:()=>n})})})}Le.createClientSocketTransport=DO;function NO(t,e="utf-8"){let r=(0,Ml.createConnection)(t,"127.0.0.1");return[new Oo(r,e),new Io(r,e)]}Le.createServerSocketTransport=NO;function OO(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function IO(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function $O(t,e,r,n){r||(r=ei.NullLogger);let i=OO(t)?new Il(t):t,o=IO(e)?new $l(e):e;return ei.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ei.createMessageConnection)(i,o,r,n)}Le.createMessageConnection=$O});var Qh=b((u6,eR)=>{"use strict";eR.exports=ti()});var Ta=b((tR,Ll)=>{(function(t){if(typeof Ll=="object"&&typeof Ll.exports=="object"){var e=t(require,tR);e!==void 0&&(Ll.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(y){function S(P){return typeof P=="string"}y.is=S})(r=e.DocumentUri||(e.DocumentUri={}));var n;(function(y){function S(P){return typeof P=="string"}y.is=S})(n=e.URI||(e.URI={}));var i;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647;function S(P){return typeof P=="number"&&y.MIN_VALUE<=P&&P<=y.MAX_VALUE}y.is=S})(i=e.integer||(e.integer={}));var o;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647;function S(P){return typeof P=="number"&&y.MIN_VALUE<=P&&P<=y.MAX_VALUE}y.is=S})(o=e.uinteger||(e.uinteger={}));var a;(function(y){function S(R,m){return R===Number.MAX_VALUE&&(R=o.MAX_VALUE),m===Number.MAX_VALUE&&(m=o.MAX_VALUE),{line:R,character:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.uinteger(m.line)&&D.uinteger(m.character)}y.is=P})(a=e.Position||(e.Position={}));var s;(function(y){function S(R,m,N,L){if(D.uinteger(R)&&D.uinteger(m)&&D.uinteger(N)&&D.uinteger(L))return{start:a.create(R,m),end:a.create(N,L)};if(a.is(R)&&a.is(m))return{start:R,end:m};throw new Error("Range#create called with invalid arguments[".concat(R,", ").concat(m,", ").concat(N,", ").concat(L,"]"))}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&a.is(m.start)&&a.is(m.end)}y.is=P})(s=e.Range||(e.Range={}));var u;(function(y){function S(R,m){return{uri:R,range:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&(D.string(m.uri)||D.undefined(m.uri))}y.is=P})(u=e.Location||(e.Location={}));var l;(function(y){function S(R,m,N,L){return{targetUri:R,targetRange:m,targetSelectionRange:N,originSelectionRange:L}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.targetRange)&&D.string(m.targetUri)&&s.is(m.targetSelectionRange)&&(s.is(m.originSelectionRange)||D.undefined(m.originSelectionRange))}y.is=P})(l=e.LocationLink||(e.LocationLink={}));var c;(function(y){function S(R,m,N,L){return{red:R,green:m,blue:N,alpha:L}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.numberRange(m.red,0,1)&&D.numberRange(m.green,0,1)&&D.numberRange(m.blue,0,1)&&D.numberRange(m.alpha,0,1)}y.is=P})(c=e.Color||(e.Color={}));var f;(function(y){function S(R,m){return{range:R,color:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&c.is(m.color)}y.is=P})(f=e.ColorInformation||(e.ColorInformation={}));var p;(function(y){function S(R,m,N){return{label:R,textEdit:m,additionalTextEdits:N}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.string(m.label)&&(D.undefined(m.textEdit)||j.is(m))&&(D.undefined(m.additionalTextEdits)||D.typedArray(m.additionalTextEdits,j.is))}y.is=P})(p=e.ColorPresentation||(e.ColorPresentation={}));var h;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(h=e.FoldingRangeKind||(e.FoldingRangeKind={}));var d;(function(y){function S(R,m,N,L,fe,xt){var rt={startLine:R,endLine:m};return D.defined(N)&&(rt.startCharacter=N),D.defined(L)&&(rt.endCharacter=L),D.defined(fe)&&(rt.kind=fe),D.defined(xt)&&(rt.collapsedText=xt),rt}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.uinteger(m.startLine)&&D.uinteger(m.startLine)&&(D.undefined(m.startCharacter)||D.uinteger(m.startCharacter))&&(D.undefined(m.endCharacter)||D.uinteger(m.endCharacter))&&(D.undefined(m.kind)||D.string(m.kind))}y.is=P})(d=e.FoldingRange||(e.FoldingRange={}));var g;(function(y){function S(R,m){return{location:R,message:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&u.is(m.location)&&D.string(m.message)}y.is=P})(g=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var C;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(C=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var x;(function(y){y.Unnecessary=1,y.Deprecated=2})(x=e.DiagnosticTag||(e.DiagnosticTag={}));var T;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&D.string(R.href)}y.is=S})(T=e.CodeDescription||(e.CodeDescription={}));var v;(function(y){function S(R,m,N,L,fe,xt){var rt={range:R,message:m};return D.defined(N)&&(rt.severity=N),D.defined(L)&&(rt.code=L),D.defined(fe)&&(rt.source=fe),D.defined(xt)&&(rt.relatedInformation=xt),rt}y.create=S;function P(R){var m,N=R;return D.defined(N)&&s.is(N.range)&&D.string(N.message)&&(D.number(N.severity)||D.undefined(N.severity))&&(D.integer(N.code)||D.string(N.code)||D.undefined(N.code))&&(D.undefined(N.codeDescription)||D.string((m=N.codeDescription)===null||m===void 0?void 0:m.href))&&(D.string(N.source)||D.undefined(N.source))&&(D.undefined(N.relatedInformation)||D.typedArray(N.relatedInformation,g.is))}y.is=P})(v=e.Diagnostic||(e.Diagnostic={}));var k;(function(y){function S(R,m){for(var N=[],L=2;L<arguments.length;L++)N[L-2]=arguments[L];var fe={title:R,command:m};return D.defined(N)&&N.length>0&&(fe.arguments=N),fe}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.title)&&D.string(m.command)}y.is=P})(k=e.Command||(e.Command={}));var j;(function(y){function S(N,L){return{range:N,newText:L}}y.replace=S;function P(N,L){return{range:{start:N,end:N},newText:L}}y.insert=P;function R(N){return{range:N,newText:""}}y.del=R;function m(N){var L=N;return D.objectLiteral(L)&&D.string(L.newText)&&s.is(L.range)}y.is=m})(j=e.TextEdit||(e.TextEdit={}));var O;(function(y){function S(R,m,N){var L={label:R};return m!==void 0&&(L.needsConfirmation=m),N!==void 0&&(L.description=N),L}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.string(m.label)&&(D.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(D.string(m.description)||m.description===void 0)}y.is=P})(O=e.ChangeAnnotation||(e.ChangeAnnotation={}));var $;(function(y){function S(P){var R=P;return D.string(R)}y.is=S})($=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var X;(function(y){function S(N,L,fe){return{range:N,newText:L,annotationId:fe}}y.replace=S;function P(N,L,fe){return{range:{start:N,end:N},newText:L,annotationId:fe}}y.insert=P;function R(N,L){return{range:N,newText:"",annotationId:L}}y.del=R;function m(N){var L=N;return j.is(L)&&(O.is(L.annotationId)||$.is(L.annotationId))}y.is=m})(X=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var J;(function(y){function S(R,m){return{textDocument:R,edits:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&he.is(m.textDocument)&&Array.isArray(m.edits)}y.is=P})(J=e.TextDocumentEdit||(e.TextDocumentEdit={}));var le;(function(y){function S(R,m,N){var L={kind:"create",uri:R};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(L.options=m),N!==void 0&&(L.annotationId=N),L}y.create=S;function P(R){var m=R;return m&&m.kind==="create"&&D.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||D.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||D.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(le=e.CreateFile||(e.CreateFile={}));var pe;(function(y){function S(R,m,N,L){var fe={kind:"rename",oldUri:R,newUri:m};return N!==void 0&&(N.overwrite!==void 0||N.ignoreIfExists!==void 0)&&(fe.options=N),L!==void 0&&(fe.annotationId=L),fe}y.create=S;function P(R){var m=R;return m&&m.kind==="rename"&&D.string(m.oldUri)&&D.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||D.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||D.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(pe=e.RenameFile||(e.RenameFile={}));var G;(function(y){function S(R,m,N){var L={kind:"delete",uri:R};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(L.options=m),N!==void 0&&(L.annotationId=N),L}y.create=S;function P(R){var m=R;return m&&m.kind==="delete"&&D.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||D.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||D.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(G=e.DeleteFile||(e.DeleteFile={}));var I;(function(y){function S(P){var R=P;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(m){return D.string(m.kind)?le.is(m)||pe.is(m)||G.is(m):J.is(m)}))}y.is=S})(I=e.WorkspaceEdit||(e.WorkspaceEdit={}));var U=function(){function y(S,P){this.edits=S,this.changeAnnotations=P}return y.prototype.insert=function(S,P,R){var m,N;if(R===void 0?m=j.insert(S,P):$.is(R)?(N=R,m=X.insert(S,P,R)):(this.assertChangeAnnotations(this.changeAnnotations),N=this.changeAnnotations.manage(R),m=X.insert(S,P,N)),this.edits.push(m),N!==void 0)return N},y.prototype.replace=function(S,P,R){var m,N;if(R===void 0?m=j.replace(S,P):$.is(R)?(N=R,m=X.replace(S,P,R)):(this.assertChangeAnnotations(this.changeAnnotations),N=this.changeAnnotations.manage(R),m=X.replace(S,P,N)),this.edits.push(m),N!==void 0)return N},y.prototype.delete=function(S,P){var R,m;if(P===void 0?R=j.del(S):$.is(P)?(m=P,R=X.del(S,P)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(P),R=X.del(S,m)),this.edits.push(R),m!==void 0)return m},y.prototype.add=function(S){this.edits.push(S)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(S){if(S===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),z=function(){function y(S){this._annotations=S===void 0?Object.create(null):S,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(S,P){var R;if($.is(S)?R=S:(R=this.nextId(),P=S),this._annotations[R]!==void 0)throw new Error("Id ".concat(R," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(R));return this._annotations[R]=P,this._size++,R},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),de=function(){function y(S){var P=this;this._textEditChanges=Object.create(null),S!==void 0?(this._workspaceEdit=S,S.documentChanges?(this._changeAnnotations=new z(S.changeAnnotations),S.changeAnnotations=this._changeAnnotations.all(),S.documentChanges.forEach(function(R){if(J.is(R)){var m=new U(R.edits,P._changeAnnotations);P._textEditChanges[R.textDocument.uri]=m}})):S.changes&&Object.keys(S.changes).forEach(function(R){var m=new U(S.changes[R]);P._textEditChanges[R]=m})):this._workspaceEdit={}}return Object.defineProperty(y.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),y.prototype.getTextEditChange=function(S){if(he.is(S)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:S.uri,version:S.version},R=this._textEditChanges[P.uri];if(!R){var m=[],N={textDocument:P,edits:m};this._workspaceEdit.documentChanges.push(N),R=new U(m,this._changeAnnotations),this._textEditChanges[P.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.");var R=this._textEditChanges[S];if(!R){var m=[];this._workspaceEdit.changes[S]=m,R=new U(m),this._textEditChanges[S]=R}return R}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new z,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(S,P,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;O.is(P)||$.is(P)?m=P:R=P;var N,L;if(m===void 0?N=le.create(S,R):(L=$.is(m)?m:this._changeAnnotations.manage(m),N=le.create(S,R,L)),this._workspaceEdit.documentChanges.push(N),L!==void 0)return L},y.prototype.renameFile=function(S,P,R,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var N;O.is(R)||$.is(R)?N=R:m=R;var L,fe;if(N===void 0?L=pe.create(S,P,m):(fe=$.is(N)?N:this._changeAnnotations.manage(N),L=pe.create(S,P,m,fe)),this._workspaceEdit.documentChanges.push(L),fe!==void 0)return fe},y.prototype.deleteFile=function(S,P,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;O.is(P)||$.is(P)?m=P:R=P;var N,L;if(m===void 0?N=G.create(S,R):(L=$.is(m)?m:this._changeAnnotations.manage(m),N=G.create(S,R,L)),this._workspaceEdit.documentChanges.push(N),L!==void 0)return L},y}();e.WorkspaceChange=de;var ie;(function(y){function S(R){return{uri:R}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)}y.is=P})(ie=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var re;(function(y){function S(R,m){return{uri:R,version:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&D.integer(m.version)}y.is=P})(re=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var he;(function(y){function S(R,m){return{uri:R,version:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&(m.version===null||D.integer(m.version))}y.is=P})(he=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var me;(function(y){function S(R,m,N,L){return{uri:R,languageId:m,version:N,text:L}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&D.string(m.languageId)&&D.integer(m.version)&&D.string(m.text)}y.is=P})(me=e.TextDocumentItem||(e.TextDocumentItem={}));var ze;(function(y){y.PlainText="plaintext",y.Markdown="markdown";function S(P){var R=P;return R===y.PlainText||R===y.Markdown}y.is=S})(ze=e.MarkupKind||(e.MarkupKind={}));var H;(function(y){function S(P){var R=P;return D.objectLiteral(P)&&ze.is(R.kind)&&D.string(R.value)}y.is=S})(H=e.MarkupContent||(e.MarkupContent={}));var K;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(K=e.CompletionItemKind||(e.CompletionItemKind={}));var ne;(function(y){y.PlainText=1,y.Snippet=2})(ne=e.InsertTextFormat||(e.InsertTextFormat={}));var Me;(function(y){y.Deprecated=1})(Me=e.CompletionItemTag||(e.CompletionItemTag={}));var Ne;(function(y){function S(R,m,N){return{newText:R,insert:m,replace:N}}y.create=S;function P(R){var m=R;return m&&D.string(m.newText)&&s.is(m.insert)&&s.is(m.replace)}y.is=P})(Ne=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var Nr;(function(y){y.asIs=1,y.adjustIndentation=2})(Nr=e.InsertTextMode||(e.InsertTextMode={}));var Ur;(function(y){function S(P){var R=P;return R&&(D.string(R.detail)||R.detail===void 0)&&(D.string(R.description)||R.description===void 0)}y.is=S})(Ur=e.CompletionItemLabelDetails||(e.CompletionItemLabelDetails={}));var Or;(function(y){function S(P){return{label:P}}y.create=S})(Or=e.CompletionItem||(e.CompletionItem={}));var _t;(function(y){function S(P,R){return{items:P||[],isIncomplete:!!R}}y.create=S})(_t=e.CompletionList||(e.CompletionList={}));var Tt;(function(y){function S(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=S;function P(R){var m=R;return D.string(m)||D.objectLiteral(m)&&D.string(m.language)&&D.string(m.value)}y.is=P})(Tt=e.MarkedString||(e.MarkedString={}));var vn;(function(y){function S(P){var R=P;return!!R&&D.objectLiteral(R)&&(H.is(R.contents)||Tt.is(R.contents)||D.typedArray(R.contents,Tt.is))&&(P.range===void 0||s.is(P.range))}y.is=S})(vn=e.Hover||(e.Hover={}));var Hr;(function(y){function S(P,R){return R?{label:P,documentation:R}:{label:P}}y.create=S})(Hr=e.ParameterInformation||(e.ParameterInformation={}));var Qt;(function(y){function S(P,R){for(var m=[],N=2;N<arguments.length;N++)m[N-2]=arguments[N];var L={label:P};return D.defined(R)&&(L.documentation=R),D.defined(m)?L.parameters=m:L.parameters=[],L}y.create=S})(Qt=e.SignatureInformation||(e.SignatureInformation={}));var Br;(function(y){y.Text=1,y.Read=2,y.Write=3})(Br=e.DocumentHighlightKind||(e.DocumentHighlightKind={}));var _n;(function(y){function S(P,R){var m={range:P};return D.number(R)&&(m.kind=R),m}y.create=S})(_n=e.DocumentHighlight||(e.DocumentHighlight={}));var xo;(function(y){y.File=1,y.Module=2,y.Namespace=3,y.Package=4,y.Class=5,y.Method=6,y.Property=7,y.Field=8,y.Constructor=9,y.Enum=10,y.Interface=11,y.Function=12,y.Variable=13,y.Constant=14,y.String=15,y.Number=16,y.Boolean=17,y.Array=18,y.Object=19,y.Key=20,y.Null=21,y.EnumMember=22,y.Struct=23,y.Event=24,y.Operator=25,y.TypeParameter=26})(xo=e.SymbolKind||(e.SymbolKind={}));var Yr;(function(y){y.Deprecated=1})(Yr=e.SymbolTag||(e.SymbolTag={}));var Zn;(function(y){function S(P,R,m,N,L){var fe={name:P,kind:R,location:{uri:N,range:m}};return L&&(fe.containerName=L),fe}y.create=S})(Zn=e.SymbolInformation||(e.SymbolInformation={}));var ca;(function(y){function S(P,R,m,N){return N!==void 0?{name:P,kind:R,location:{uri:m,range:N}}:{name:P,kind:R,location:{uri:m}}}y.create=S})(ca=e.WorkspaceSymbol||(e.WorkspaceSymbol={}));var Ei;(function(y){function S(R,m,N,L,fe,xt){var rt={name:R,detail:m,kind:N,range:L,selectionRange:fe};return xt!==void 0&&(rt.children=xt),rt}y.create=S;function P(R){var m=R;return m&&D.string(m.name)&&D.number(m.kind)&&s.is(m.range)&&s.is(m.selectionRange)&&(m.detail===void 0||D.string(m.detail))&&(m.deprecated===void 0||D.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}y.is=P})(Ei=e.DocumentSymbol||(e.DocumentSymbol={}));var Tn;(function(y){y.Empty="",y.QuickFix="quickfix",y.Refactor="refactor",y.RefactorExtract="refactor.extract",y.RefactorInline="refactor.inline",y.RefactorRewrite="refactor.rewrite",y.Source="source",y.SourceOrganizeImports="source.organizeImports",y.SourceFixAll="source.fixAll"})(Tn=e.CodeActionKind||(e.CodeActionKind={}));var Ct;(function(y){y.Invoked=1,y.Automatic=2})(Ct=e.CodeActionTriggerKind||(e.CodeActionTriggerKind={}));var Jn;(function(y){function S(R,m,N){var L={diagnostics:R};return m!=null&&(L.only=m),N!=null&&(L.triggerKind=N),L}y.create=S;function P(R){var m=R;return D.defined(m)&&D.typedArray(m.diagnostics,v.is)&&(m.only===void 0||D.typedArray(m.only,D.string))&&(m.triggerKind===void 0||m.triggerKind===Ct.Invoked||m.triggerKind===Ct.Automatic)}y.is=P})(Jn=e.CodeActionContext||(e.CodeActionContext={}));var Xr;(function(y){function S(R,m,N){var L={title:R},fe=!0;return typeof m=="string"?(fe=!1,L.kind=m):k.is(m)?L.command=m:L.edit=m,fe&&N!==void 0&&(L.kind=N),L}y.create=S;function P(R){var m=R;return m&&D.string(m.title)&&(m.diagnostics===void 0||D.typedArray(m.diagnostics,v.is))&&(m.kind===void 0||D.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||k.is(m.command))&&(m.isPreferred===void 0||D.boolean(m.isPreferred))&&(m.edit===void 0||I.is(m.edit))}y.is=P})(Xr=e.CodeAction||(e.CodeAction={}));var fa;(function(y){function S(R,m){var N={range:R};return D.defined(m)&&(N.data=m),N}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(m.range)&&(D.undefined(m.command)||k.is(m.command))}y.is=P})(fa=e.CodeLens||(e.CodeLens={}));var Yi;(function(y){function S(R,m){return{tabSize:R,insertSpaces:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.uinteger(m.tabSize)&&D.boolean(m.insertSpaces)}y.is=P})(Yi=e.FormattingOptions||(e.FormattingOptions={}));var w;(function(y){function S(R,m,N){return{range:R,target:m,data:N}}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(m.range)&&(D.undefined(m.target)||D.string(m.target))}y.is=P})(w=e.DocumentLink||(e.DocumentLink={}));var F;(function(y){function S(R,m){return{range:R,parent:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&(m.parent===void 0||y.is(m.parent))}y.is=P})(F=e.SelectionRange||(e.SelectionRange={}));var W;(function(y){y.namespace="namespace",y.type="type",y.class="class",y.enum="enum",y.interface="interface",y.struct="struct",y.typeParameter="typeParameter",y.parameter="parameter",y.variable="variable",y.property="property",y.enumMember="enumMember",y.event="event",y.function="function",y.method="method",y.macro="macro",y.keyword="keyword",y.modifier="modifier",y.comment="comment",y.string="string",y.number="number",y.regexp="regexp",y.operator="operator",y.decorator="decorator"})(W=e.SemanticTokenTypes||(e.SemanticTokenTypes={}));var Q;(function(y){y.declaration="declaration",y.definition="definition",y.readonly="readonly",y.static="static",y.deprecated="deprecated",y.abstract="abstract",y.async="async",y.modification="modification",y.documentation="documentation",y.defaultLibrary="defaultLibrary"})(Q=e.SemanticTokenModifiers||(e.SemanticTokenModifiers={}));var Ve;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&(R.resultId===void 0||typeof R.resultId=="string")&&Array.isArray(R.data)&&(R.data.length===0||typeof R.data[0]=="number")}y.is=S})(Ve=e.SemanticTokens||(e.SemanticTokens={}));var Ye;(function(y){function S(R,m){return{range:R,text:m}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&D.string(m.text)}y.is=P})(Ye=e.InlineValueText||(e.InlineValueText={}));var dt;(function(y){function S(R,m,N){return{range:R,variableName:m,caseSensitiveLookup:N}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&D.boolean(m.caseSensitiveLookup)&&(D.string(m.variableName)||m.variableName===void 0)}y.is=P})(dt=e.InlineValueVariableLookup||(e.InlineValueVariableLookup={}));var Ot;(function(y){function S(R,m){return{range:R,expression:m}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&(D.string(m.expression)||m.expression===void 0)}y.is=P})(Ot=e.InlineValueEvaluatableExpression||(e.InlineValueEvaluatableExpression={}));var Ee;(function(y){function S(R,m){return{frameId:R,stoppedLocation:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(R.stoppedLocation)}y.is=P})(Ee=e.InlineValueContext||(e.InlineValueContext={}));var tt;(function(y){y.Type=1,y.Parameter=2;function S(P){return P===1||P===2}y.is=S})(tt=e.InlayHintKind||(e.InlayHintKind={}));var Pe;(function(y){function S(R){return{value:R}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&(m.tooltip===void 0||D.string(m.tooltip)||H.is(m.tooltip))&&(m.location===void 0||u.is(m.location))&&(m.command===void 0||k.is(m.command))}y.is=P})(Pe=e.InlayHintLabelPart||(e.InlayHintLabelPart={}));var Dt;(function(y){function S(R,m,N){var L={position:R,label:m};return N!==void 0&&(L.kind=N),L}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&a.is(m.position)&&(D.string(m.label)||D.typedArray(m.label,Pe.is))&&(m.kind===void 0||tt.is(m.kind))&&m.textEdits===void 0||D.typedArray(m.textEdits,j.is)&&(m.tooltip===void 0||D.string(m.tooltip)||H.is(m.tooltip))&&(m.paddingLeft===void 0||D.boolean(m.paddingLeft))&&(m.paddingRight===void 0||D.boolean(m.paddingRight))}y.is=P})(Dt=e.InlayHint||(e.InlayHint={}));var cr;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&n.is(R.uri)&&D.string(R.name)}y.is=S})(cr=e.WorkspaceFolder||(e.WorkspaceFolder={})),e.EOL=[`
45
+ `)),F){let Q=w.error?` Request failed: ${w.error.message} (${w.error.code}).`:"";j.log(`Received response '${F.method} - (${w.id})' in ${Date.now()-F.timerStart}ms.${Q}`,W)}else j.log(`Received response ${w.id} without active response promise.`,W)}else Yr("receive-response",w)}function Yr(w,F){if(!j||v===He.Off)return;let W={isLSPMessage:!0,type:w,message:F,timestamp:Date.now()};j.log(W)}function Zn(){if(he())throw new Xi(Ol.Closed,"Connection is closed.");if(me())throw new Xi(Ol.Disposed,"Connection is disposed.")}function ca(){if(re())throw new Xi(Ol.AlreadyListening,"Connection is already listening")}function Ei(){if(!re())throw new Error("Call listen() first.")}function Tn(w){return w===void 0?null:w}function Ct(w){if(w!==null)return w}function Jn(w){return w!=null&&!Array.isArray(w)&&typeof w=="object"}function Xr(w,F){switch(w){case ue.ParameterStructures.auto:return Jn(F)?Ct(F):[Tn(F)];case ue.ParameterStructures.byName:if(!Jn(F))throw new Error("Received parameters by name but param is not an object literal.");return Ct(F);case ue.ParameterStructures.byPosition:return[Tn(F)];default:throw new Error(`Unknown parameter structure ${w.toString()}`)}}function fa(w,F){let W,Q=w.numberOfParams;switch(Q){case 0:W=void 0;break;case 1:W=Xr(w.parameterStructures,F[0]);break;default:W=[];for(let Ve=0;Ve<F.length&&Ve<Q;Ve++)W.push(Tn(F[Ve]));if(F.length<Q)for(let Ve=F.length;Ve<Q;Ve++)W.push(null);break}return W}let Yi={sendNotification:(w,...F)=>{Zn();let W,Q;if(Ht.string(w)){W=w;let Ye=F[0],dt=0,Ot=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ye)&&(dt=1,Ot=Ye);let Ee=F.length,tt=Ee-dt;switch(tt){case 0:Q=void 0;break;case 1:Q=Xr(Ot,F[dt]);break;default:if(Ot===ue.ParameterStructures.byName)throw new Error(`Received ${tt} parameters for 'by Name' notification parameter structure.`);Q=F.slice(dt,Ee).map(Pe=>Tn(Pe));break}}else{let Ye=F;W=w.method,Q=fa(w,Ye)}let Ve={jsonrpc:u,method:W,params:Q};return Hr(Ve),e.write(Ve).catch(()=>i.error("Sending notification failed."))},onNotification:(w,F)=>{Zn();let W;return Ht.func(w)?f=w:F&&(Ht.string(w)?(W=w,p.set(w,{type:void 0,handler:F})):(W=w.method,p.set(w.method,{type:w,handler:F}))),{dispose:()=>{W!==void 0?p.delete(W):f=void 0}}},onProgress:(w,F,W)=>{if(h.has(F))throw new Error(`Progress handler for token ${F} already registered`);return h.set(F,W),{dispose:()=>{h.delete(F)}}},sendProgress:(w,F,W)=>Yi.sendNotification(Ms.type,{token:F,value:W}),onUnhandledProgress:le.event,sendRequest:(w,...F)=>{Zn(),Ei();let W,Q,Ve;if(Ht.string(w)){W=w;let Ee=F[0],tt=F[F.length-1],Pe=0,Dt=ue.ParameterStructures.auto;ue.ParameterStructures.is(Ee)&&(Pe=1,Dt=Ee);let cr=F.length;jh.CancellationToken.is(tt)&&(cr=cr-1,Ve=tt);let Ci=cr-Pe;switch(Ci){case 0:Q=void 0;break;case 1:Q=Xr(Dt,F[Pe]);break;default:if(Dt===ue.ParameterStructures.byName)throw new Error(`Received ${Ci} parameters for 'by Name' request parameter structure.`);Q=F.slice(Pe,cr).map(Qn=>Tn(Qn));break}}else{let Ee=F;W=w.method,Q=fa(w,Ee);let tt=w.numberOfParams;Ve=jh.CancellationToken.is(Ee[tt])?Ee[tt]:void 0}let Ye=o++,dt;return Ve&&(dt=Ve.onCancellationRequested(()=>{let Ee=G.sender.sendCancellation(Yi,Ye);return Ee===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ye}`),Promise.resolve()):Ee.catch(()=>{i.log(`Sending cancellation messages for id ${Ye} failed`)})})),new Promise((Ee,tt)=>{let Pe={jsonrpc:u,id:Ye,method:W,params:Q},Dt=Qn=>{Ee(Qn),G.sender.cleanup(Ye),dt?.dispose()},cr=Qn=>{tt(Qn),G.sender.cleanup(Ye),dt?.dispose()},Ci={method:W,timerStart:Date.now(),resolve:Dt,reject:cr};vn(Pe);try{e.write(Pe).catch(()=>i.error("Sending request failed."))}catch(Qn){Ci.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,Qn.message?Qn.message:"Unknown reason")),Ci=null}Ci&&C.set(Ye,Ci)})},onRequest:(w,F)=>{Zn();let W=null;return Uh.is(w)?(W=void 0,l=w):Ht.string(w)?(W=null,F!==void 0&&(W=w,c.set(w,{handler:F,type:void 0}))):F!==void 0&&(W=w.method,c.set(w.method,{type:w,handler:F})),{dispose:()=>{W!==null&&(W!==void 0?c.delete(W):l=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(w,F,W)=>{let Q=!1,Ve=Cn.Text;W!==void 0&&(Ht.boolean(W)?Q=W:(Q=W.sendNotification||!1,Ve=W.traceFormat||Cn.Text)),v=w,k=Ve,v===He.Off?j=void 0:j=F,Q&&!he()&&!me()&&await Yi.sendNotification(z0.type,{value:He.toString(w)})},onError:$.event,onClose:X.event,onUnhandledNotification:J.event,onDispose:pe.event,end:()=>{e.end()},dispose:()=>{if(me())return;O=xn.Disposed,pe.fire(void 0);let w=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(w);C=new Map,T=new Map,x=new Set,g=new W0.LinkedMap,Ht.func(e.dispose)&&e.dispose(),Ht.func(t.dispose)&&t.dispose()},listen:()=>{Zn(),ca(),O=xn.Listening,t.listen(Ne)},inspect:()=>{(0,B0.default)().console.log("inspect")}};return Yi.onNotification(Hh.type,w=>{if(v===He.Off||!j)return;let F=v===He.Verbose||v===He.Compact;j.log(w.message,F?w.verbose:void 0)}),Yi.onNotification(Ms.type,w=>{let F=h.get(w.token);F?F(w.value):le.fire(w)}),Yi}ae.createMessageConnection=_O});var Xh=b(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.TraceFormat=M.TraceValues=M.Trace=M.ProgressType=M.ProgressToken=M.createMessageConnection=M.NullLogger=M.ConnectionOptions=M.ConnectionStrategy=M.WriteableStreamMessageWriter=M.AbstractMessageWriter=M.MessageWriter=M.ReadableStreamMessageReader=M.AbstractMessageReader=M.MessageReader=M.CancellationToken=M.CancellationTokenSource=M.Emitter=M.Event=M.Disposable=M.LRUCache=M.Touch=M.LinkedMap=M.ParameterStructures=M.NotificationType9=M.NotificationType8=M.NotificationType7=M.NotificationType6=M.NotificationType5=M.NotificationType4=M.NotificationType3=M.NotificationType2=M.NotificationType1=M.NotificationType0=M.NotificationType=M.ErrorCodes=M.ResponseError=M.RequestType9=M.RequestType8=M.RequestType7=M.RequestType6=M.RequestType5=M.RequestType4=M.RequestType3=M.RequestType2=M.RequestType1=M.RequestType0=M.RequestType=M.Message=M.RAL=void 0;M.CancellationStrategy=M.CancellationSenderStrategy=M.CancellationReceiverStrategy=M.ConnectionError=M.ConnectionErrors=M.LogTraceNotification=M.SetTraceNotification=void 0;var nt=Ch();Object.defineProperty(M,"Message",{enumerable:!0,get:function(){return nt.Message}});Object.defineProperty(M,"RequestType",{enumerable:!0,get:function(){return nt.RequestType}});Object.defineProperty(M,"RequestType0",{enumerable:!0,get:function(){return nt.RequestType0}});Object.defineProperty(M,"RequestType1",{enumerable:!0,get:function(){return nt.RequestType1}});Object.defineProperty(M,"RequestType2",{enumerable:!0,get:function(){return nt.RequestType2}});Object.defineProperty(M,"RequestType3",{enumerable:!0,get:function(){return nt.RequestType3}});Object.defineProperty(M,"RequestType4",{enumerable:!0,get:function(){return nt.RequestType4}});Object.defineProperty(M,"RequestType5",{enumerable:!0,get:function(){return nt.RequestType5}});Object.defineProperty(M,"RequestType6",{enumerable:!0,get:function(){return nt.RequestType6}});Object.defineProperty(M,"RequestType7",{enumerable:!0,get:function(){return nt.RequestType7}});Object.defineProperty(M,"RequestType8",{enumerable:!0,get:function(){return nt.RequestType8}});Object.defineProperty(M,"RequestType9",{enumerable:!0,get:function(){return nt.RequestType9}});Object.defineProperty(M,"ResponseError",{enumerable:!0,get:function(){return nt.ResponseError}});Object.defineProperty(M,"ErrorCodes",{enumerable:!0,get:function(){return nt.ErrorCodes}});Object.defineProperty(M,"NotificationType",{enumerable:!0,get:function(){return nt.NotificationType}});Object.defineProperty(M,"NotificationType0",{enumerable:!0,get:function(){return nt.NotificationType0}});Object.defineProperty(M,"NotificationType1",{enumerable:!0,get:function(){return nt.NotificationType1}});Object.defineProperty(M,"NotificationType2",{enumerable:!0,get:function(){return nt.NotificationType2}});Object.defineProperty(M,"NotificationType3",{enumerable:!0,get:function(){return nt.NotificationType3}});Object.defineProperty(M,"NotificationType4",{enumerable:!0,get:function(){return nt.NotificationType4}});Object.defineProperty(M,"NotificationType5",{enumerable:!0,get:function(){return nt.NotificationType5}});Object.defineProperty(M,"NotificationType6",{enumerable:!0,get:function(){return nt.NotificationType6}});Object.defineProperty(M,"NotificationType7",{enumerable:!0,get:function(){return nt.NotificationType7}});Object.defineProperty(M,"NotificationType8",{enumerable:!0,get:function(){return nt.NotificationType8}});Object.defineProperty(M,"NotificationType9",{enumerable:!0,get:function(){return nt.NotificationType9}});Object.defineProperty(M,"ParameterStructures",{enumerable:!0,get:function(){return nt.ParameterStructures}});var zh=wh();Object.defineProperty(M,"LinkedMap",{enumerable:!0,get:function(){return zh.LinkedMap}});Object.defineProperty(M,"LRUCache",{enumerable:!0,get:function(){return zh.LRUCache}});Object.defineProperty(M,"Touch",{enumerable:!0,get:function(){return zh.Touch}});var TO=Zp();Object.defineProperty(M,"Disposable",{enumerable:!0,get:function(){return TO.Disposable}});var X0=ya();Object.defineProperty(M,"Event",{enumerable:!0,get:function(){return X0.Event}});Object.defineProperty(M,"Emitter",{enumerable:!0,get:function(){return X0.Emitter}});var Z0=Nh();Object.defineProperty(M,"CancellationTokenSource",{enumerable:!0,get:function(){return Z0.CancellationTokenSource}});Object.defineProperty(M,"CancellationToken",{enumerable:!0,get:function(){return Z0.CancellationToken}});var Vh=F0();Object.defineProperty(M,"MessageReader",{enumerable:!0,get:function(){return Vh.MessageReader}});Object.defineProperty(M,"AbstractMessageReader",{enumerable:!0,get:function(){return Vh.AbstractMessageReader}});Object.defineProperty(M,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Vh.ReadableStreamMessageReader}});var Yh=H0();Object.defineProperty(M,"MessageWriter",{enumerable:!0,get:function(){return Yh.MessageWriter}});Object.defineProperty(M,"AbstractMessageWriter",{enumerable:!0,get:function(){return Yh.AbstractMessageWriter}});Object.defineProperty(M,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Yh.WriteableStreamMessageWriter}});var pr=Y0();Object.defineProperty(M,"ConnectionStrategy",{enumerable:!0,get:function(){return pr.ConnectionStrategy}});Object.defineProperty(M,"ConnectionOptions",{enumerable:!0,get:function(){return pr.ConnectionOptions}});Object.defineProperty(M,"NullLogger",{enumerable:!0,get:function(){return pr.NullLogger}});Object.defineProperty(M,"createMessageConnection",{enumerable:!0,get:function(){return pr.createMessageConnection}});Object.defineProperty(M,"ProgressToken",{enumerable:!0,get:function(){return pr.ProgressToken}});Object.defineProperty(M,"ProgressType",{enumerable:!0,get:function(){return pr.ProgressType}});Object.defineProperty(M,"Trace",{enumerable:!0,get:function(){return pr.Trace}});Object.defineProperty(M,"TraceValues",{enumerable:!0,get:function(){return pr.TraceValues}});Object.defineProperty(M,"TraceFormat",{enumerable:!0,get:function(){return pr.TraceFormat}});Object.defineProperty(M,"SetTraceNotification",{enumerable:!0,get:function(){return pr.SetTraceNotification}});Object.defineProperty(M,"LogTraceNotification",{enumerable:!0,get:function(){return pr.LogTraceNotification}});Object.defineProperty(M,"ConnectionErrors",{enumerable:!0,get:function(){return pr.ConnectionErrors}});Object.defineProperty(M,"ConnectionError",{enumerable:!0,get:function(){return pr.ConnectionError}});Object.defineProperty(M,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return pr.CancellationReceiverStrategy}});Object.defineProperty(M,"CancellationSenderStrategy",{enumerable:!0,get:function(){return pr.CancellationSenderStrategy}});Object.defineProperty(M,"CancellationStrategy",{enumerable:!0,get:function(){return pr.CancellationStrategy}});var RO=wi();M.RAL=RO.default});var ti=b(Le=>{"use strict";var bO=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AO=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bO(e,t,r)};Object.defineProperty(Le,"__esModule",{value:!0});Le.createMessageConnection=Le.createServerSocketTransport=Le.createClientSocketTransport=Le.createServerPipeTransport=Le.createClientPipeTransport=Le.generateRandomPipeName=Le.StreamMessageWriter=Le.StreamMessageReader=Le.SocketMessageWriter=Le.SocketMessageReader=Le.IPCMessageWriter=Le.IPCMessageReader=void 0;var _a=O0();_a.default.install();var ei=Xh(),J0=require("path"),EO=require("os"),CO=require("crypto"),Ml=require("net");AO(Xh(),Le);var Zh=class extends ei.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),ei.Disposable.create(()=>this.process.off("message",e))}};Le.IPCMessageReader=Zh;var Jh=class extends ei.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Le.IPCMessageWriter=Jh;var Oo=class extends ei.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,_a.default)().stream.asReadableStream(e),r)}};Le.SocketMessageReader=Oo;var Io=class extends ei.WriteableStreamMessageWriter{constructor(e,r){super((0,_a.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Le.SocketMessageWriter=Io;var Il=class extends ei.ReadableStreamMessageReader{constructor(e,r){super((0,_a.default)().stream.asReadableStream(e),r)}};Le.StreamMessageReader=Il;var $l=class extends ei.WriteableStreamMessageWriter{constructor(e,r){super((0,_a.default)().stream.asWritableStream(e),r)}};Le.StreamMessageWriter=$l;var Q0=process.env.XDG_RUNTIME_DIR,xO=new Map([["linux",107],["darwin",103]]);function wO(){let t=(0,CO.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Q0?e=J0.join(Q0,`vscode-ipc-${t}.sock`):e=J0.join(EO.tmpdir(),`vscode-${t}.sock`);let r=xO.get(process.platform);return r!==void 0&&e.length>=r&&(0,_a.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Le.generateRandomPipeName=wO;function SO(t,e="utf-8"){let r,n=new Promise((i,o)=>{r=i});return new Promise((i,o)=>{let a=(0,Ml.createServer)(s=>{a.close(),r([new Oo(s,e),new Io(s,e)])});a.on("error",o),a.listen(t,()=>{a.removeListener("error",o),i({onConnected:()=>n})})})}Le.createClientPipeTransport=SO;function kO(t,e="utf-8"){let r=(0,Ml.createConnection)(t);return[new Oo(r,e),new Io(r,e)]}Le.createServerPipeTransport=kO;function PO(t,e="utf-8"){let r,n=new Promise((i,o)=>{r=i});return new Promise((i,o)=>{let a=(0,Ml.createServer)(s=>{a.close(),r([new Oo(s,e),new Io(s,e)])});a.on("error",o),a.listen(t,"127.0.0.1",()=>{a.removeListener("error",o),i({onConnected:()=>n})})})}Le.createClientSocketTransport=PO;function DO(t,e="utf-8"){let r=(0,Ml.createConnection)(t,"127.0.0.1");return[new Oo(r,e),new Io(r,e)]}Le.createServerSocketTransport=DO;function NO(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function OO(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function IO(t,e,r,n){r||(r=ei.NullLogger);let i=NO(t)?new Il(t):t,o=OO(e)?new $l(e):e;return ei.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ei.createMessageConnection)(i,o,r,n)}Le.createMessageConnection=IO});var Qh=b((s6,eR)=>{"use strict";eR.exports=ti()});var Ta=b((tR,Ll)=>{(function(t){if(typeof Ll=="object"&&typeof Ll.exports=="object"){var e=t(require,tR);e!==void 0&&(Ll.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(y){function S(P){return typeof P=="string"}y.is=S})(r=e.DocumentUri||(e.DocumentUri={}));var n;(function(y){function S(P){return typeof P=="string"}y.is=S})(n=e.URI||(e.URI={}));var i;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647;function S(P){return typeof P=="number"&&y.MIN_VALUE<=P&&P<=y.MAX_VALUE}y.is=S})(i=e.integer||(e.integer={}));var o;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647;function S(P){return typeof P=="number"&&y.MIN_VALUE<=P&&P<=y.MAX_VALUE}y.is=S})(o=e.uinteger||(e.uinteger={}));var a;(function(y){function S(R,m){return R===Number.MAX_VALUE&&(R=o.MAX_VALUE),m===Number.MAX_VALUE&&(m=o.MAX_VALUE),{line:R,character:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.uinteger(m.line)&&D.uinteger(m.character)}y.is=P})(a=e.Position||(e.Position={}));var s;(function(y){function S(R,m,N,L){if(D.uinteger(R)&&D.uinteger(m)&&D.uinteger(N)&&D.uinteger(L))return{start:a.create(R,m),end:a.create(N,L)};if(a.is(R)&&a.is(m))return{start:R,end:m};throw new Error("Range#create called with invalid arguments[".concat(R,", ").concat(m,", ").concat(N,", ").concat(L,"]"))}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&a.is(m.start)&&a.is(m.end)}y.is=P})(s=e.Range||(e.Range={}));var u;(function(y){function S(R,m){return{uri:R,range:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&(D.string(m.uri)||D.undefined(m.uri))}y.is=P})(u=e.Location||(e.Location={}));var l;(function(y){function S(R,m,N,L){return{targetUri:R,targetRange:m,targetSelectionRange:N,originSelectionRange:L}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.targetRange)&&D.string(m.targetUri)&&s.is(m.targetSelectionRange)&&(s.is(m.originSelectionRange)||D.undefined(m.originSelectionRange))}y.is=P})(l=e.LocationLink||(e.LocationLink={}));var c;(function(y){function S(R,m,N,L){return{red:R,green:m,blue:N,alpha:L}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.numberRange(m.red,0,1)&&D.numberRange(m.green,0,1)&&D.numberRange(m.blue,0,1)&&D.numberRange(m.alpha,0,1)}y.is=P})(c=e.Color||(e.Color={}));var f;(function(y){function S(R,m){return{range:R,color:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&c.is(m.color)}y.is=P})(f=e.ColorInformation||(e.ColorInformation={}));var p;(function(y){function S(R,m,N){return{label:R,textEdit:m,additionalTextEdits:N}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.string(m.label)&&(D.undefined(m.textEdit)||j.is(m))&&(D.undefined(m.additionalTextEdits)||D.typedArray(m.additionalTextEdits,j.is))}y.is=P})(p=e.ColorPresentation||(e.ColorPresentation={}));var h;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(h=e.FoldingRangeKind||(e.FoldingRangeKind={}));var d;(function(y){function S(R,m,N,L,fe,xt){var rt={startLine:R,endLine:m};return D.defined(N)&&(rt.startCharacter=N),D.defined(L)&&(rt.endCharacter=L),D.defined(fe)&&(rt.kind=fe),D.defined(xt)&&(rt.collapsedText=xt),rt}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.uinteger(m.startLine)&&D.uinteger(m.startLine)&&(D.undefined(m.startCharacter)||D.uinteger(m.startCharacter))&&(D.undefined(m.endCharacter)||D.uinteger(m.endCharacter))&&(D.undefined(m.kind)||D.string(m.kind))}y.is=P})(d=e.FoldingRange||(e.FoldingRange={}));var g;(function(y){function S(R,m){return{location:R,message:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&u.is(m.location)&&D.string(m.message)}y.is=P})(g=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var C;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(C=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var x;(function(y){y.Unnecessary=1,y.Deprecated=2})(x=e.DiagnosticTag||(e.DiagnosticTag={}));var T;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&D.string(R.href)}y.is=S})(T=e.CodeDescription||(e.CodeDescription={}));var v;(function(y){function S(R,m,N,L,fe,xt){var rt={range:R,message:m};return D.defined(N)&&(rt.severity=N),D.defined(L)&&(rt.code=L),D.defined(fe)&&(rt.source=fe),D.defined(xt)&&(rt.relatedInformation=xt),rt}y.create=S;function P(R){var m,N=R;return D.defined(N)&&s.is(N.range)&&D.string(N.message)&&(D.number(N.severity)||D.undefined(N.severity))&&(D.integer(N.code)||D.string(N.code)||D.undefined(N.code))&&(D.undefined(N.codeDescription)||D.string((m=N.codeDescription)===null||m===void 0?void 0:m.href))&&(D.string(N.source)||D.undefined(N.source))&&(D.undefined(N.relatedInformation)||D.typedArray(N.relatedInformation,g.is))}y.is=P})(v=e.Diagnostic||(e.Diagnostic={}));var k;(function(y){function S(R,m){for(var N=[],L=2;L<arguments.length;L++)N[L-2]=arguments[L];var fe={title:R,command:m};return D.defined(N)&&N.length>0&&(fe.arguments=N),fe}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.title)&&D.string(m.command)}y.is=P})(k=e.Command||(e.Command={}));var j;(function(y){function S(N,L){return{range:N,newText:L}}y.replace=S;function P(N,L){return{range:{start:N,end:N},newText:L}}y.insert=P;function R(N){return{range:N,newText:""}}y.del=R;function m(N){var L=N;return D.objectLiteral(L)&&D.string(L.newText)&&s.is(L.range)}y.is=m})(j=e.TextEdit||(e.TextEdit={}));var O;(function(y){function S(R,m,N){var L={label:R};return m!==void 0&&(L.needsConfirmation=m),N!==void 0&&(L.description=N),L}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&D.string(m.label)&&(D.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(D.string(m.description)||m.description===void 0)}y.is=P})(O=e.ChangeAnnotation||(e.ChangeAnnotation={}));var $;(function(y){function S(P){var R=P;return D.string(R)}y.is=S})($=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var X;(function(y){function S(N,L,fe){return{range:N,newText:L,annotationId:fe}}y.replace=S;function P(N,L,fe){return{range:{start:N,end:N},newText:L,annotationId:fe}}y.insert=P;function R(N,L){return{range:N,newText:"",annotationId:L}}y.del=R;function m(N){var L=N;return j.is(L)&&(O.is(L.annotationId)||$.is(L.annotationId))}y.is=m})(X=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var J;(function(y){function S(R,m){return{textDocument:R,edits:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&he.is(m.textDocument)&&Array.isArray(m.edits)}y.is=P})(J=e.TextDocumentEdit||(e.TextDocumentEdit={}));var le;(function(y){function S(R,m,N){var L={kind:"create",uri:R};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(L.options=m),N!==void 0&&(L.annotationId=N),L}y.create=S;function P(R){var m=R;return m&&m.kind==="create"&&D.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||D.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||D.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(le=e.CreateFile||(e.CreateFile={}));var pe;(function(y){function S(R,m,N,L){var fe={kind:"rename",oldUri:R,newUri:m};return N!==void 0&&(N.overwrite!==void 0||N.ignoreIfExists!==void 0)&&(fe.options=N),L!==void 0&&(fe.annotationId=L),fe}y.create=S;function P(R){var m=R;return m&&m.kind==="rename"&&D.string(m.oldUri)&&D.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||D.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||D.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(pe=e.RenameFile||(e.RenameFile={}));var G;(function(y){function S(R,m,N){var L={kind:"delete",uri:R};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(L.options=m),N!==void 0&&(L.annotationId=N),L}y.create=S;function P(R){var m=R;return m&&m.kind==="delete"&&D.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||D.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||D.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}y.is=P})(G=e.DeleteFile||(e.DeleteFile={}));var I;(function(y){function S(P){var R=P;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(m){return D.string(m.kind)?le.is(m)||pe.is(m)||G.is(m):J.is(m)}))}y.is=S})(I=e.WorkspaceEdit||(e.WorkspaceEdit={}));var U=function(){function y(S,P){this.edits=S,this.changeAnnotations=P}return y.prototype.insert=function(S,P,R){var m,N;if(R===void 0?m=j.insert(S,P):$.is(R)?(N=R,m=X.insert(S,P,R)):(this.assertChangeAnnotations(this.changeAnnotations),N=this.changeAnnotations.manage(R),m=X.insert(S,P,N)),this.edits.push(m),N!==void 0)return N},y.prototype.replace=function(S,P,R){var m,N;if(R===void 0?m=j.replace(S,P):$.is(R)?(N=R,m=X.replace(S,P,R)):(this.assertChangeAnnotations(this.changeAnnotations),N=this.changeAnnotations.manage(R),m=X.replace(S,P,N)),this.edits.push(m),N!==void 0)return N},y.prototype.delete=function(S,P){var R,m;if(P===void 0?R=j.del(S):$.is(P)?(m=P,R=X.del(S,P)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(P),R=X.del(S,m)),this.edits.push(R),m!==void 0)return m},y.prototype.add=function(S){this.edits.push(S)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(S){if(S===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),z=function(){function y(S){this._annotations=S===void 0?Object.create(null):S,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(S,P){var R;if($.is(S)?R=S:(R=this.nextId(),P=S),this._annotations[R]!==void 0)throw new Error("Id ".concat(R," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(R));return this._annotations[R]=P,this._size++,R},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),de=function(){function y(S){var P=this;this._textEditChanges=Object.create(null),S!==void 0?(this._workspaceEdit=S,S.documentChanges?(this._changeAnnotations=new z(S.changeAnnotations),S.changeAnnotations=this._changeAnnotations.all(),S.documentChanges.forEach(function(R){if(J.is(R)){var m=new U(R.edits,P._changeAnnotations);P._textEditChanges[R.textDocument.uri]=m}})):S.changes&&Object.keys(S.changes).forEach(function(R){var m=new U(S.changes[R]);P._textEditChanges[R]=m})):this._workspaceEdit={}}return Object.defineProperty(y.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),y.prototype.getTextEditChange=function(S){if(he.is(S)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:S.uri,version:S.version},R=this._textEditChanges[P.uri];if(!R){var m=[],N={textDocument:P,edits:m};this._workspaceEdit.documentChanges.push(N),R=new U(m,this._changeAnnotations),this._textEditChanges[P.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.");var R=this._textEditChanges[S];if(!R){var m=[];this._workspaceEdit.changes[S]=m,R=new U(m),this._textEditChanges[S]=R}return R}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new z,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(S,P,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;O.is(P)||$.is(P)?m=P:R=P;var N,L;if(m===void 0?N=le.create(S,R):(L=$.is(m)?m:this._changeAnnotations.manage(m),N=le.create(S,R,L)),this._workspaceEdit.documentChanges.push(N),L!==void 0)return L},y.prototype.renameFile=function(S,P,R,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var N;O.is(R)||$.is(R)?N=R:m=R;var L,fe;if(N===void 0?L=pe.create(S,P,m):(fe=$.is(N)?N:this._changeAnnotations.manage(N),L=pe.create(S,P,m,fe)),this._workspaceEdit.documentChanges.push(L),fe!==void 0)return fe},y.prototype.deleteFile=function(S,P,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;O.is(P)||$.is(P)?m=P:R=P;var N,L;if(m===void 0?N=G.create(S,R):(L=$.is(m)?m:this._changeAnnotations.manage(m),N=G.create(S,R,L)),this._workspaceEdit.documentChanges.push(N),L!==void 0)return L},y}();e.WorkspaceChange=de;var ie;(function(y){function S(R){return{uri:R}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)}y.is=P})(ie=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var re;(function(y){function S(R,m){return{uri:R,version:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&D.integer(m.version)}y.is=P})(re=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var he;(function(y){function S(R,m){return{uri:R,version:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&(m.version===null||D.integer(m.version))}y.is=P})(he=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var me;(function(y){function S(R,m,N,L){return{uri:R,languageId:m,version:N,text:L}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.string(m.uri)&&D.string(m.languageId)&&D.integer(m.version)&&D.string(m.text)}y.is=P})(me=e.TextDocumentItem||(e.TextDocumentItem={}));var ze;(function(y){y.PlainText="plaintext",y.Markdown="markdown";function S(P){var R=P;return R===y.PlainText||R===y.Markdown}y.is=S})(ze=e.MarkupKind||(e.MarkupKind={}));var H;(function(y){function S(P){var R=P;return D.objectLiteral(P)&&ze.is(R.kind)&&D.string(R.value)}y.is=S})(H=e.MarkupContent||(e.MarkupContent={}));var K;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(K=e.CompletionItemKind||(e.CompletionItemKind={}));var ne;(function(y){y.PlainText=1,y.Snippet=2})(ne=e.InsertTextFormat||(e.InsertTextFormat={}));var Me;(function(y){y.Deprecated=1})(Me=e.CompletionItemTag||(e.CompletionItemTag={}));var Ne;(function(y){function S(R,m,N){return{newText:R,insert:m,replace:N}}y.create=S;function P(R){var m=R;return m&&D.string(m.newText)&&s.is(m.insert)&&s.is(m.replace)}y.is=P})(Ne=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var Nr;(function(y){y.asIs=1,y.adjustIndentation=2})(Nr=e.InsertTextMode||(e.InsertTextMode={}));var Ur;(function(y){function S(P){var R=P;return R&&(D.string(R.detail)||R.detail===void 0)&&(D.string(R.description)||R.description===void 0)}y.is=S})(Ur=e.CompletionItemLabelDetails||(e.CompletionItemLabelDetails={}));var Or;(function(y){function S(P){return{label:P}}y.create=S})(Or=e.CompletionItem||(e.CompletionItem={}));var _t;(function(y){function S(P,R){return{items:P||[],isIncomplete:!!R}}y.create=S})(_t=e.CompletionList||(e.CompletionList={}));var Tt;(function(y){function S(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=S;function P(R){var m=R;return D.string(m)||D.objectLiteral(m)&&D.string(m.language)&&D.string(m.value)}y.is=P})(Tt=e.MarkedString||(e.MarkedString={}));var vn;(function(y){function S(P){var R=P;return!!R&&D.objectLiteral(R)&&(H.is(R.contents)||Tt.is(R.contents)||D.typedArray(R.contents,Tt.is))&&(P.range===void 0||s.is(P.range))}y.is=S})(vn=e.Hover||(e.Hover={}));var Hr;(function(y){function S(P,R){return R?{label:P,documentation:R}:{label:P}}y.create=S})(Hr=e.ParameterInformation||(e.ParameterInformation={}));var Qt;(function(y){function S(P,R){for(var m=[],N=2;N<arguments.length;N++)m[N-2]=arguments[N];var L={label:P};return D.defined(R)&&(L.documentation=R),D.defined(m)?L.parameters=m:L.parameters=[],L}y.create=S})(Qt=e.SignatureInformation||(e.SignatureInformation={}));var Br;(function(y){y.Text=1,y.Read=2,y.Write=3})(Br=e.DocumentHighlightKind||(e.DocumentHighlightKind={}));var _n;(function(y){function S(P,R){var m={range:P};return D.number(R)&&(m.kind=R),m}y.create=S})(_n=e.DocumentHighlight||(e.DocumentHighlight={}));var xo;(function(y){y.File=1,y.Module=2,y.Namespace=3,y.Package=4,y.Class=5,y.Method=6,y.Property=7,y.Field=8,y.Constructor=9,y.Enum=10,y.Interface=11,y.Function=12,y.Variable=13,y.Constant=14,y.String=15,y.Number=16,y.Boolean=17,y.Array=18,y.Object=19,y.Key=20,y.Null=21,y.EnumMember=22,y.Struct=23,y.Event=24,y.Operator=25,y.TypeParameter=26})(xo=e.SymbolKind||(e.SymbolKind={}));var Yr;(function(y){y.Deprecated=1})(Yr=e.SymbolTag||(e.SymbolTag={}));var Zn;(function(y){function S(P,R,m,N,L){var fe={name:P,kind:R,location:{uri:N,range:m}};return L&&(fe.containerName=L),fe}y.create=S})(Zn=e.SymbolInformation||(e.SymbolInformation={}));var ca;(function(y){function S(P,R,m,N){return N!==void 0?{name:P,kind:R,location:{uri:m,range:N}}:{name:P,kind:R,location:{uri:m}}}y.create=S})(ca=e.WorkspaceSymbol||(e.WorkspaceSymbol={}));var Ei;(function(y){function S(R,m,N,L,fe,xt){var rt={name:R,detail:m,kind:N,range:L,selectionRange:fe};return xt!==void 0&&(rt.children=xt),rt}y.create=S;function P(R){var m=R;return m&&D.string(m.name)&&D.number(m.kind)&&s.is(m.range)&&s.is(m.selectionRange)&&(m.detail===void 0||D.string(m.detail))&&(m.deprecated===void 0||D.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}y.is=P})(Ei=e.DocumentSymbol||(e.DocumentSymbol={}));var Tn;(function(y){y.Empty="",y.QuickFix="quickfix",y.Refactor="refactor",y.RefactorExtract="refactor.extract",y.RefactorInline="refactor.inline",y.RefactorRewrite="refactor.rewrite",y.Source="source",y.SourceOrganizeImports="source.organizeImports",y.SourceFixAll="source.fixAll"})(Tn=e.CodeActionKind||(e.CodeActionKind={}));var Ct;(function(y){y.Invoked=1,y.Automatic=2})(Ct=e.CodeActionTriggerKind||(e.CodeActionTriggerKind={}));var Jn;(function(y){function S(R,m,N){var L={diagnostics:R};return m!=null&&(L.only=m),N!=null&&(L.triggerKind=N),L}y.create=S;function P(R){var m=R;return D.defined(m)&&D.typedArray(m.diagnostics,v.is)&&(m.only===void 0||D.typedArray(m.only,D.string))&&(m.triggerKind===void 0||m.triggerKind===Ct.Invoked||m.triggerKind===Ct.Automatic)}y.is=P})(Jn=e.CodeActionContext||(e.CodeActionContext={}));var Xr;(function(y){function S(R,m,N){var L={title:R},fe=!0;return typeof m=="string"?(fe=!1,L.kind=m):k.is(m)?L.command=m:L.edit=m,fe&&N!==void 0&&(L.kind=N),L}y.create=S;function P(R){var m=R;return m&&D.string(m.title)&&(m.diagnostics===void 0||D.typedArray(m.diagnostics,v.is))&&(m.kind===void 0||D.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||k.is(m.command))&&(m.isPreferred===void 0||D.boolean(m.isPreferred))&&(m.edit===void 0||I.is(m.edit))}y.is=P})(Xr=e.CodeAction||(e.CodeAction={}));var fa;(function(y){function S(R,m){var N={range:R};return D.defined(m)&&(N.data=m),N}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(m.range)&&(D.undefined(m.command)||k.is(m.command))}y.is=P})(fa=e.CodeLens||(e.CodeLens={}));var Yi;(function(y){function S(R,m){return{tabSize:R,insertSpaces:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&D.uinteger(m.tabSize)&&D.boolean(m.insertSpaces)}y.is=P})(Yi=e.FormattingOptions||(e.FormattingOptions={}));var w;(function(y){function S(R,m,N){return{range:R,target:m,data:N}}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(m.range)&&(D.undefined(m.target)||D.string(m.target))}y.is=P})(w=e.DocumentLink||(e.DocumentLink={}));var F;(function(y){function S(R,m){return{range:R,parent:m}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&s.is(m.range)&&(m.parent===void 0||y.is(m.parent))}y.is=P})(F=e.SelectionRange||(e.SelectionRange={}));var W;(function(y){y.namespace="namespace",y.type="type",y.class="class",y.enum="enum",y.interface="interface",y.struct="struct",y.typeParameter="typeParameter",y.parameter="parameter",y.variable="variable",y.property="property",y.enumMember="enumMember",y.event="event",y.function="function",y.method="method",y.macro="macro",y.keyword="keyword",y.modifier="modifier",y.comment="comment",y.string="string",y.number="number",y.regexp="regexp",y.operator="operator",y.decorator="decorator"})(W=e.SemanticTokenTypes||(e.SemanticTokenTypes={}));var Q;(function(y){y.declaration="declaration",y.definition="definition",y.readonly="readonly",y.static="static",y.deprecated="deprecated",y.abstract="abstract",y.async="async",y.modification="modification",y.documentation="documentation",y.defaultLibrary="defaultLibrary"})(Q=e.SemanticTokenModifiers||(e.SemanticTokenModifiers={}));var Ve;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&(R.resultId===void 0||typeof R.resultId=="string")&&Array.isArray(R.data)&&(R.data.length===0||typeof R.data[0]=="number")}y.is=S})(Ve=e.SemanticTokens||(e.SemanticTokens={}));var Ye;(function(y){function S(R,m){return{range:R,text:m}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&D.string(m.text)}y.is=P})(Ye=e.InlineValueText||(e.InlineValueText={}));var dt;(function(y){function S(R,m,N){return{range:R,variableName:m,caseSensitiveLookup:N}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&D.boolean(m.caseSensitiveLookup)&&(D.string(m.variableName)||m.variableName===void 0)}y.is=P})(dt=e.InlineValueVariableLookup||(e.InlineValueVariableLookup={}));var Ot;(function(y){function S(R,m){return{range:R,expression:m}}y.create=S;function P(R){var m=R;return m!=null&&s.is(m.range)&&(D.string(m.expression)||m.expression===void 0)}y.is=P})(Ot=e.InlineValueEvaluatableExpression||(e.InlineValueEvaluatableExpression={}));var Ee;(function(y){function S(R,m){return{frameId:R,stoppedLocation:m}}y.create=S;function P(R){var m=R;return D.defined(m)&&s.is(R.stoppedLocation)}y.is=P})(Ee=e.InlineValueContext||(e.InlineValueContext={}));var tt;(function(y){y.Type=1,y.Parameter=2;function S(P){return P===1||P===2}y.is=S})(tt=e.InlayHintKind||(e.InlayHintKind={}));var Pe;(function(y){function S(R){return{value:R}}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&(m.tooltip===void 0||D.string(m.tooltip)||H.is(m.tooltip))&&(m.location===void 0||u.is(m.location))&&(m.command===void 0||k.is(m.command))}y.is=P})(Pe=e.InlayHintLabelPart||(e.InlayHintLabelPart={}));var Dt;(function(y){function S(R,m,N){var L={position:R,label:m};return N!==void 0&&(L.kind=N),L}y.create=S;function P(R){var m=R;return D.objectLiteral(m)&&a.is(m.position)&&(D.string(m.label)||D.typedArray(m.label,Pe.is))&&(m.kind===void 0||tt.is(m.kind))&&m.textEdits===void 0||D.typedArray(m.textEdits,j.is)&&(m.tooltip===void 0||D.string(m.tooltip)||H.is(m.tooltip))&&(m.paddingLeft===void 0||D.boolean(m.paddingLeft))&&(m.paddingRight===void 0||D.boolean(m.paddingRight))}y.is=P})(Dt=e.InlayHint||(e.InlayHint={}));var cr;(function(y){function S(P){var R=P;return D.objectLiteral(R)&&n.is(R.uri)&&D.string(R.name)}y.is=S})(cr=e.WorkspaceFolder||(e.WorkspaceFolder={})),e.EOL=[`
46
46
  `,`\r
47
47
  `,"\r"];var Ci;(function(y){function S(N,L,fe,xt){return new Qn(N,L,fe,xt)}y.create=S;function P(N){var L=N;return!!(D.defined(L)&&D.string(L.uri)&&(D.undefined(L.languageId)||D.string(L.languageId))&&D.uinteger(L.lineCount)&&D.func(L.getText)&&D.func(L.positionAt)&&D.func(L.offsetAt))}y.is=P;function R(N,L){for(var fe=N.getText(),xt=m(L,function(da,Tl){var $T=da.range.start.line-Tl.range.start.line;return $T===0?da.range.start.character-Tl.range.start.character:$T}),rt=fe.length,Rn=xt.length-1;Rn>=0;Rn--){var bn=xt[Rn],xi=N.offsetAt(bn.range.start),Ce=N.offsetAt(bn.range.end);if(Ce<=rt)fe=fe.substring(0,xi)+bn.newText+fe.substring(Ce,fe.length);else throw new Error("Overlapping edit");rt=xi}return fe}y.applyEdits=R;function m(N,L){if(N.length<=1)return N;var fe=N.length/2|0,xt=N.slice(0,fe),rt=N.slice(fe);m(xt,L),m(rt,L);for(var Rn=0,bn=0,xi=0;Rn<xt.length&&bn<rt.length;){var Ce=L(xt[Rn],rt[bn]);Ce<=0?N[xi++]=xt[Rn++]:N[xi++]=rt[bn++]}for(;Rn<xt.length;)N[xi++]=xt[Rn++];for(;bn<rt.length;)N[xi++]=rt[bn++];return N}})(Ci=e.TextDocument||(e.TextDocument={}));var Qn=function(){function y(S,P,R,m){this._uri=S,this._languageId=P,this._version=R,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(y.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),y.prototype.getText=function(S){if(S){var P=this.offsetAt(S.start),R=this.offsetAt(S.end);return this._content.substring(P,R)}return this._content},y.prototype.update=function(S,P){this._content=S.text,this._version=P,this._lineOffsets=void 0},y.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var S=[],P=this._content,R=!0,m=0;m<P.length;m++){R&&(S.push(m),R=!1);var N=P.charAt(m);R=N==="\r"||N===`
48
48
  `,N==="\r"&&m+1<P.length&&P.charAt(m+1)===`
49
- `&&m++}R&&P.length>0&&S.push(P.length),this._lineOffsets=S}return this._lineOffsets},y.prototype.positionAt=function(S){S=Math.max(Math.min(S,this._content.length),0);var P=this.getLineOffsets(),R=0,m=P.length;if(m===0)return a.create(0,S);for(;R<m;){var N=Math.floor((R+m)/2);P[N]>S?m=N:R=N+1}var L=R-1;return a.create(L,S-P[L])},y.prototype.offsetAt=function(S){var P=this.getLineOffsets();if(S.line>=P.length)return this._content.length;if(S.line<0)return 0;var R=P[S.line],m=S.line+1<P.length?P[S.line+1]:this._content.length;return Math.max(Math.min(R+S.character,m),R)},Object.defineProperty(y.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),y}(),D;(function(y){var S=Object.prototype.toString;function P(Ce){return typeof Ce<"u"}y.defined=P;function R(Ce){return typeof Ce>"u"}y.undefined=R;function m(Ce){return Ce===!0||Ce===!1}y.boolean=m;function N(Ce){return S.call(Ce)==="[object String]"}y.string=N;function L(Ce){return S.call(Ce)==="[object Number]"}y.number=L;function fe(Ce,da,Tl){return S.call(Ce)==="[object Number]"&&da<=Ce&&Ce<=Tl}y.numberRange=fe;function xt(Ce){return S.call(Ce)==="[object Number]"&&-2147483648<=Ce&&Ce<=2147483647}y.integer=xt;function rt(Ce){return S.call(Ce)==="[object Number]"&&0<=Ce&&Ce<=2147483647}y.uinteger=rt;function Rn(Ce){return S.call(Ce)==="[object Function]"}y.func=Rn;function bn(Ce){return Ce!==null&&typeof Ce=="object"}y.objectLiteral=bn;function xi(Ce,da){return Array.isArray(Ce)&&Ce.every(da)}y.typedArray=xi})(D||(D={}))})});var Rt=b(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ProtocolNotificationType=Er.ProtocolNotificationType0=Er.ProtocolRequestType=Er.ProtocolRequestType0=Er.RegistrationType=Er.MessageDirection=void 0;var Ra=ti(),MO;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(MO=Er.MessageDirection||(Er.MessageDirection={}));var em=class{constructor(e){this.method=e}};Er.RegistrationType=em;var tm=class extends Ra.RequestType0{constructor(e){super(e)}};Er.ProtocolRequestType0=tm;var rm=class extends Ra.RequestType{constructor(e){super(e,Ra.ParameterStructures.byName)}};Er.ProtocolRequestType=rm;var nm=class extends Ra.NotificationType0{constructor(e){super(e)}};Er.ProtocolNotificationType0=nm;var im=class extends Ra.NotificationType{constructor(e){super(e,Ra.ParameterStructures.byName)}};Er.ProtocolNotificationType=im});var Fl=b($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.objectLiteral=$t.typedArray=$t.stringArray=$t.array=$t.func=$t.error=$t.number=$t.string=$t.boolean=void 0;function LO(t){return t===!0||t===!1}$t.boolean=LO;function rR(t){return typeof t=="string"||t instanceof String}$t.string=rR;function FO(t){return typeof t=="number"||t instanceof Number}$t.number=FO;function qO(t){return t instanceof Error}$t.error=qO;function jO(t){return typeof t=="function"}$t.func=jO;function nR(t){return Array.isArray(t)}$t.array=nR;function GO(t){return nR(t)&&t.every(e=>rR(e))}$t.stringArray=GO;function UO(t,e){return Array.isArray(t)&&t.every(e)}$t.typedArray=UO;function HO(t){return t!==null&&typeof t=="object"}$t.objectLiteral=HO});var oR=b(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ImplementationRequest=void 0;var iR=Rt(),BO;(function(t){t.method="textDocument/implementation",t.messageDirection=iR.MessageDirection.clientToServer,t.type=new iR.ProtocolRequestType(t.method)})(BO=Fs.ImplementationRequest||(Fs.ImplementationRequest={}))});var sR=b(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.TypeDefinitionRequest=void 0;var aR=Rt(),WO;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=aR.MessageDirection.clientToServer,t.type=new aR.ProtocolRequestType(t.method)})(WO=qs.TypeDefinitionRequest||(qs.TypeDefinitionRequest={}))});var uR=b(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.DidChangeWorkspaceFoldersNotification=Zi.WorkspaceFoldersRequest=void 0;var ql=Rt(),KO;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ql.MessageDirection.serverToClient,t.type=new ql.ProtocolRequestType0(t.method)})(KO=Zi.WorkspaceFoldersRequest||(Zi.WorkspaceFoldersRequest={}));var zO;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ql.MessageDirection.clientToServer,t.type=new ql.ProtocolNotificationType(t.method)})(zO=Zi.DidChangeWorkspaceFoldersNotification||(Zi.DidChangeWorkspaceFoldersNotification={}))});var cR=b(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.ConfigurationRequest=void 0;var lR=Rt(),VO;(function(t){t.method="workspace/configuration",t.messageDirection=lR.MessageDirection.serverToClient,t.type=new lR.ProtocolRequestType(t.method)})(VO=js.ConfigurationRequest||(js.ConfigurationRequest={}))});var fR=b(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ColorPresentationRequest=Ji.DocumentColorRequest=void 0;var jl=Rt(),YO;(function(t){t.method="textDocument/documentColor",t.messageDirection=jl.MessageDirection.clientToServer,t.type=new jl.ProtocolRequestType(t.method)})(YO=Ji.DocumentColorRequest||(Ji.DocumentColorRequest={}));var XO;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=jl.MessageDirection.clientToServer,t.type=new jl.ProtocolRequestType(t.method)})(XO=Ji.ColorPresentationRequest||(Ji.ColorPresentationRequest={}))});var pR=b(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.FoldingRangeRequest=void 0;var dR=Rt(),ZO;(function(t){t.method="textDocument/foldingRange",t.messageDirection=dR.MessageDirection.clientToServer,t.type=new dR.ProtocolRequestType(t.method)})(ZO=Gs.FoldingRangeRequest||(Gs.FoldingRangeRequest={}))});var mR=b(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.DeclarationRequest=void 0;var hR=Rt(),JO;(function(t){t.method="textDocument/declaration",t.messageDirection=hR.MessageDirection.clientToServer,t.type=new hR.ProtocolRequestType(t.method)})(JO=Us.DeclarationRequest||(Us.DeclarationRequest={}))});var yR=b(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.SelectionRangeRequest=void 0;var gR=Rt(),QO;(function(t){t.method="textDocument/selectionRange",t.messageDirection=gR.MessageDirection.clientToServer,t.type=new gR.ProtocolRequestType(t.method)})(QO=Hs.SelectionRangeRequest||(Hs.SelectionRangeRequest={}))});var vR=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.WorkDoneProgressCancelNotification=wn.WorkDoneProgressCreateRequest=wn.WorkDoneProgress=void 0;var eI=ti(),Gl=Rt(),tI;(function(t){t.type=new eI.ProgressType;function e(r){return r===t.type}t.is=e})(tI=wn.WorkDoneProgress||(wn.WorkDoneProgress={}));var rI;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Gl.MessageDirection.serverToClient,t.type=new Gl.ProtocolRequestType(t.method)})(rI=wn.WorkDoneProgressCreateRequest||(wn.WorkDoneProgressCreateRequest={}));var nI;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Gl.MessageDirection.clientToServer,t.type=new Gl.ProtocolNotificationType(t.method)})(nI=wn.WorkDoneProgressCancelNotification||(wn.WorkDoneProgressCancelNotification={}))});var _R=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.CallHierarchyOutgoingCallsRequest=Sn.CallHierarchyIncomingCallsRequest=Sn.CallHierarchyPrepareRequest=void 0;var ba=Rt(),iI;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(iI=Sn.CallHierarchyPrepareRequest||(Sn.CallHierarchyPrepareRequest={}));var oI;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(oI=Sn.CallHierarchyIncomingCallsRequest||(Sn.CallHierarchyIncomingCallsRequest={}));var aI;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(aI=Sn.CallHierarchyOutgoingCallsRequest||(Sn.CallHierarchyOutgoingCallsRequest={}))});var TR=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.SemanticTokensRefreshRequest=Mt.SemanticTokensRangeRequest=Mt.SemanticTokensDeltaRequest=Mt.SemanticTokensRequest=Mt.SemanticTokensRegistrationType=Mt.TokenFormat=void 0;var Di=Rt(),sI;(function(t){t.Relative="relative"})(sI=Mt.TokenFormat||(Mt.TokenFormat={}));var Ul;(function(t){t.method="textDocument/semanticTokens",t.type=new Di.RegistrationType(t.method)})(Ul=Mt.SemanticTokensRegistrationType||(Mt.SemanticTokensRegistrationType={}));var uI;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(uI=Mt.SemanticTokensRequest||(Mt.SemanticTokensRequest={}));var lI;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(lI=Mt.SemanticTokensDeltaRequest||(Mt.SemanticTokensDeltaRequest={}));var cI;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(cI=Mt.SemanticTokensRangeRequest||(Mt.SemanticTokensRangeRequest={}));var fI;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType0(t.method)})(fI=Mt.SemanticTokensRefreshRequest||(Mt.SemanticTokensRefreshRequest={}))});var bR=b(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.ShowDocumentRequest=void 0;var RR=Rt(),dI;(function(t){t.method="window/showDocument",t.messageDirection=RR.MessageDirection.serverToClient,t.type=new RR.ProtocolRequestType(t.method)})(dI=Bs.ShowDocumentRequest||(Bs.ShowDocumentRequest={}))});var ER=b(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.LinkedEditingRangeRequest=void 0;var AR=Rt(),pI;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=AR.MessageDirection.clientToServer,t.type=new AR.ProtocolRequestType(t.method)})(pI=Ws.LinkedEditingRangeRequest||(Ws.LinkedEditingRangeRequest={}))});var CR=b(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.WillDeleteFilesRequest=bt.DidDeleteFilesNotification=bt.DidRenameFilesNotification=bt.WillRenameFilesRequest=bt.DidCreateFilesNotification=bt.WillCreateFilesRequest=bt.FileOperationPatternKind=void 0;var Zr=Rt(),hI;(function(t){t.file="file",t.folder="folder"})(hI=bt.FileOperationPatternKind||(bt.FileOperationPatternKind={}));var mI;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(mI=bt.WillCreateFilesRequest||(bt.WillCreateFilesRequest={}));var gI;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(gI=bt.DidCreateFilesNotification||(bt.DidCreateFilesNotification={}));var yI;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(yI=bt.WillRenameFilesRequest||(bt.WillRenameFilesRequest={}));var vI;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(vI=bt.DidRenameFilesNotification||(bt.DidRenameFilesNotification={}));var _I;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(_I=bt.DidDeleteFilesNotification||(bt.DidDeleteFilesNotification={}));var TI;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(TI=bt.WillDeleteFilesRequest||(bt.WillDeleteFilesRequest={}))});var wR=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.MonikerRequest=kn.MonikerKind=kn.UniquenessLevel=void 0;var xR=Rt(),RI;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(RI=kn.UniquenessLevel||(kn.UniquenessLevel={}));var bI;(function(t){t.$import="import",t.$export="export",t.local="local"})(bI=kn.MonikerKind||(kn.MonikerKind={}));var AI;(function(t){t.method="textDocument/moniker",t.messageDirection=xR.MessageDirection.clientToServer,t.type=new xR.ProtocolRequestType(t.method)})(AI=kn.MonikerRequest||(kn.MonikerRequest={}))});var SR=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.TypeHierarchySubtypesRequest=Pn.TypeHierarchySupertypesRequest=Pn.TypeHierarchyPrepareRequest=void 0;var Aa=Rt(),EI;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(EI=Pn.TypeHierarchyPrepareRequest||(Pn.TypeHierarchyPrepareRequest={}));var CI;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(CI=Pn.TypeHierarchySupertypesRequest||(Pn.TypeHierarchySupertypesRequest={}));var xI;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(xI=Pn.TypeHierarchySubtypesRequest||(Pn.TypeHierarchySubtypesRequest={}))});var kR=b(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.InlineValueRefreshRequest=Qi.InlineValueRequest=void 0;var Hl=Rt(),wI;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType(t.method)})(wI=Qi.InlineValueRequest||(Qi.InlineValueRequest={}));var SI;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType0(t.method)})(SI=Qi.InlineValueRefreshRequest||(Qi.InlineValueRefreshRequest={}))});var PR=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.InlayHintRefreshRequest=Dn.InlayHintResolveRequest=Dn.InlayHintRequest=void 0;var Ea=Rt(),kI;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(kI=Dn.InlayHintRequest||(Dn.InlayHintRequest={}));var PI;(function(t){t.method="inlayHint/resolve",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(PI=Dn.InlayHintResolveRequest||(Dn.InlayHintResolveRequest={}));var DI;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType0(t.method)})(DI=Dn.InlayHintRefreshRequest||(Dn.InlayHintRefreshRequest={}))});var NR=b(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.DiagnosticRefreshRequest=er.WorkspaceDiagnosticRequest=er.DocumentDiagnosticRequest=er.DocumentDiagnosticReportKind=er.DiagnosticServerCancellationData=void 0;var DR=ti(),NI=Fl(),Ca=Rt(),OI;(function(t){function e(r){let n=r;return n&&NI.boolean(n.retriggerRequest)}t.is=e})(OI=er.DiagnosticServerCancellationData||(er.DiagnosticServerCancellationData={}));var II;(function(t){t.Full="full",t.Unchanged="unchanged"})(II=er.DocumentDiagnosticReportKind||(er.DocumentDiagnosticReportKind={}));var $I;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType(t.method),t.partialResult=new DR.ProgressType})($I=er.DocumentDiagnosticRequest||(er.DocumentDiagnosticRequest={}));var MI;(function(t){t.method="workspace/diagnostic",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType(t.method),t.partialResult=new DR.ProgressType})(MI=er.WorkspaceDiagnosticRequest||(er.WorkspaceDiagnosticRequest={}));var LI;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType0(t.method)})(LI=er.DiagnosticRefreshRequest||(er.DiagnosticRefreshRequest={}))});var $R=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.DidCloseNotebookDocumentNotification=Oe.DidSaveNotebookDocumentNotification=Oe.DidChangeNotebookDocumentNotification=Oe.NotebookCellArrayChange=Oe.DidOpenNotebookDocumentNotification=Oe.NotebookDocumentSyncRegistrationType=Oe.NotebookDocument=Oe.NotebookCell=Oe.ExecutionSummary=Oe.NotebookCellKind=void 0;var Ks=Ta(),Nn=Fl(),ri=Rt(),OR;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(OR=Oe.NotebookCellKind||(Oe.NotebookCellKind={}));var IR;(function(t){function e(i,o){let a={executionOrder:i};return(o===!0||o===!1)&&(a.success=o),a}t.create=e;function r(i){let o=i;return Nn.objectLiteral(o)&&Ks.uinteger.is(o.executionOrder)&&(o.success===void 0||Nn.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(IR=Oe.ExecutionSummary||(Oe.ExecutionSummary={}));var om;(function(t){function e(o,a){return{kind:o,document:a}}t.create=e;function r(o){let a=o;return Nn.objectLiteral(a)&&OR.is(a.kind)&&Ks.DocumentUri.is(a.document)&&(a.metadata===void 0||Nn.objectLiteral(a.metadata))}t.is=r;function n(o,a){let s=new Set;return o.document!==a.document&&s.add("document"),o.kind!==a.kind&&s.add("kind"),o.executionSummary!==a.executionSummary&&s.add("executionSummary"),(o.metadata!==void 0||a.metadata!==void 0)&&!i(o.metadata,a.metadata)&&s.add("metadata"),(o.executionSummary!==void 0||a.executionSummary!==void 0)&&!IR.equals(o.executionSummary,a.executionSummary)&&s.add("executionSummary"),s}t.diff=n;function i(o,a){if(o===a)return!0;if(o==null||a===null||a===void 0||typeof o!=typeof a||typeof o!="object")return!1;let s=Array.isArray(o),u=Array.isArray(a);if(s!==u)return!1;if(s&&u){if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(!i(o[l],a[l]))return!1}if(Nn.objectLiteral(o)&&Nn.objectLiteral(a)){let l=Object.keys(o),c=Object.keys(a);if(l.length!==c.length||(l.sort(),c.sort(),!i(l,c)))return!1;for(let f=0;f<l.length;f++){let p=l[f];if(!i(o[p],a[p]))return!1}}return!0}})(om=Oe.NotebookCell||(Oe.NotebookCell={}));var FI;(function(t){function e(n,i,o,a){return{uri:n,notebookType:i,version:o,cells:a}}t.create=e;function r(n){let i=n;return Nn.objectLiteral(i)&&Nn.string(i.uri)&&Ks.integer.is(i.version)&&Nn.typedArray(i.cells,om.is)}t.is=r})(FI=Oe.NotebookDocument||(Oe.NotebookDocument={}));var zs;(function(t){t.method="notebookDocument/sync",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.RegistrationType(t.method)})(zs=Oe.NotebookDocumentSyncRegistrationType||(Oe.NotebookDocumentSyncRegistrationType={}));var qI;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(qI=Oe.DidOpenNotebookDocumentNotification||(Oe.DidOpenNotebookDocumentNotification={}));var jI;(function(t){function e(n){let i=n;return Nn.objectLiteral(i)&&Ks.uinteger.is(i.start)&&Ks.uinteger.is(i.deleteCount)&&(i.cells===void 0||Nn.typedArray(i.cells,om.is))}t.is=e;function r(n,i,o){let a={start:n,deleteCount:i};return o!==void 0&&(a.cells=o),a}t.create=r})(jI=Oe.NotebookCellArrayChange||(Oe.NotebookCellArrayChange={}));var GI;(function(t){t.method="notebookDocument/didChange",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(GI=Oe.DidChangeNotebookDocumentNotification||(Oe.DidChangeNotebookDocumentNotification={}));var UI;(function(t){t.method="notebookDocument/didSave",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(UI=Oe.DidSaveNotebookDocumentNotification||(Oe.DidSaveNotebookDocumentNotification={}));var HI;(function(t){t.method="notebookDocument/didClose",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(HI=Oe.DidCloseNotebookDocumentNotification||(Oe.DidCloseNotebookDocumentNotification={}))});var BR=b(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=void 0;var B=Rt(),MR=Ta(),tr=Fl(),BI=oR();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return BI.ImplementationRequest}});var WI=sR();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return WI.TypeDefinitionRequest}});var LR=uR();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return LR.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return LR.DidChangeWorkspaceFoldersNotification}});var KI=cR();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return KI.ConfigurationRequest}});var FR=fR();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return FR.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return FR.ColorPresentationRequest}});var zI=pR();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return zI.FoldingRangeRequest}});var VI=mR();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return VI.DeclarationRequest}});var YI=yR();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return YI.SelectionRangeRequest}});var am=vR();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return am.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return am.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return am.WorkDoneProgressCancelNotification}});var sm=_R();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return sm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return sm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return sm.CallHierarchyPrepareRequest}});var xa=TR();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return xa.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return xa.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return xa.SemanticTokensRegistrationType}});var XI=bR();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return XI.ShowDocumentRequest}});var ZI=ER();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return ZI.LinkedEditingRangeRequest}});var $o=CR();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return $o.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return $o.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return $o.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return $o.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return $o.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return $o.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return $o.WillDeleteFilesRequest}});var um=wR();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return um.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return um.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return um.MonikerRequest}});var lm=SR();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return lm.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return lm.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return lm.TypeHierarchySupertypesRequest}});var qR=kR();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return qR.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return qR.InlineValueRefreshRequest}});var cm=PR();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return cm.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return cm.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return cm.InlayHintRefreshRequest}});var Vs=NR();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Vs.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Vs.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Vs.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Vs.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Vs.DiagnosticRefreshRequest}});var ni=$R();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return ni.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return ni.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return ni.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return ni.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ni.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ni.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidCloseNotebookDocumentNotification}});var jR;(function(t){function e(r){let n=r;return tr.string(n.language)||tr.string(n.scheme)||tr.string(n.pattern)}t.is=e})(jR=_.TextDocumentFilter||(_.TextDocumentFilter={}));var GR;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(tr.string(n.notebookType)||tr.string(n.scheme)||tr.string(n.pattern))}t.is=e})(GR=_.NotebookDocumentFilter||(_.NotebookDocumentFilter={}));var UR;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(tr.string(n.notebook)||GR.is(n.notebook))&&(n.language===void 0||tr.string(n.language))}t.is=e})(UR=_.NotebookCellTextDocumentFilter||(_.NotebookCellTextDocumentFilter={}));var HR;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!tr.string(n)&&!jR.is(n)&&!UR.is(n))return!1;return!0}t.is=e})(HR=_.DocumentSelector||(_.DocumentSelector={}));var JI;(function(t){t.method="client/registerCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(JI=_.RegistrationRequest||(_.RegistrationRequest={}));var QI;(function(t){t.method="client/unregisterCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(QI=_.UnregistrationRequest||(_.UnregistrationRequest={}));var e$;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(e$=_.ResourceOperationKind||(_.ResourceOperationKind={}));var t$;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(t$=_.FailureHandlingKind||(_.FailureHandlingKind={}));var r$;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(r$=_.PositionEncodingKind||(_.PositionEncodingKind={}));var n$;(function(t){function e(r){let n=r;return n&&tr.string(n.id)&&n.id.length>0}t.hasId=e})(n$=_.StaticRegistrationOptions||(_.StaticRegistrationOptions={}));var i$;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||HR.is(n.documentSelector))}t.is=e})(i$=_.TextDocumentRegistrationOptions||(_.TextDocumentRegistrationOptions={}));var o$;(function(t){function e(n){let i=n;return tr.objectLiteral(i)&&(i.workDoneProgress===void 0||tr.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&tr.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(o$=_.WorkDoneProgressOptions||(_.WorkDoneProgressOptions={}));var a$;(function(t){t.method="initialize",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(a$=_.InitializeRequest||(_.InitializeRequest={}));var s$;(function(t){t.unknownProtocolVersion=1})(s$=_.InitializeErrorCodes||(_.InitializeErrorCodes={}));var u$;(function(t){t.method="initialized",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(u$=_.InitializedNotification||(_.InitializedNotification={}));var l$;(function(t){t.method="shutdown",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType0(t.method)})(l$=_.ShutdownRequest||(_.ShutdownRequest={}));var c$;(function(t){t.method="exit",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType0(t.method)})(c$=_.ExitNotification||(_.ExitNotification={}));var f$;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(f$=_.DidChangeConfigurationNotification||(_.DidChangeConfigurationNotification={}));var d$;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(d$=_.MessageType||(_.MessageType={}));var p$;(function(t){t.method="window/showMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(p$=_.ShowMessageNotification||(_.ShowMessageNotification={}));var h$;(function(t){t.method="window/showMessageRequest",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(h$=_.ShowMessageRequest||(_.ShowMessageRequest={}));var m$;(function(t){t.method="window/logMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(m$=_.LogMessageNotification||(_.LogMessageNotification={}));var g$;(function(t){t.method="telemetry/event",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(g$=_.TelemetryEventNotification||(_.TelemetryEventNotification={}));var y$;(function(t){t.None=0,t.Full=1,t.Incremental=2})(y$=_.TextDocumentSyncKind||(_.TextDocumentSyncKind={}));var v$;(function(t){t.method="textDocument/didOpen",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(v$=_.DidOpenTextDocumentNotification||(_.DidOpenTextDocumentNotification={}));var _$;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(_$=_.TextDocumentContentChangeEvent||(_.TextDocumentContentChangeEvent={}));var T$;(function(t){t.method="textDocument/didChange",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(T$=_.DidChangeTextDocumentNotification||(_.DidChangeTextDocumentNotification={}));var R$;(function(t){t.method="textDocument/didClose",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(R$=_.DidCloseTextDocumentNotification||(_.DidCloseTextDocumentNotification={}));var b$;(function(t){t.method="textDocument/didSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(b$=_.DidSaveTextDocumentNotification||(_.DidSaveTextDocumentNotification={}));var A$;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(A$=_.TextDocumentSaveReason||(_.TextDocumentSaveReason={}));var E$;(function(t){t.method="textDocument/willSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(E$=_.WillSaveTextDocumentNotification||(_.WillSaveTextDocumentNotification={}));var C$;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(C$=_.WillSaveTextDocumentWaitUntilRequest||(_.WillSaveTextDocumentWaitUntilRequest={}));var x$;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(x$=_.DidChangeWatchedFilesNotification||(_.DidChangeWatchedFilesNotification={}));var w$;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(w$=_.FileChangeType||(_.FileChangeType={}));var S$;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(MR.URI.is(n.baseUri)||MR.WorkspaceFolder.is(n.baseUri))&&tr.string(n.pattern)}t.is=e})(S$=_.RelativePattern||(_.RelativePattern={}));var k$;(function(t){t.Create=1,t.Change=2,t.Delete=4})(k$=_.WatchKind||(_.WatchKind={}));var P$;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(P$=_.PublishDiagnosticsNotification||(_.PublishDiagnosticsNotification={}));var D$;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(D$=_.CompletionTriggerKind||(_.CompletionTriggerKind={}));var N$;(function(t){t.method="textDocument/completion",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(N$=_.CompletionRequest||(_.CompletionRequest={}));var O$;(function(t){t.method="completionItem/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(O$=_.CompletionResolveRequest||(_.CompletionResolveRequest={}));var I$;(function(t){t.method="textDocument/hover",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(I$=_.HoverRequest||(_.HoverRequest={}));var $$;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})($$=_.SignatureHelpTriggerKind||(_.SignatureHelpTriggerKind={}));var M$;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(M$=_.SignatureHelpRequest||(_.SignatureHelpRequest={}));var L$;(function(t){t.method="textDocument/definition",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(L$=_.DefinitionRequest||(_.DefinitionRequest={}));var F$;(function(t){t.method="textDocument/references",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(F$=_.ReferencesRequest||(_.ReferencesRequest={}));var q$;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(q$=_.DocumentHighlightRequest||(_.DocumentHighlightRequest={}));var j$;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(j$=_.DocumentSymbolRequest||(_.DocumentSymbolRequest={}));var G$;(function(t){t.method="textDocument/codeAction",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(G$=_.CodeActionRequest||(_.CodeActionRequest={}));var U$;(function(t){t.method="codeAction/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(U$=_.CodeActionResolveRequest||(_.CodeActionResolveRequest={}));var H$;(function(t){t.method="workspace/symbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(H$=_.WorkspaceSymbolRequest||(_.WorkspaceSymbolRequest={}));var B$;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(B$=_.WorkspaceSymbolResolveRequest||(_.WorkspaceSymbolResolveRequest={}));var W$;(function(t){t.method="textDocument/codeLens",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(W$=_.CodeLensRequest||(_.CodeLensRequest={}));var K$;(function(t){t.method="codeLens/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(K$=_.CodeLensResolveRequest||(_.CodeLensResolveRequest={}));var z$;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType0(t.method)})(z$=_.CodeLensRefreshRequest||(_.CodeLensRefreshRequest={}));var V$;(function(t){t.method="textDocument/documentLink",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(V$=_.DocumentLinkRequest||(_.DocumentLinkRequest={}));var Y$;(function(t){t.method="documentLink/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(Y$=_.DocumentLinkResolveRequest||(_.DocumentLinkResolveRequest={}));var X$;(function(t){t.method="textDocument/formatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(X$=_.DocumentFormattingRequest||(_.DocumentFormattingRequest={}));var Z$;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(Z$=_.DocumentRangeFormattingRequest||(_.DocumentRangeFormattingRequest={}));var J$;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(J$=_.DocumentOnTypeFormattingRequest||(_.DocumentOnTypeFormattingRequest={}));var Q$;(function(t){t.Identifier=1})(Q$=_.PrepareSupportDefaultBehavior||(_.PrepareSupportDefaultBehavior={}));var e1;(function(t){t.method="textDocument/rename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(e1=_.RenameRequest||(_.RenameRequest={}));var t1;(function(t){t.method="textDocument/prepareRename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(t1=_.PrepareRenameRequest||(_.PrepareRenameRequest={}));var r1;(function(t){t.method="workspace/executeCommand",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(r1=_.ExecuteCommandRequest||(_.ExecuteCommandRequest={}));var n1;(function(t){t.method="workspace/applyEdit",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType("workspace/applyEdit")})(n1=_.ApplyWorkspaceEditRequest||(_.ApplyWorkspaceEditRequest={}))});var KR=b(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.createProtocolConnection=void 0;var WR=ti();function i1(t,e,r,n){return WR.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,WR.createMessageConnection)(t,e,r,n)}Bl.createProtocolConnection=i1});var zR=b(Cr=>{"use strict";var o1=Cr&&Cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wl=Cr&&Cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o1(e,t,r)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.LSPErrorCodes=Cr.createProtocolConnection=void 0;Wl(ti(),Cr);Wl(Ta(),Cr);Wl(Rt(),Cr);Wl(BR(),Cr);var a1=KR();Object.defineProperty(Cr,"createProtocolConnection",{enumerable:!0,get:function(){return a1.createProtocolConnection}});var s1;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(s1=Cr.LSPErrorCodes||(Cr.LSPErrorCodes={}))});var Lt=b(ii=>{"use strict";var u1=ii&&ii.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VR=ii&&ii.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u1(e,t,r)};Object.defineProperty(ii,"__esModule",{value:!0});ii.createProtocolConnection=void 0;var l1=Qh();VR(Qh(),ii);VR(zR(),ii);function c1(t,e,r,n){return(0,l1.createMessageConnection)(t,e,r,n)}ii.createProtocolConnection=c1});var fm=b(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.generateUuid=Jr.parse=Jr.isUUID=Jr.v4=Jr.empty=void 0;var Ys=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ge=class extends Ys{constructor(){super([ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-","4",ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._oneOf(ge._timeHighBits),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return ge._oneOf(ge._chars)}};ge._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ge._timeHighBits=["8","9","a","b"];Jr.empty=new Ys("00000000-0000-0000-0000-000000000000");function YR(){return new ge}Jr.v4=YR;var f1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function XR(t){return f1.test(t)}Jr.isUUID=XR;function d1(t){if(!XR(t))throw new Error("invalid uuid");return new Ys(t)}Jr.parse=d1;function p1(){return YR().asHex()}Jr.generateUuid=p1});var ZR=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.attachPartialResult=to.ProgressFeature=to.attachWorkDone=void 0;var eo=Lt(),h1=fm(),oi=class{constructor(e,r){this._connection=e,this._token=r,oi.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,n)}done(){oi.Instances.delete(this._token),this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,{kind:"end"})}};oi.Instances=new Map;var Kl=class extends oi{constructor(e,r){super(e,r),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Xs=class{constructor(){}begin(){}report(){}done(){}},zl=class extends Xs{constructor(){super(),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function m1(t,e){if(e===void 0||e.workDoneToken===void 0)return new Xs;let r=e.workDoneToken;return delete e.workDoneToken,new oi(t,r)}to.attachWorkDone=m1;var g1=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(eo.WorkDoneProgressCancelNotification.type,r=>{let n=oi.Instances.get(r.token);(n instanceof Kl||n instanceof zl)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Xs:new oi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,h1.generateUuid)();return this.connection.sendRequest(eo.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Kl(this.connection,e))}else return Promise.resolve(new zl)}};to.ProgressFeature=g1;var dm;(function(t){t.type=new eo.ProgressType})(dm||(dm={}));var pm=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(dm.type,this._token,e)}};function y1(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new pm(t,r)}to.attachPartialResult=y1});var JR=b(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.ConfigurationFeature=void 0;var v1=Lt(),_1=xl(),T1=t=>class extends t{getConfiguration(e){return e?_1.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(v1.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Vl.ConfigurationFeature=T1});var QR=b(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.WorkspaceFoldersFeature=void 0;var Yl=Lt(),R1=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Yl.Emitter,this.connection.onNotification(Yl.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Yl.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Yl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Xl.WorkspaceFoldersFeature=R1});var eb=b(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.CallHierarchyFeature=void 0;var hm=Lt(),b1=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(hm.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=hm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=hm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Zl.CallHierarchyFeature=b1});var gm=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.SemanticTokensBuilder=ro.SemanticTokensDiff=ro.SemanticTokensFeature=void 0;var Jl=Lt(),A1=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Jl.SemanticTokensRefreshRequest.type),on:e=>{let r=Jl.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Jl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Jl.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ro.SemanticTokensFeature=A1;var Ql=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let a=i-n+1,s=this.modifiedSequence.slice(n,o+1);return s.length===1&&s[0]===this.originalSequence[i]?[{start:n,deleteCount:a-1}]:[{start:n,deleteCount:a,data:s}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};ro.SemanticTokensDiff=Ql;var mm=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,r,n,i,o){let a=e,s=r;this._dataLen>0&&(a-=this._prevLine,a===0&&(s-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Ql(this._prevData,this._data).computeDiff()}:this.build()}};ro.SemanticTokensBuilder=mm});var tb=b(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.ShowDocumentFeature=void 0;var E1=Lt(),C1=t=>class extends t{showDocument(e){return this.connection.sendRequest(E1.ShowDocumentRequest.type,e)}};ec.ShowDocumentFeature=C1});var rb=b(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.FileOperationsFeature=void 0;var wa=Lt(),x1=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(wa.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(wa.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(wa.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(wa.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(wa.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(wa.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};tc.FileOperationsFeature=x1});var nb=b(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.LinkedEditingRangeFeature=void 0;var w1=Lt(),S1=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(w1.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};rc.LinkedEditingRangeFeature=S1});var ib=b(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.TypeHierarchyFeature=void 0;var ym=Lt(),k1=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(ym.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=ym.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=ym.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};nc.TypeHierarchyFeature=k1});var ab=b(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.InlineValueFeature=void 0;var ob=Lt(),P1=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ob.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(ob.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};ic.InlineValueFeature=P1});var sb=b(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.InlayHintFeature=void 0;var vm=Lt(),D1=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(vm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(vm.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(vm.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};oc.InlayHintFeature=D1});var ub=b(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.DiagnosticFeature=void 0;var Zs=Lt(),N1=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Zs.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Zs.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Zs.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(Zs.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Zs.WorkspaceDiagnosticRequest.partialResult,r)))}}};ac.DiagnosticFeature=N1});var Tm=b(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.TextDocuments=void 0;var Mo=Lt(),_m=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Mo.Emitter,this._onDidOpen=new Mo.Emitter,this._onDidClose=new Mo.Emitter,this._onDidSave=new Mo.Emitter,this._onWillSave=new Mo.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Mo.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:a}=i;if(a==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let s=this._syncedDocuments.get(i.uri);s!==void 0&&(s=this._configuration.update(s,o,a),this._syncedDocuments.set(i.uri,s),this._onDidChangeContent.fire(Object.freeze({document:s})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Mo.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};sc.TextDocuments=_m});var bm=b(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.NotebookDocuments=Sa.NotebookSyncFeature=void 0;var Qr=Lt(),lb=Tm(),O1=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Qr.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Qr.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Qr.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Qr.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};Sa.NotebookSyncFeature=O1;var no=class{onDidOpenTextDocument(e){return this.openHandler=e,Qr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Qr.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Qr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return no.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return no.NULL_DISPOSE}onDidSaveTextDocument(){return no.NULL_DISPOSE}};no.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Rm=class{constructor(e){e instanceof lb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new lb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Qr.Emitter,this._onDidChange=new Qr.Emitter,this._onDidSave=new Qr.Emitter,this._onDidClose=new Qr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new no,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let a=o.metadata,s=!1,u=i.change;u.metadata!==void 0&&(s=!0,o.metadata=u.metadata);let l=[],c=[],f=[],p=[];if(u.cells!==void 0){let x=u.cells;if(x.structure!==void 0){let T=x.structure.array;if(o.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),x.structure.didOpen!==void 0)for(let v of x.structure.didOpen)r.openTextDocument({textDocument:v}),l.push(v.uri);if(x.structure.didClose)for(let v of x.structure.didClose)r.closeTextDocument({textDocument:v}),c.push(v.uri)}if(x.data!==void 0){let T=new Map(x.data.map(v=>[v.document,v]));for(let v=0;v<=o.cells.length;v++){let k=T.get(o.cells[v].document);if(k!==void 0){let j=o.cells.splice(v,1,k);if(f.push({old:j[0],new:k}),T.delete(k.document),T.size===0)break}}}if(x.textContent!==void 0)for(let T of x.textContent)r.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),p.push(T.document.uri)}this.updateCellMap(o);let h={notebookDocument:o};s&&(h.metadata={old:a,new:o.metadata});let d=[];for(let x of l)d.push(this.getNotebookCell(x));let g=[];for(let x of c)g.push(this.getNotebookCell(x));let C=[];for(let x of p)C.push(this.getNotebookCell(x));(d.length>0||g.length>0||f.length>0||C.length>0)&&(h.cells={added:d,removed:g,changed:{data:f,textContent:C}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let a of i.cellTextDocuments)r.closeTextDocument({textDocument:a});this.notebookDocuments.delete(i.notebookDocument.uri);for(let a of o.cells)this.notebookCellMap.delete(a.document)}})),Qr.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Sa.NotebookDocuments=Rm});var cb=b(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.MonikerFeature=void 0;var I1=Lt(),$1=t=>class extends t{get moniker(){return{on:e=>{let r=I1.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};uc.MonikerFeature=$1});var Sm=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.createConnection=we.combineFeatures=we.combineNotebooksFeatures=we.combineLanguagesFeatures=we.combineWorkspaceFeatures=we.combineWindowFeatures=we.combineClientFeatures=we.combineTracerFeatures=we.combineTelemetryFeatures=we.combineConsoleFeatures=we._NotebooksImpl=we._LanguagesImpl=we.BulkUnregistration=we.BulkRegistration=we.ErrorMessageTracker=void 0;var V=Lt(),en=xl(),Em=fm(),ce=ZR(),M1=JR(),L1=QR(),F1=eb(),q1=gm(),j1=tb(),G1=rb(),U1=nb(),H1=ib(),B1=ab(),W1=sb(),K1=ub(),z1=bm(),V1=cb();function Am(t){if(t!==null)return t}var Cm=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};we.ErrorMessageTracker=Cm;var lc=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},xm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:V.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}showWarningMessage(e,...r){let n={type:V.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}showInformationMessage(e,...r){let n={type:V.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}},fb=(0,j1.ShowDocumentFeature)((0,ce.ProgressFeature)(xm)),Y1;(function(t){function e(){return new cc}t.create=e})(Y1=we.BulkRegistration||(we.BulkRegistration={}));var cc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=en.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=Em.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},X1;(function(t){function e(){return new Js(void 0,[])}t.create=e})(X1=we.BulkUnregistration||(we.BulkUnregistration={}));var Js=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(V.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=en.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},fc=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof cc?this.registerMany(e):e instanceof Js?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=en.string(r)?r:r.method,o=Em.generateUuid(),a={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,a).then(s=>(e.add({id:o,method:i}),e),s=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(s)))}registerSingle2(e,r){let n=en.string(e)?e:e.method,i=Em.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,o).then(a=>V.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),a=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(a)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(V.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(V.RegistrationRequest.type,r).then(()=>new Js(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},wm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,n)}},db=(0,G1.FileOperationsFeature)((0,L1.WorkspaceFoldersFeature)((0,M1.ConfigurationFeature)(wm))),dc=class{constructor(){this._trace=V.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?r:void 0}).catch(()=>{})}},pc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},hc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ce.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,ce.attachPartialResult)(this.connection,r)}};we._LanguagesImpl=hc;var pb=(0,V1.MonikerFeature)((0,K1.DiagnosticFeature)((0,W1.InlayHintFeature)((0,B1.InlineValueFeature)((0,H1.TypeHierarchyFeature)((0,U1.LinkedEditingRangeFeature)((0,q1.SemanticTokensFeature)((0,F1.CallHierarchyFeature)(hc)))))))),mc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ce.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,ce.attachPartialResult)(this.connection,r)}};we._NotebooksImpl=mc;var hb=(0,z1.NotebookSyncFeature)(mc);function mb(t,e){return function(r){return e(t(r))}}we.combineConsoleFeatures=mb;function gb(t,e){return function(r){return e(t(r))}}we.combineTelemetryFeatures=gb;function yb(t,e){return function(r){return e(t(r))}}we.combineTracerFeatures=yb;function vb(t,e){return function(r){return e(t(r))}}we.combineClientFeatures=vb;function _b(t,e){return function(r){return e(t(r))}}we.combineWindowFeatures=_b;function Tb(t,e){return function(r){return e(t(r))}}we.combineWorkspaceFeatures=Tb;function Rb(t,e){return function(r){return e(t(r))}}we.combineLanguagesFeatures=Rb;function bb(t,e){return function(r){return e(t(r))}}we.combineNotebooksFeatures=bb;function Z1(t,e){function r(i,o,a){return i&&o?a(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,mb),tracer:r(t.tracer,e.tracer,yb),telemetry:r(t.telemetry,e.telemetry,gb),client:r(t.client,e.client,vb),window:r(t.window,e.window,_b),workspace:r(t.workspace,e.workspace,Tb),languages:r(t.languages,e.languages,Rb),notebooks:r(t.notebooks,e.notebooks,bb)}}we.combineFeatures=Z1;function J1(t,e,r){let n=r&&r.console?new(r.console(lc)):new lc,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(dc)):new dc,a=r&&r.telemetry?new(r.telemetry(pc)):new pc,s=r&&r.client?new(r.client(fc)):new fc,u=r&&r.window?new(r.window(fb)):new fb,l=r&&r.workspace?new(r.workspace(db)):new db,c=r&&r.languages?new(r.languages(pb)):new pb,f=r&&r.notebooks?new(r.notebooks(hb)):new hb,p=[n,o,a,s,u,l,c,f];function h(T){return T instanceof Promise?T:en.thenable(T)?new Promise((v,k)=>{T.then(j=>v(j),j=>k(j))}):Promise.resolve(T)}let d,g,C,x={listen:()=>i.listen(),sendRequest:(T,...v)=>i.sendRequest(en.string(T)?T:T.method,...v),onRequest:(T,v)=>i.onRequest(T,v),sendNotification:(T,v)=>{let k=en.string(T)?T:T.method;return arguments.length===1?i.sendNotification(k):i.sendNotification(k,v)},onNotification:(T,v)=>i.onNotification(T,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(g=T,{dispose:()=>{g=void 0}}),onInitialized:T=>i.onNotification(V.InitializedNotification.type,T),onShutdown:T=>(d=T,{dispose:()=>{d=void 0}}),onExit:T=>(C=T,{dispose:()=>{C=void 0}}),get console(){return n},get telemetry(){return a},get tracer(){return o},get client(){return s},get window(){return u},get workspace(){return l},get languages(){return c},get notebooks(){return f},onDidChangeConfiguration:T=>i.onNotification(V.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(V.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(V.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(V.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(V.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(V.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(V.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(V.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(V.HoverRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onCompletion:T=>i.onRequest(V.CompletionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCompletionResolve:T=>i.onRequest(V.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(V.SignatureHelpRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDeclaration:T=>i.onRequest(V.DeclarationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDefinition:T=>i.onRequest(V.DefinitionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onTypeDefinition:T=>i.onRequest(V.TypeDefinitionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onImplementation:T=>i.onRequest(V.ImplementationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onReferences:T=>i.onRequest(V.ReferencesRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentHighlight:T=>i.onRequest(V.DocumentHighlightRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentSymbol:T=>i.onRequest(V.DocumentSymbolRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onWorkspaceSymbol:T=>i.onRequest(V.WorkspaceSymbolRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:T=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(V.CodeActionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCodeActionResolve:T=>i.onRequest(V.CodeActionResolveRequest.type,(v,k)=>T(v,k)),onCodeLens:T=>i.onRequest(V.CodeLensRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCodeLensResolve:T=>i.onRequest(V.CodeLensResolveRequest.type,(v,k)=>T(v,k)),onDocumentFormatting:T=>i.onRequest(V.DocumentFormattingRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:T=>i.onRequest(V.DocumentRangeFormattingRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(v,k)=>T(v,k)),onRenameRequest:T=>i.onRequest(V.RenameRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onPrepareRename:T=>i.onRequest(V.PrepareRenameRequest.type,(v,k)=>T(v,k)),onDocumentLinks:T=>i.onRequest(V.DocumentLinkRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentLinkResolve:T=>i.onRequest(V.DocumentLinkResolveRequest.type,(v,k)=>T(v,k)),onDocumentColor:T=>i.onRequest(V.DocumentColorRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onColorPresentation:T=>i.onRequest(V.ColorPresentationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onFoldingRanges:T=>i.onRequest(V.FoldingRangeRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onSelectionRanges:T=>i.onRequest(V.SelectionRangeRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onExecuteCommand:T=>i.onRequest(V.ExecuteCommandRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let T of p)T.attach(x);return i.onRequest(V.InitializeRequest.type,T=>{e.initialize(T),en.string(T.trace)&&(o.trace=V.Trace.fromString(T.trace));for(let v of p)v.initialize(T.capabilities);if(g){let v=g(T,new V.CancellationTokenSource().token,(0,ce.attachWorkDone)(i,T),void 0);return h(v).then(k=>{if(k instanceof V.ResponseError)return k;let j=k;j||(j={capabilities:{}});let O=j.capabilities;O||(O={},j.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=en.number(x.__textDocumentSync)?x.__textDocumentSync:V.TextDocumentSyncKind.None:!en.number(O.textDocumentSync)&&!en.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=en.number(x.__textDocumentSync)?x.__textDocumentSync:V.TextDocumentSyncKind.None);for(let $ of p)$.fillServerCapabilities(O);return j})}else{let v={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let k of p)k.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,d)return d(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,T=>{o.trace=V.Trace.fromString(T.value)}),x}we.createConnection=J1});var Eb=b(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.resolveModulePath=xr.FileSystem=xr.resolveGlobalYarnPath=xr.resolveGlobalNodePath=xr.resolve=xr.uriToFilePath=void 0;var Q1=require("url"),On=require("path"),km=require("fs"),Nm=require("child_process");function eM(t){let e=Q1.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let o=r[0],a=r[1];o.length===0&&a.length>1&&a[1]===":"&&r.shift()}return On.normalize(r.join("/"))}xr.uriToFilePath=eM;function Pm(){return process.platform==="win32"}function gc(t,e,r,n){let i="NODE_PATH",o=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((a,s)=>{let u=process.env,l=Object.create(null);Object.keys(u).forEach(c=>l[c]=u[c]),e&&km.existsSync(e)&&(l[i]?l[i]=e+On.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let c=(0,Nm.fork)("",[],{cwd:r,env:l,execArgv:["-e",o]});if(c.pid===void 0){s(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",p=>{s(p)}),c.on("message",p=>{p.c==="r"&&(c.send({c:"e"}),p.s?a(p.r):s(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){s(c)}})}xr.resolve=gc;function Dm(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(o=>r[o]=process.env[o]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Pm()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let o=(0,Nm.spawnSync)(e,["config","get","prefix"],n).stdout;if(!o){t&&t("'npm config get prefix' didn't return a value.");return}let a=o.trim();return t&&t(`'npm config get prefix' value is: ${a}`),a.length>0?Pm()?On.join(a,"node_modules"):On.join(a,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}xr.resolveGlobalNodePath=Dm;function tM(t){let e="yarn",r={encoding:"utf8"};Pm()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,Nm.spawnSync)(e,["global","dir","--json"],r),o=i.stdout;if(!o){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let a=o.trim().split(/\r?\n/);for(let s of a)try{let u=JSON.parse(s);if(u.type==="log")return On.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}xr.resolveGlobalYarnPath=tM;var Ab;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!km.existsSync(__filename.toUpperCase())||!km.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,o){return r()?On.normalize(o).indexOf(On.normalize(i))===0:On.normalize(o).toLowerCase().indexOf(On.normalize(i).toLowerCase())===0}t.isParent=n})(Ab=xr.FileSystem||(xr.FileSystem={}));function rM(t,e,r,n){return r?(On.isAbsolute(r)||(r=On.join(t,r)),gc(e,r,r,n).then(i=>Ab.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>gc(e,Dm(n),t,n))):gc(e,Dm(n),t,n)}xr.resolveModulePath=rM});var Om=b((p4,Cb)=>{"use strict";Cb.exports=Lt()});var wb=b(rr=>{"use strict";var nM=rr&&rr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xb=rr&&rr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nM(e,t,r)};Object.defineProperty(rr,"__esModule",{value:!0});rr.ProposedFeatures=rr.NotebookDocuments=rr.TextDocuments=rr.SemanticTokensBuilder=void 0;var iM=gm();Object.defineProperty(rr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return iM.SemanticTokensBuilder}});xb(Lt(),rr);var oM=Tm();Object.defineProperty(rr,"TextDocuments",{enumerable:!0,get:function(){return oM.TextDocuments}});var aM=bm();Object.defineProperty(rr,"NotebookDocuments",{enumerable:!0,get:function(){return aM.NotebookDocuments}});xb(Sm(),rr);var sM;(function(t){t.all={__brand:"features"}})(sM=rr.ProposedFeatures||(rr.ProposedFeatures={}))});var Xe=b(Wr=>{"use strict";var uM=Wr&&Wr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kb=Wr&&Wr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uM(e,t,r)};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createConnection=Wr.Files=void 0;var Im=xl(),lM=Sm(),Qs=Eb(),Lo=Om();kb(Om(),Wr);kb(wb(),Wr);var cM;(function(t){t.uriToFilePath=Qs.uriToFilePath,t.resolveGlobalNodePath=Qs.resolveGlobalNodePath,t.resolveGlobalYarnPath=Qs.resolveGlobalYarnPath,t.resolve=Qs.resolve,t.resolveModulePath=Qs.resolveModulePath})(cM=Wr.Files||(Wr.Files={}));var Sb;function yc(){if(Sb!==void 0)try{Sb.end()}catch{}}var ka=!1,Pb;function fM(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(Pb=setInterval(()=>{try{process.kill(n,0)}catch{yc(),process.exit(ka?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}fM();var dM={initialize:t=>{let e=t.processId;Im.number(e)&&Pb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ka?0:1)}},3e3)},get shutdownReceived(){return ka},set shutdownReceived(t){ka=t},exit:t=>{yc(),process.exit(t)}};function pM(t,e,r,n){let i,o,a,s;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Lo.ConnectionStrategy.is(t)||Lo.ConnectionOptions.is(t)?s=t:(o=t,a=e,s=r),hM(o,a,s,i)}Wr.createConnection=pM;function hM(t,e,r,n){if(!t&&!e&&process.argv.length>2){let s,u,l=process.argv.slice(2);for(let c=0;c<l.length;c++){let f=l[c];if(f==="--node-ipc"){t=new Lo.IPCMessageReader(process),e=new Lo.IPCMessageWriter(process);break}else if(f==="--stdio"){t=process.stdin,e=process.stdout;break}else if(f==="--socket"){s=parseInt(l[c+1]);break}else if(f==="--pipe"){u=l[c+1];break}else{var i=f.split("=");if(i[0]==="--socket"){s=parseInt(i[1]);break}else if(i[0]==="--pipe"){u=i[1];break}}}if(s){let c=(0,Lo.createServerSocketTransport)(s);t=c[0],e=c[1]}else if(u){let c=(0,Lo.createServerPipeTransport)(u);t=c[0],e=c[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Im.func(t.read)&&Im.func(t.on)){let s=t;s.on("end",()=>{yc(),process.exit(ka?0:1)}),s.on("close",()=>{yc(),process.exit(ka?0:1)})}let a=s=>(0,Lo.createProtocolConnection)(t,e,s,r);return(0,lM.createConnection)(a,dM,n)}});var _c=b((Db,vc)=>{(function(t){if(typeof vc=="object"&&typeof vc.exports=="object"){var e=t(require,Db);e!==void 0&&(vc.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=void 0;class r{constructor(l,c,f,p){this._uri=l,this._languageId=c,this._version=f,this._content=p,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(l){if(l){let c=this.offsetAt(l.start),f=this.offsetAt(l.end);return this._content.substring(c,f)}return this._content}update(l,c){for(let f of l)if(r.isIncremental(f)){let p=a(f.range),h=this.offsetAt(p.start),d=this.offsetAt(p.end);this._content=this._content.substring(0,h)+f.text+this._content.substring(d,this._content.length);let g=Math.max(p.start.line,0),C=Math.max(p.end.line,0),x=this._lineOffsets,T=o(f.text,!1,h);if(C-g===T.length)for(let k=0,j=T.length;k<j;k++)x[k+g+1]=T[k];else T.length<1e4?x.splice(g+1,C-g,...T):this._lineOffsets=x=x.slice(0,g+1).concat(T,x.slice(C+1));let v=f.text.length-(d-h);if(v!==0)for(let k=g+1+T.length,j=x.length;k<j;k++)x[k]=x[k]+v}else if(r.isFull(f))this._content=f.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=c}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=o(this._content,!0)),this._lineOffsets}positionAt(l){l=Math.max(Math.min(l,this._content.length),0);let c=this.getLineOffsets(),f=0,p=c.length;if(p===0)return{line:0,character:l};for(;f<p;){let d=Math.floor((f+p)/2);c[d]>l?p=d:f=d+1}let h=f-1;return{line:h,character:l-c[h]}}offsetAt(l){let c=this.getLineOffsets();if(l.line>=c.length)return this._content.length;if(l.line<0)return 0;let f=c[l.line],p=l.line+1<c.length?c[l.line+1]:this._content.length;return Math.max(Math.min(f+l.character,p),f)}get lineCount(){return this.getLineOffsets().length}static isIncremental(l){let c=l;return c!=null&&typeof c.text=="string"&&c.range!==void 0&&(c.rangeLength===void 0||typeof c.rangeLength=="number")}static isFull(l){let c=l;return c!=null&&typeof c.text=="string"&&c.range===void 0&&c.rangeLength===void 0}}var n;(function(u){function l(p,h,d,g){return new r(p,h,d,g)}u.create=l;function c(p,h,d){if(p instanceof r)return p.update(h,d),p;throw new Error("TextDocument.update: document must be created by TextDocument.create")}u.update=c;function f(p,h){let d=p.getText(),g=i(h.map(s),(T,v)=>{let k=T.range.start.line-v.range.start.line;return k===0?T.range.start.character-v.range.start.character:k}),C=0,x=[];for(let T of g){let v=p.offsetAt(T.range.start);if(v<C)throw new Error("Overlapping edit");v>C&&x.push(d.substring(C,v)),T.newText.length&&x.push(T.newText),C=p.offsetAt(T.range.end)}return x.push(d.substr(C)),x.join("")}u.applyEdits=f})(n=e.TextDocument||(e.TextDocument={}));function i(u,l){if(u.length<=1)return u;let c=u.length/2|0,f=u.slice(0,c),p=u.slice(c);i(f,l),i(p,l);let h=0,d=0,g=0;for(;h<f.length&&d<p.length;)l(f[h],p[d])<=0?u[g++]=f[h++]:u[g++]=p[d++];for(;h<f.length;)u[g++]=f[h++];for(;d<p.length;)u[g++]=p[d++];return u}function o(u,l,c=0){let f=l?[c]:[];for(let p=0;p<u.length;p++){let h=u.charCodeAt(p);(h===13||h===10)&&(h===13&&p+1<u.length&&u.charCodeAt(p+1)===10&&p++,f.push(c+p+1))}return f}function a(u){let l=u.start,c=u.end;return l.line>c.line||l.line===c.line&&l.character>c.character?{start:c,end:l}:u}function s(u){let l=a(u.range);return l!==u.range?{newText:u.newText,range:l}:u}})});var Pa=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.isRootCstNode=io.isLeafCstNode=io.isCompositeCstNode=void 0;function Nb(t){return typeof t=="object"&&!!t&&"children"in t}io.isCompositeCstNode=Nb;function mM(t){return typeof t=="object"&&!!t&&"tokenType"in t}io.isLeafCstNode=mM;function gM(t){return Nb(t)&&"fullText"in t}io.isRootCstNode=gM});var Bt=b(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.Reduction=it.TreeStreamImpl=it.stream=it.DONE_RESULT=it.EMPTY_STREAM=it.StreamImpl=void 0;var nr=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new nr(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return it.DONE_RESULT})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=yM(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new nr(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?it.DONE_RESULT:{done:!1,value:e(i)}})}filter(e){return new nr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return it.DONE_RESULT})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new nr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Tc(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return it.DONE_RESULT})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new nr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Tc(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return it.DONE_RESULT})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new nr(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new nr(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?it.DONE_RESULT:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};it.StreamImpl=nr;function yM(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Tc(t){return!!t&&typeof t[Symbol.iterator]=="function"}it.EMPTY_STREAM=new nr(()=>{},()=>it.DONE_RESULT);it.DONE_RESULT=Object.freeze({done:!0,value:void 0});function vM(...t){if(t.length===1){let e=t[0];if(e instanceof nr)return e;if(Tc(e))return new nr(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new nr(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:it.DONE_RESULT)}return t.length>1?new nr(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Tc(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return it.DONE_RESULT}):it.EMPTY_STREAM}it.stream=vM;var $m=class extends nr{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return it.DONE_RESULT})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}};it.TreeStreamImpl=$m;var _M;(function(t){function e(o){return o.reduce((a,s)=>a+s,0)}t.sum=e;function r(o){return o.reduce((a,s)=>a*s,0)}t.product=r;function n(o){return o.reduce((a,s)=>Math.min(a,s))}t.min=n;function i(o){return o.reduce((a,s)=>Math.max(a,s))}t.max=i})(_M=it.Reduction||(it.Reduction={}))});var pt=b(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.getInteriorNodes=Be.getStartlineNode=Be.getNextNode=Be.getPreviousNode=Be.findLeafNodeAtOffset=Be.isCommentNode=Be.findCommentNode=Be.findDeclarationNodeAtOffset=Be.DefaultNameRegexp=Be.toDocumentSegment=Be.tokenToRange=Be.flattenCst=Be.streamCst=void 0;var Da=Pa(),TM=Bt();function Ib(t){return new TM.TreeStreamImpl(t,e=>(0,Da.isCompositeCstNode)(e)?e.children:[],{includeRoot:!0})}Be.streamCst=Ib;function RM(t){return Ib(t).filter(Da.isLeafCstNode)}Be.flattenCst=RM;function bM(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}Be.tokenToRange=bM;function AM(t){let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}Be.toDocumentSegment=AM;Be.DefaultNameRegexp=/^[\w\p{L}]$/u;function EM(t,e,r=Be.DefaultNameRegexp){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Lm(t,e)}}Be.findDeclarationNodeAtOffset=EM;function CM(t,e){if(t){let r=$b(t,!0);if(r&&Mm(r,e))return r;if((0,Da.isRootCstNode)(t)){let n=t.children.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.children[i];if(Mm(o,e))return o}}}}Be.findCommentNode=CM;function Mm(t,e){return(0,Da.isLeafCstNode)(t)&&e.includes(t.tokenType.name)}Be.isCommentNode=Mm;function Lm(t,e){if((0,Da.isLeafCstNode)(t))return t;if((0,Da.isCompositeCstNode)(t)){let r=0,n=t.children.length-1;for(;r<=n;){let i=Math.floor((r+n)/2),o=t.children[i];if(o.offset>e)n=i-1;else if(o.end<=e)r=i+1;else return Lm(o,e)}}}Be.findLeafNodeAtOffset=Lm;function $b(t,e=!0){for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);if(n===0)t=r;else{n--;let i=r.children[n];if(e||!i.hidden)return i}}}Be.getPreviousNode=$b;function xM(t,e=!0){for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);if(r.children.length-1===n)t=r;else{n++;let i=r.children[n];if(e||!i.hidden)return i}}}Be.getNextNode=xM;function wM(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.parent;){let i=t.parent,o=n??i.children.indexOf(t);if(o===0?(t=i,n=void 0):(n=o-1,t=i.children[n]),t.range.start.line!==e)break;r=t}return r}Be.getStartlineNode=wM;function SM(t,e){let r=kM(t,e);return r?r.parent.children.slice(r.a+1,r.b):[]}Be.getInteriorNodes=SM;function kM(t,e){let r=Ob(t),n=Ob(e),i;for(let o=0;o<r.length&&o<n.length;o++){let a=r[o],s=n[o];if(a.parent===s.parent)i={parent:a.parent,a:a.index,b:s.index};else break}return i}function Ob(t){let e=[];for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}});var eu=b(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.eagerLoad=Na.inject=void 0;function PM(t,e,r,n){let i=[t,e,r,n].reduce(jb,{});return qb(i)}Na.inject=PM;var Fm=Symbol("isProxy");function Fb(t){if(t&&t[Fm])for(let e of Object.values(t))Fb(e);return t}Na.eagerLoad=Fb;function qb(t,e){let r=new Proxy({},{deleteProperty:()=>!1,get:(n,i)=>Lb(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(Lb(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Reflect.ownKeys(t),Fm]});return r[Fm]=!0,r}var Mb=Symbol();function Lb(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===Mb)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/di/cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=Mb;try{t[e]=typeof i=="function"?i(n):qb(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function jb(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=jb(i,n):t[r]=n}}return t}});var Ie=b(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.findLocalReferences=je.streamReferences=je.streamAst=je.streamAllContents=je.streamContents=je.findRootNode=je.getDocument=je.hasContainerOfType=je.getContainerOfType=je.isLinkingError=je.isAstNodeDescription=je.isReference=je.linkContentToContainer=je.isAstNode=void 0;var Fo=Bt();function Oa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}je.isAstNode=Oa;function DM(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Oa(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Oa(r)&&(r.$container=t,r.$containerProperty=e))}je.linkContentToContainer=DM;function Rc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}je.isReference=Rc;function NM(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}je.isAstNodeDescription=NM;function OM(t){return typeof t=="object"&&t!==null&&Oa(t.container)&&Rc(t.reference)&&typeof t.message=="string"}je.isLinkingError=OM;function IM(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}je.getContainerOfType=IM;function $M(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}je.hasContainerOfType=$M;function Gb(t){let r=Ub(t).$document;if(!r)throw new Error("AST node has no document.");return r}je.getDocument=Gb;function Ub(t){for(;t.$container;)t=t.$container;return t}je.findRootNode=Ub;function qm(t){return new Fo.StreamImpl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Oa(n))return e.keyIndex++,{done:!1,value:n};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Oa(o))return{done:!1,value:o}}e.arrayIndex=0}}e.keyIndex++}return Fo.DONE_RESULT})}je.streamContents=qm;function MM(t){return new Fo.TreeStreamImpl(t,e=>qm(e))}je.streamAllContents=MM;function Hb(t){return new Fo.TreeStreamImpl(t,e=>qm(e),{includeRoot:!0})}je.streamAst=Hb;function Bb(t){return new Fo.StreamImpl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Rc(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Rc(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Fo.DONE_RESULT})}je.streamReferences=Bb;function LM(t,e=Gb(t).parseResult.value){let r=[];return Hb(e).forEach(n=>{Bb(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),(0,Fo.stream)(r)}je.findLocalReferences=LM});var tn=b(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.MultiMap=void 0;var Ia=Bt(),jm=class{constructor(){this.map=new Map}get size(){return Ia.Reduction.sum((0,Ia.stream)(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return(0,Ia.stream)(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return(0,Ia.stream)(this.map.keys())}values(){return(0,Ia.stream)(this.map.values()).flat()}entriesGroupedByKey(){return(0,Ia.stream)(this.map.entries())}};bc.MultiMap=jm});var Ec=b($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.EmptyFileSystem=$a.EmptyFileSystemProvider=void 0;var Ac=class{readFile(){throw new Error("Method not implemented.")}readFileSync(){throw new Error("Method not implemented.")}async readDirectory(){return[]}};$a.EmptyFileSystemProvider=Ac;$a.EmptyFileSystem={fileSystemProvider:()=>new Ac}});var ot=b(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.isParserRule=A.ParserRule=A.isParameterReference=A.ParameterReference=A.isParameter=A.Parameter=A.isNegation=A.Negation=A.isNegatedToken=A.NegatedToken=A.isNamedArgument=A.NamedArgument=A.isLiteralCondition=A.LiteralCondition=A.isKeyword=A.Keyword=A.isInterface=A.Interface=A.isInferredType=A.InferredType=A.isGroup=A.Group=A.isGrammarImport=A.GrammarImport=A.isGrammar=A.Grammar=A.isDisjunction=A.Disjunction=A.isCrossReference=A.CrossReference=A.isConjunction=A.Conjunction=A.isCharacterRange=A.CharacterRange=A.isAtomType=A.AtomType=A.isAssignment=A.Assignment=A.isAlternatives=A.Alternatives=A.isAction=A.Action=A.isAbstractElement=A.AbstractElement=A.isCondition=A.Condition=A.isAbstractType=A.AbstractType=A.isAbstractRule=A.AbstractRule=void 0;A.reflection=A.LangiumGrammarAstReflection=A.isWildcard=A.Wildcard=A.isUntilToken=A.UntilToken=A.isUnorderedGroup=A.UnorderedGroup=A.isTypeAttribute=A.TypeAttribute=A.isType=A.Type=A.isTerminalRuleCall=A.TerminalRuleCall=A.isTerminalRule=A.TerminalRule=A.isTerminalGroup=A.TerminalGroup=A.isTerminalAlternatives=A.TerminalAlternatives=A.isRuleCall=A.RuleCall=A.isReturnType=A.ReturnType=A.isRegexToken=A.RegexToken=void 0;var FM=Ie();A.AbstractRule="AbstractRule";function qM(t){return A.reflection.isInstance(t,A.AbstractRule)}A.isAbstractRule=qM;A.AbstractType="AbstractType";function jM(t){return A.reflection.isInstance(t,A.AbstractType)}A.isAbstractType=jM;A.Condition="Condition";function GM(t){return A.reflection.isInstance(t,A.Condition)}A.isCondition=GM;A.AbstractElement="AbstractElement";function UM(t){return A.reflection.isInstance(t,A.AbstractElement)}A.isAbstractElement=UM;A.Action="Action";function HM(t){return A.reflection.isInstance(t,A.Action)}A.isAction=HM;A.Alternatives="Alternatives";function BM(t){return A.reflection.isInstance(t,A.Alternatives)}A.isAlternatives=BM;A.Assignment="Assignment";function WM(t){return A.reflection.isInstance(t,A.Assignment)}A.isAssignment=WM;A.AtomType="AtomType";function KM(t){return A.reflection.isInstance(t,A.AtomType)}A.isAtomType=KM;A.CharacterRange="CharacterRange";function zM(t){return A.reflection.isInstance(t,A.CharacterRange)}A.isCharacterRange=zM;A.Conjunction="Conjunction";function VM(t){return A.reflection.isInstance(t,A.Conjunction)}A.isConjunction=VM;A.CrossReference="CrossReference";function YM(t){return A.reflection.isInstance(t,A.CrossReference)}A.isCrossReference=YM;A.Disjunction="Disjunction";function XM(t){return A.reflection.isInstance(t,A.Disjunction)}A.isDisjunction=XM;A.Grammar="Grammar";function ZM(t){return A.reflection.isInstance(t,A.Grammar)}A.isGrammar=ZM;A.GrammarImport="GrammarImport";function JM(t){return A.reflection.isInstance(t,A.GrammarImport)}A.isGrammarImport=JM;A.Group="Group";function QM(t){return A.reflection.isInstance(t,A.Group)}A.isGroup=QM;A.InferredType="InferredType";function eL(t){return A.reflection.isInstance(t,A.InferredType)}A.isInferredType=eL;A.Interface="Interface";function tL(t){return A.reflection.isInstance(t,A.Interface)}A.isInterface=tL;A.Keyword="Keyword";function rL(t){return A.reflection.isInstance(t,A.Keyword)}A.isKeyword=rL;A.LiteralCondition="LiteralCondition";function nL(t){return A.reflection.isInstance(t,A.LiteralCondition)}A.isLiteralCondition=nL;A.NamedArgument="NamedArgument";function iL(t){return A.reflection.isInstance(t,A.NamedArgument)}A.isNamedArgument=iL;A.NegatedToken="NegatedToken";function oL(t){return A.reflection.isInstance(t,A.NegatedToken)}A.isNegatedToken=oL;A.Negation="Negation";function aL(t){return A.reflection.isInstance(t,A.Negation)}A.isNegation=aL;A.Parameter="Parameter";function sL(t){return A.reflection.isInstance(t,A.Parameter)}A.isParameter=sL;A.ParameterReference="ParameterReference";function uL(t){return A.reflection.isInstance(t,A.ParameterReference)}A.isParameterReference=uL;A.ParserRule="ParserRule";function lL(t){return A.reflection.isInstance(t,A.ParserRule)}A.isParserRule=lL;A.RegexToken="RegexToken";function cL(t){return A.reflection.isInstance(t,A.RegexToken)}A.isRegexToken=cL;A.ReturnType="ReturnType";function fL(t){return A.reflection.isInstance(t,A.ReturnType)}A.isReturnType=fL;A.RuleCall="RuleCall";function dL(t){return A.reflection.isInstance(t,A.RuleCall)}A.isRuleCall=dL;A.TerminalAlternatives="TerminalAlternatives";function pL(t){return A.reflection.isInstance(t,A.TerminalAlternatives)}A.isTerminalAlternatives=pL;A.TerminalGroup="TerminalGroup";function hL(t){return A.reflection.isInstance(t,A.TerminalGroup)}A.isTerminalGroup=hL;A.TerminalRule="TerminalRule";function mL(t){return A.reflection.isInstance(t,A.TerminalRule)}A.isTerminalRule=mL;A.TerminalRuleCall="TerminalRuleCall";function gL(t){return A.reflection.isInstance(t,A.TerminalRuleCall)}A.isTerminalRuleCall=gL;A.Type="Type";function yL(t){return A.reflection.isInstance(t,A.Type)}A.isType=yL;A.TypeAttribute="TypeAttribute";function vL(t){return A.reflection.isInstance(t,A.TypeAttribute)}A.isTypeAttribute=vL;A.UnorderedGroup="UnorderedGroup";function _L(t){return A.reflection.isInstance(t,A.UnorderedGroup)}A.isUnorderedGroup=_L;A.UntilToken="UntilToken";function TL(t){return A.reflection.isInstance(t,A.UntilToken)}A.isUntilToken=TL;A.Wildcard="Wildcard";function RL(t){return A.reflection.isInstance(t,A.Wildcard)}A.isWildcard=RL;var Cc=class{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","Assignment","AtomType","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","LiteralCondition","NamedArgument","NegatedToken","Negation","Parameter","ParameterReference","ParserRule","RegexToken","ReturnType","RuleCall","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","UnorderedGroup","UntilToken","Wildcard"]}isInstance(e,r){return(0,FM.isAstNode)(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;switch(e){case A.Action:return this.isSubtype(A.AbstractElement,r)||this.isSubtype(A.AbstractType,r);case A.Alternatives:case A.Assignment:case A.CharacterRange:case A.CrossReference:case A.Group:case A.Keyword:case A.NegatedToken:case A.RegexToken:case A.RuleCall:case A.TerminalAlternatives:case A.TerminalGroup:case A.TerminalRuleCall:case A.UnorderedGroup:case A.UntilToken:case A.Wildcard:return this.isSubtype(A.AbstractElement,r);case A.Conjunction:case A.Disjunction:case A.LiteralCondition:case A.Negation:case A.ParameterReference:return this.isSubtype(A.Condition,r);case A.Interface:case A.Type:return this.isSubtype(A.AbstractType,r);case A.ParserRule:return this.isSubtype(A.AbstractRule,r)||this.isSubtype(A.AbstractType,r);case A.TerminalRule:return this.isSubtype(A.AbstractRule,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":return A.AbstractType;case"AtomType:refType":return A.AbstractType;case"CrossReference:type":return A.AbstractType;case"Grammar:hiddenTokens":return A.AbstractRule;case"Grammar:usedGrammars":return A.Grammar;case"Interface:superTypes":return A.AbstractType;case"NamedArgument:parameter":return A.Parameter;case"ParameterReference:parameter":return A.Parameter;case"ParserRule:hiddenTokens":return A.AbstractRule;case"ParserRule:returnType":return A.AbstractType;case"RuleCall:rule":return A.AbstractRule;case"TerminalRuleCall:rule":return A.TerminalRule;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"Alternatives":return{name:"Alternatives",mandatory:[{name:"elements",type:"array"}]};case"AtomType":return{name:"AtomType",mandatory:[{name:"isArray",type:"boolean"},{name:"isRef",type:"boolean"}]};case"CrossReference":return{name:"CrossReference",mandatory:[{name:"deprecatedSyntax",type:"boolean"}]};case"Grammar":return{name:"Grammar",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"imports",type:"array"},{name:"interfaces",type:"array"},{name:"isDeclared",type:"boolean"},{name:"rules",type:"array"},{name:"types",type:"array"},{name:"usedGrammars",type:"array"}]};case"Group":return{name:"Group",mandatory:[{name:"elements",type:"array"}]};case"Interface":return{name:"Interface",mandatory:[{name:"attributes",type:"array"},{name:"superTypes",type:"array"}]};case"LiteralCondition":return{name:"LiteralCondition",mandatory:[{name:"true",type:"boolean"}]};case"NamedArgument":return{name:"NamedArgument",mandatory:[{name:"calledByName",type:"boolean"}]};case"ParserRule":return{name:"ParserRule",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"entry",type:"boolean"},{name:"fragment",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"parameters",type:"array"},{name:"wildcard",type:"boolean"}]};case"RuleCall":return{name:"RuleCall",mandatory:[{name:"arguments",type:"array"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",mandatory:[{name:"elements",type:"array"}]};case"TerminalGroup":return{name:"TerminalGroup",mandatory:[{name:"elements",type:"array"}]};case"TerminalRule":return{name:"TerminalRule",mandatory:[{name:"fragment",type:"boolean"},{name:"hidden",type:"boolean"}]};case"Type":return{name:"Type",mandatory:[{name:"typeAlternatives",type:"array"}]};case"TypeAttribute":return{name:"TypeAttribute",mandatory:[{name:"isOptional",type:"boolean"},{name:"typeAlternatives",type:"array"}]};case"UnorderedGroup":return{name:"UnorderedGroup",mandatory:[{name:"elements",type:"array"}]};default:return{name:e,mandatory:[]}}}};A.LangiumGrammarAstReflection=Cc;A.reflection=new Cc});var Wb=b(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.LangiumGrammarGrammar=void 0;var bL=Wt(),xc,AL=()=>xc??(xc=(0,bL.loadGrammarFromJson)(`{
49
+ `&&m++}R&&P.length>0&&S.push(P.length),this._lineOffsets=S}return this._lineOffsets},y.prototype.positionAt=function(S){S=Math.max(Math.min(S,this._content.length),0);var P=this.getLineOffsets(),R=0,m=P.length;if(m===0)return a.create(0,S);for(;R<m;){var N=Math.floor((R+m)/2);P[N]>S?m=N:R=N+1}var L=R-1;return a.create(L,S-P[L])},y.prototype.offsetAt=function(S){var P=this.getLineOffsets();if(S.line>=P.length)return this._content.length;if(S.line<0)return 0;var R=P[S.line],m=S.line+1<P.length?P[S.line+1]:this._content.length;return Math.max(Math.min(R+S.character,m),R)},Object.defineProperty(y.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),y}(),D;(function(y){var S=Object.prototype.toString;function P(Ce){return typeof Ce<"u"}y.defined=P;function R(Ce){return typeof Ce>"u"}y.undefined=R;function m(Ce){return Ce===!0||Ce===!1}y.boolean=m;function N(Ce){return S.call(Ce)==="[object String]"}y.string=N;function L(Ce){return S.call(Ce)==="[object Number]"}y.number=L;function fe(Ce,da,Tl){return S.call(Ce)==="[object Number]"&&da<=Ce&&Ce<=Tl}y.numberRange=fe;function xt(Ce){return S.call(Ce)==="[object Number]"&&-2147483648<=Ce&&Ce<=2147483647}y.integer=xt;function rt(Ce){return S.call(Ce)==="[object Number]"&&0<=Ce&&Ce<=2147483647}y.uinteger=rt;function Rn(Ce){return S.call(Ce)==="[object Function]"}y.func=Rn;function bn(Ce){return Ce!==null&&typeof Ce=="object"}y.objectLiteral=bn;function xi(Ce,da){return Array.isArray(Ce)&&Ce.every(da)}y.typedArray=xi})(D||(D={}))})});var Rt=b(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ProtocolNotificationType=Er.ProtocolNotificationType0=Er.ProtocolRequestType=Er.ProtocolRequestType0=Er.RegistrationType=Er.MessageDirection=void 0;var Ra=ti(),$O;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})($O=Er.MessageDirection||(Er.MessageDirection={}));var em=class{constructor(e){this.method=e}};Er.RegistrationType=em;var tm=class extends Ra.RequestType0{constructor(e){super(e)}};Er.ProtocolRequestType0=tm;var rm=class extends Ra.RequestType{constructor(e){super(e,Ra.ParameterStructures.byName)}};Er.ProtocolRequestType=rm;var nm=class extends Ra.NotificationType0{constructor(e){super(e)}};Er.ProtocolNotificationType0=nm;var im=class extends Ra.NotificationType{constructor(e){super(e,Ra.ParameterStructures.byName)}};Er.ProtocolNotificationType=im});var Fl=b($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.objectLiteral=$t.typedArray=$t.stringArray=$t.array=$t.func=$t.error=$t.number=$t.string=$t.boolean=void 0;function MO(t){return t===!0||t===!1}$t.boolean=MO;function rR(t){return typeof t=="string"||t instanceof String}$t.string=rR;function LO(t){return typeof t=="number"||t instanceof Number}$t.number=LO;function FO(t){return t instanceof Error}$t.error=FO;function qO(t){return typeof t=="function"}$t.func=qO;function nR(t){return Array.isArray(t)}$t.array=nR;function jO(t){return nR(t)&&t.every(e=>rR(e))}$t.stringArray=jO;function GO(t,e){return Array.isArray(t)&&t.every(e)}$t.typedArray=GO;function UO(t){return t!==null&&typeof t=="object"}$t.objectLiteral=UO});var oR=b(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ImplementationRequest=void 0;var iR=Rt(),HO;(function(t){t.method="textDocument/implementation",t.messageDirection=iR.MessageDirection.clientToServer,t.type=new iR.ProtocolRequestType(t.method)})(HO=Fs.ImplementationRequest||(Fs.ImplementationRequest={}))});var sR=b(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.TypeDefinitionRequest=void 0;var aR=Rt(),BO;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=aR.MessageDirection.clientToServer,t.type=new aR.ProtocolRequestType(t.method)})(BO=qs.TypeDefinitionRequest||(qs.TypeDefinitionRequest={}))});var uR=b(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.DidChangeWorkspaceFoldersNotification=Zi.WorkspaceFoldersRequest=void 0;var ql=Rt(),WO;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ql.MessageDirection.serverToClient,t.type=new ql.ProtocolRequestType0(t.method)})(WO=Zi.WorkspaceFoldersRequest||(Zi.WorkspaceFoldersRequest={}));var KO;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ql.MessageDirection.clientToServer,t.type=new ql.ProtocolNotificationType(t.method)})(KO=Zi.DidChangeWorkspaceFoldersNotification||(Zi.DidChangeWorkspaceFoldersNotification={}))});var cR=b(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.ConfigurationRequest=void 0;var lR=Rt(),zO;(function(t){t.method="workspace/configuration",t.messageDirection=lR.MessageDirection.serverToClient,t.type=new lR.ProtocolRequestType(t.method)})(zO=js.ConfigurationRequest||(js.ConfigurationRequest={}))});var fR=b(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ColorPresentationRequest=Ji.DocumentColorRequest=void 0;var jl=Rt(),VO;(function(t){t.method="textDocument/documentColor",t.messageDirection=jl.MessageDirection.clientToServer,t.type=new jl.ProtocolRequestType(t.method)})(VO=Ji.DocumentColorRequest||(Ji.DocumentColorRequest={}));var YO;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=jl.MessageDirection.clientToServer,t.type=new jl.ProtocolRequestType(t.method)})(YO=Ji.ColorPresentationRequest||(Ji.ColorPresentationRequest={}))});var pR=b(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.FoldingRangeRequest=void 0;var dR=Rt(),XO;(function(t){t.method="textDocument/foldingRange",t.messageDirection=dR.MessageDirection.clientToServer,t.type=new dR.ProtocolRequestType(t.method)})(XO=Gs.FoldingRangeRequest||(Gs.FoldingRangeRequest={}))});var mR=b(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.DeclarationRequest=void 0;var hR=Rt(),ZO;(function(t){t.method="textDocument/declaration",t.messageDirection=hR.MessageDirection.clientToServer,t.type=new hR.ProtocolRequestType(t.method)})(ZO=Us.DeclarationRequest||(Us.DeclarationRequest={}))});var yR=b(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.SelectionRangeRequest=void 0;var gR=Rt(),JO;(function(t){t.method="textDocument/selectionRange",t.messageDirection=gR.MessageDirection.clientToServer,t.type=new gR.ProtocolRequestType(t.method)})(JO=Hs.SelectionRangeRequest||(Hs.SelectionRangeRequest={}))});var vR=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.WorkDoneProgressCancelNotification=wn.WorkDoneProgressCreateRequest=wn.WorkDoneProgress=void 0;var QO=ti(),Gl=Rt(),eI;(function(t){t.type=new QO.ProgressType;function e(r){return r===t.type}t.is=e})(eI=wn.WorkDoneProgress||(wn.WorkDoneProgress={}));var tI;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Gl.MessageDirection.serverToClient,t.type=new Gl.ProtocolRequestType(t.method)})(tI=wn.WorkDoneProgressCreateRequest||(wn.WorkDoneProgressCreateRequest={}));var rI;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Gl.MessageDirection.clientToServer,t.type=new Gl.ProtocolNotificationType(t.method)})(rI=wn.WorkDoneProgressCancelNotification||(wn.WorkDoneProgressCancelNotification={}))});var _R=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.CallHierarchyOutgoingCallsRequest=Sn.CallHierarchyIncomingCallsRequest=Sn.CallHierarchyPrepareRequest=void 0;var ba=Rt(),nI;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(nI=Sn.CallHierarchyPrepareRequest||(Sn.CallHierarchyPrepareRequest={}));var iI;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(iI=Sn.CallHierarchyIncomingCallsRequest||(Sn.CallHierarchyIncomingCallsRequest={}));var oI;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(oI=Sn.CallHierarchyOutgoingCallsRequest||(Sn.CallHierarchyOutgoingCallsRequest={}))});var TR=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.SemanticTokensRefreshRequest=Mt.SemanticTokensRangeRequest=Mt.SemanticTokensDeltaRequest=Mt.SemanticTokensRequest=Mt.SemanticTokensRegistrationType=Mt.TokenFormat=void 0;var Di=Rt(),aI;(function(t){t.Relative="relative"})(aI=Mt.TokenFormat||(Mt.TokenFormat={}));var Ul;(function(t){t.method="textDocument/semanticTokens",t.type=new Di.RegistrationType(t.method)})(Ul=Mt.SemanticTokensRegistrationType||(Mt.SemanticTokensRegistrationType={}));var sI;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(sI=Mt.SemanticTokensRequest||(Mt.SemanticTokensRequest={}));var uI;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(uI=Mt.SemanticTokensDeltaRequest||(Mt.SemanticTokensDeltaRequest={}));var lI;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType(t.method),t.registrationMethod=Ul.method})(lI=Mt.SemanticTokensRangeRequest||(Mt.SemanticTokensRangeRequest={}));var cI;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Di.MessageDirection.clientToServer,t.type=new Di.ProtocolRequestType0(t.method)})(cI=Mt.SemanticTokensRefreshRequest||(Mt.SemanticTokensRefreshRequest={}))});var bR=b(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.ShowDocumentRequest=void 0;var RR=Rt(),fI;(function(t){t.method="window/showDocument",t.messageDirection=RR.MessageDirection.serverToClient,t.type=new RR.ProtocolRequestType(t.method)})(fI=Bs.ShowDocumentRequest||(Bs.ShowDocumentRequest={}))});var ER=b(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.LinkedEditingRangeRequest=void 0;var AR=Rt(),dI;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=AR.MessageDirection.clientToServer,t.type=new AR.ProtocolRequestType(t.method)})(dI=Ws.LinkedEditingRangeRequest||(Ws.LinkedEditingRangeRequest={}))});var CR=b(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.WillDeleteFilesRequest=bt.DidDeleteFilesNotification=bt.DidRenameFilesNotification=bt.WillRenameFilesRequest=bt.DidCreateFilesNotification=bt.WillCreateFilesRequest=bt.FileOperationPatternKind=void 0;var Zr=Rt(),pI;(function(t){t.file="file",t.folder="folder"})(pI=bt.FileOperationPatternKind||(bt.FileOperationPatternKind={}));var hI;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(hI=bt.WillCreateFilesRequest||(bt.WillCreateFilesRequest={}));var mI;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(mI=bt.DidCreateFilesNotification||(bt.DidCreateFilesNotification={}));var gI;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(gI=bt.WillRenameFilesRequest||(bt.WillRenameFilesRequest={}));var yI;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(yI=bt.DidRenameFilesNotification||(bt.DidRenameFilesNotification={}));var vI;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method)})(vI=bt.DidDeleteFilesNotification||(bt.DidDeleteFilesNotification={}));var _I;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolRequestType(t.method)})(_I=bt.WillDeleteFilesRequest||(bt.WillDeleteFilesRequest={}))});var wR=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.MonikerRequest=kn.MonikerKind=kn.UniquenessLevel=void 0;var xR=Rt(),TI;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(TI=kn.UniquenessLevel||(kn.UniquenessLevel={}));var RI;(function(t){t.$import="import",t.$export="export",t.local="local"})(RI=kn.MonikerKind||(kn.MonikerKind={}));var bI;(function(t){t.method="textDocument/moniker",t.messageDirection=xR.MessageDirection.clientToServer,t.type=new xR.ProtocolRequestType(t.method)})(bI=kn.MonikerRequest||(kn.MonikerRequest={}))});var SR=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.TypeHierarchySubtypesRequest=Pn.TypeHierarchySupertypesRequest=Pn.TypeHierarchyPrepareRequest=void 0;var Aa=Rt(),AI;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(AI=Pn.TypeHierarchyPrepareRequest||(Pn.TypeHierarchyPrepareRequest={}));var EI;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(EI=Pn.TypeHierarchySupertypesRequest||(Pn.TypeHierarchySupertypesRequest={}));var CI;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(CI=Pn.TypeHierarchySubtypesRequest||(Pn.TypeHierarchySubtypesRequest={}))});var kR=b(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.InlineValueRefreshRequest=Qi.InlineValueRequest=void 0;var Hl=Rt(),xI;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType(t.method)})(xI=Qi.InlineValueRequest||(Qi.InlineValueRequest={}));var wI;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType0(t.method)})(wI=Qi.InlineValueRefreshRequest||(Qi.InlineValueRefreshRequest={}))});var PR=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.InlayHintRefreshRequest=Dn.InlayHintResolveRequest=Dn.InlayHintRequest=void 0;var Ea=Rt(),SI;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(SI=Dn.InlayHintRequest||(Dn.InlayHintRequest={}));var kI;(function(t){t.method="inlayHint/resolve",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(kI=Dn.InlayHintResolveRequest||(Dn.InlayHintResolveRequest={}));var PI;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType0(t.method)})(PI=Dn.InlayHintRefreshRequest||(Dn.InlayHintRefreshRequest={}))});var NR=b(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.DiagnosticRefreshRequest=er.WorkspaceDiagnosticRequest=er.DocumentDiagnosticRequest=er.DocumentDiagnosticReportKind=er.DiagnosticServerCancellationData=void 0;var DR=ti(),DI=Fl(),Ca=Rt(),NI;(function(t){function e(r){let n=r;return n&&DI.boolean(n.retriggerRequest)}t.is=e})(NI=er.DiagnosticServerCancellationData||(er.DiagnosticServerCancellationData={}));var OI;(function(t){t.Full="full",t.Unchanged="unchanged"})(OI=er.DocumentDiagnosticReportKind||(er.DocumentDiagnosticReportKind={}));var II;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType(t.method),t.partialResult=new DR.ProgressType})(II=er.DocumentDiagnosticRequest||(er.DocumentDiagnosticRequest={}));var $I;(function(t){t.method="workspace/diagnostic",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType(t.method),t.partialResult=new DR.ProgressType})($I=er.WorkspaceDiagnosticRequest||(er.WorkspaceDiagnosticRequest={}));var MI;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Ca.MessageDirection.clientToServer,t.type=new Ca.ProtocolRequestType0(t.method)})(MI=er.DiagnosticRefreshRequest||(er.DiagnosticRefreshRequest={}))});var $R=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.DidCloseNotebookDocumentNotification=Oe.DidSaveNotebookDocumentNotification=Oe.DidChangeNotebookDocumentNotification=Oe.NotebookCellArrayChange=Oe.DidOpenNotebookDocumentNotification=Oe.NotebookDocumentSyncRegistrationType=Oe.NotebookDocument=Oe.NotebookCell=Oe.ExecutionSummary=Oe.NotebookCellKind=void 0;var Ks=Ta(),Nn=Fl(),ri=Rt(),OR;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(OR=Oe.NotebookCellKind||(Oe.NotebookCellKind={}));var IR;(function(t){function e(i,o){let a={executionOrder:i};return(o===!0||o===!1)&&(a.success=o),a}t.create=e;function r(i){let o=i;return Nn.objectLiteral(o)&&Ks.uinteger.is(o.executionOrder)&&(o.success===void 0||Nn.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(IR=Oe.ExecutionSummary||(Oe.ExecutionSummary={}));var om;(function(t){function e(o,a){return{kind:o,document:a}}t.create=e;function r(o){let a=o;return Nn.objectLiteral(a)&&OR.is(a.kind)&&Ks.DocumentUri.is(a.document)&&(a.metadata===void 0||Nn.objectLiteral(a.metadata))}t.is=r;function n(o,a){let s=new Set;return o.document!==a.document&&s.add("document"),o.kind!==a.kind&&s.add("kind"),o.executionSummary!==a.executionSummary&&s.add("executionSummary"),(o.metadata!==void 0||a.metadata!==void 0)&&!i(o.metadata,a.metadata)&&s.add("metadata"),(o.executionSummary!==void 0||a.executionSummary!==void 0)&&!IR.equals(o.executionSummary,a.executionSummary)&&s.add("executionSummary"),s}t.diff=n;function i(o,a){if(o===a)return!0;if(o==null||a===null||a===void 0||typeof o!=typeof a||typeof o!="object")return!1;let s=Array.isArray(o),u=Array.isArray(a);if(s!==u)return!1;if(s&&u){if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(!i(o[l],a[l]))return!1}if(Nn.objectLiteral(o)&&Nn.objectLiteral(a)){let l=Object.keys(o),c=Object.keys(a);if(l.length!==c.length||(l.sort(),c.sort(),!i(l,c)))return!1;for(let f=0;f<l.length;f++){let p=l[f];if(!i(o[p],a[p]))return!1}}return!0}})(om=Oe.NotebookCell||(Oe.NotebookCell={}));var LI;(function(t){function e(n,i,o,a){return{uri:n,notebookType:i,version:o,cells:a}}t.create=e;function r(n){let i=n;return Nn.objectLiteral(i)&&Nn.string(i.uri)&&Ks.integer.is(i.version)&&Nn.typedArray(i.cells,om.is)}t.is=r})(LI=Oe.NotebookDocument||(Oe.NotebookDocument={}));var zs;(function(t){t.method="notebookDocument/sync",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.RegistrationType(t.method)})(zs=Oe.NotebookDocumentSyncRegistrationType||(Oe.NotebookDocumentSyncRegistrationType={}));var FI;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(FI=Oe.DidOpenNotebookDocumentNotification||(Oe.DidOpenNotebookDocumentNotification={}));var qI;(function(t){function e(n){let i=n;return Nn.objectLiteral(i)&&Ks.uinteger.is(i.start)&&Ks.uinteger.is(i.deleteCount)&&(i.cells===void 0||Nn.typedArray(i.cells,om.is))}t.is=e;function r(n,i,o){let a={start:n,deleteCount:i};return o!==void 0&&(a.cells=o),a}t.create=r})(qI=Oe.NotebookCellArrayChange||(Oe.NotebookCellArrayChange={}));var jI;(function(t){t.method="notebookDocument/didChange",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(jI=Oe.DidChangeNotebookDocumentNotification||(Oe.DidChangeNotebookDocumentNotification={}));var GI;(function(t){t.method="notebookDocument/didSave",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(GI=Oe.DidSaveNotebookDocumentNotification||(Oe.DidSaveNotebookDocumentNotification={}));var UI;(function(t){t.method="notebookDocument/didClose",t.messageDirection=ri.MessageDirection.clientToServer,t.type=new ri.ProtocolNotificationType(t.method),t.registrationMethod=zs.method})(UI=Oe.DidCloseNotebookDocumentNotification||(Oe.DidCloseNotebookDocumentNotification={}))});var BR=b(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=void 0;var B=Rt(),MR=Ta(),tr=Fl(),HI=oR();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return HI.ImplementationRequest}});var BI=sR();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return BI.TypeDefinitionRequest}});var LR=uR();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return LR.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return LR.DidChangeWorkspaceFoldersNotification}});var WI=cR();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return WI.ConfigurationRequest}});var FR=fR();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return FR.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return FR.ColorPresentationRequest}});var KI=pR();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return KI.FoldingRangeRequest}});var zI=mR();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return zI.DeclarationRequest}});var VI=yR();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return VI.SelectionRangeRequest}});var am=vR();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return am.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return am.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return am.WorkDoneProgressCancelNotification}});var sm=_R();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return sm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return sm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return sm.CallHierarchyPrepareRequest}});var xa=TR();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return xa.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return xa.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return xa.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return xa.SemanticTokensRegistrationType}});var YI=bR();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return YI.ShowDocumentRequest}});var XI=ER();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return XI.LinkedEditingRangeRequest}});var $o=CR();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return $o.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return $o.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return $o.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return $o.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return $o.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return $o.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return $o.WillDeleteFilesRequest}});var um=wR();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return um.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return um.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return um.MonikerRequest}});var lm=SR();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return lm.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return lm.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return lm.TypeHierarchySupertypesRequest}});var qR=kR();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return qR.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return qR.InlineValueRefreshRequest}});var cm=PR();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return cm.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return cm.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return cm.InlayHintRefreshRequest}});var Vs=NR();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Vs.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Vs.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Vs.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Vs.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Vs.DiagnosticRefreshRequest}});var ni=$R();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return ni.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return ni.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return ni.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return ni.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ni.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ni.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ni.DidCloseNotebookDocumentNotification}});var jR;(function(t){function e(r){let n=r;return tr.string(n.language)||tr.string(n.scheme)||tr.string(n.pattern)}t.is=e})(jR=_.TextDocumentFilter||(_.TextDocumentFilter={}));var GR;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(tr.string(n.notebookType)||tr.string(n.scheme)||tr.string(n.pattern))}t.is=e})(GR=_.NotebookDocumentFilter||(_.NotebookDocumentFilter={}));var UR;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(tr.string(n.notebook)||GR.is(n.notebook))&&(n.language===void 0||tr.string(n.language))}t.is=e})(UR=_.NotebookCellTextDocumentFilter||(_.NotebookCellTextDocumentFilter={}));var HR;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!tr.string(n)&&!jR.is(n)&&!UR.is(n))return!1;return!0}t.is=e})(HR=_.DocumentSelector||(_.DocumentSelector={}));var ZI;(function(t){t.method="client/registerCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(ZI=_.RegistrationRequest||(_.RegistrationRequest={}));var JI;(function(t){t.method="client/unregisterCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(JI=_.UnregistrationRequest||(_.UnregistrationRequest={}));var QI;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(QI=_.ResourceOperationKind||(_.ResourceOperationKind={}));var e$;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(e$=_.FailureHandlingKind||(_.FailureHandlingKind={}));var t$;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(t$=_.PositionEncodingKind||(_.PositionEncodingKind={}));var r$;(function(t){function e(r){let n=r;return n&&tr.string(n.id)&&n.id.length>0}t.hasId=e})(r$=_.StaticRegistrationOptions||(_.StaticRegistrationOptions={}));var n$;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||HR.is(n.documentSelector))}t.is=e})(n$=_.TextDocumentRegistrationOptions||(_.TextDocumentRegistrationOptions={}));var i$;(function(t){function e(n){let i=n;return tr.objectLiteral(i)&&(i.workDoneProgress===void 0||tr.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&tr.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(i$=_.WorkDoneProgressOptions||(_.WorkDoneProgressOptions={}));var o$;(function(t){t.method="initialize",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(o$=_.InitializeRequest||(_.InitializeRequest={}));var a$;(function(t){t.unknownProtocolVersion=1})(a$=_.InitializeErrorCodes||(_.InitializeErrorCodes={}));var s$;(function(t){t.method="initialized",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(s$=_.InitializedNotification||(_.InitializedNotification={}));var u$;(function(t){t.method="shutdown",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType0(t.method)})(u$=_.ShutdownRequest||(_.ShutdownRequest={}));var l$;(function(t){t.method="exit",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType0(t.method)})(l$=_.ExitNotification||(_.ExitNotification={}));var c$;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(c$=_.DidChangeConfigurationNotification||(_.DidChangeConfigurationNotification={}));var f$;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(f$=_.MessageType||(_.MessageType={}));var d$;(function(t){t.method="window/showMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(d$=_.ShowMessageNotification||(_.ShowMessageNotification={}));var p$;(function(t){t.method="window/showMessageRequest",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(p$=_.ShowMessageRequest||(_.ShowMessageRequest={}));var h$;(function(t){t.method="window/logMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(h$=_.LogMessageNotification||(_.LogMessageNotification={}));var m$;(function(t){t.method="telemetry/event",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(m$=_.TelemetryEventNotification||(_.TelemetryEventNotification={}));var g$;(function(t){t.None=0,t.Full=1,t.Incremental=2})(g$=_.TextDocumentSyncKind||(_.TextDocumentSyncKind={}));var y$;(function(t){t.method="textDocument/didOpen",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(y$=_.DidOpenTextDocumentNotification||(_.DidOpenTextDocumentNotification={}));var v$;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(v$=_.TextDocumentContentChangeEvent||(_.TextDocumentContentChangeEvent={}));var _$;(function(t){t.method="textDocument/didChange",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(_$=_.DidChangeTextDocumentNotification||(_.DidChangeTextDocumentNotification={}));var T$;(function(t){t.method="textDocument/didClose",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(T$=_.DidCloseTextDocumentNotification||(_.DidCloseTextDocumentNotification={}));var R$;(function(t){t.method="textDocument/didSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(R$=_.DidSaveTextDocumentNotification||(_.DidSaveTextDocumentNotification={}));var b$;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(b$=_.TextDocumentSaveReason||(_.TextDocumentSaveReason={}));var A$;(function(t){t.method="textDocument/willSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(A$=_.WillSaveTextDocumentNotification||(_.WillSaveTextDocumentNotification={}));var E$;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(E$=_.WillSaveTextDocumentWaitUntilRequest||(_.WillSaveTextDocumentWaitUntilRequest={}));var C$;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(C$=_.DidChangeWatchedFilesNotification||(_.DidChangeWatchedFilesNotification={}));var x$;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(x$=_.FileChangeType||(_.FileChangeType={}));var w$;(function(t){function e(r){let n=r;return tr.objectLiteral(n)&&(MR.URI.is(n.baseUri)||MR.WorkspaceFolder.is(n.baseUri))&&tr.string(n.pattern)}t.is=e})(w$=_.RelativePattern||(_.RelativePattern={}));var S$;(function(t){t.Create=1,t.Change=2,t.Delete=4})(S$=_.WatchKind||(_.WatchKind={}));var k$;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(k$=_.PublishDiagnosticsNotification||(_.PublishDiagnosticsNotification={}));var P$;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(P$=_.CompletionTriggerKind||(_.CompletionTriggerKind={}));var D$;(function(t){t.method="textDocument/completion",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(D$=_.CompletionRequest||(_.CompletionRequest={}));var N$;(function(t){t.method="completionItem/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(N$=_.CompletionResolveRequest||(_.CompletionResolveRequest={}));var O$;(function(t){t.method="textDocument/hover",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(O$=_.HoverRequest||(_.HoverRequest={}));var I$;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(I$=_.SignatureHelpTriggerKind||(_.SignatureHelpTriggerKind={}));var $$;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})($$=_.SignatureHelpRequest||(_.SignatureHelpRequest={}));var M$;(function(t){t.method="textDocument/definition",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(M$=_.DefinitionRequest||(_.DefinitionRequest={}));var L$;(function(t){t.method="textDocument/references",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(L$=_.ReferencesRequest||(_.ReferencesRequest={}));var F$;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(F$=_.DocumentHighlightRequest||(_.DocumentHighlightRequest={}));var q$;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(q$=_.DocumentSymbolRequest||(_.DocumentSymbolRequest={}));var j$;(function(t){t.method="textDocument/codeAction",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(j$=_.CodeActionRequest||(_.CodeActionRequest={}));var G$;(function(t){t.method="codeAction/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(G$=_.CodeActionResolveRequest||(_.CodeActionResolveRequest={}));var U$;(function(t){t.method="workspace/symbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(U$=_.WorkspaceSymbolRequest||(_.WorkspaceSymbolRequest={}));var H$;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(H$=_.WorkspaceSymbolResolveRequest||(_.WorkspaceSymbolResolveRequest={}));var B$;(function(t){t.method="textDocument/codeLens",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(B$=_.CodeLensRequest||(_.CodeLensRequest={}));var W$;(function(t){t.method="codeLens/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(W$=_.CodeLensResolveRequest||(_.CodeLensResolveRequest={}));var K$;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType0(t.method)})(K$=_.CodeLensRefreshRequest||(_.CodeLensRefreshRequest={}));var z$;(function(t){t.method="textDocument/documentLink",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(z$=_.DocumentLinkRequest||(_.DocumentLinkRequest={}));var V$;(function(t){t.method="documentLink/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(V$=_.DocumentLinkResolveRequest||(_.DocumentLinkResolveRequest={}));var Y$;(function(t){t.method="textDocument/formatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(Y$=_.DocumentFormattingRequest||(_.DocumentFormattingRequest={}));var X$;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(X$=_.DocumentRangeFormattingRequest||(_.DocumentRangeFormattingRequest={}));var Z$;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(Z$=_.DocumentOnTypeFormattingRequest||(_.DocumentOnTypeFormattingRequest={}));var J$;(function(t){t.Identifier=1})(J$=_.PrepareSupportDefaultBehavior||(_.PrepareSupportDefaultBehavior={}));var Q$;(function(t){t.method="textDocument/rename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(Q$=_.RenameRequest||(_.RenameRequest={}));var e1;(function(t){t.method="textDocument/prepareRename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(e1=_.PrepareRenameRequest||(_.PrepareRenameRequest={}));var t1;(function(t){t.method="workspace/executeCommand",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(t1=_.ExecuteCommandRequest||(_.ExecuteCommandRequest={}));var r1;(function(t){t.method="workspace/applyEdit",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType("workspace/applyEdit")})(r1=_.ApplyWorkspaceEditRequest||(_.ApplyWorkspaceEditRequest={}))});var KR=b(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.createProtocolConnection=void 0;var WR=ti();function n1(t,e,r,n){return WR.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,WR.createMessageConnection)(t,e,r,n)}Bl.createProtocolConnection=n1});var zR=b(Cr=>{"use strict";var i1=Cr&&Cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wl=Cr&&Cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i1(e,t,r)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.LSPErrorCodes=Cr.createProtocolConnection=void 0;Wl(ti(),Cr);Wl(Ta(),Cr);Wl(Rt(),Cr);Wl(BR(),Cr);var o1=KR();Object.defineProperty(Cr,"createProtocolConnection",{enumerable:!0,get:function(){return o1.createProtocolConnection}});var a1;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(a1=Cr.LSPErrorCodes||(Cr.LSPErrorCodes={}))});var Lt=b(ii=>{"use strict";var s1=ii&&ii.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VR=ii&&ii.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s1(e,t,r)};Object.defineProperty(ii,"__esModule",{value:!0});ii.createProtocolConnection=void 0;var u1=Qh();VR(Qh(),ii);VR(zR(),ii);function l1(t,e,r,n){return(0,u1.createMessageConnection)(t,e,r,n)}ii.createProtocolConnection=l1});var fm=b(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.generateUuid=Jr.parse=Jr.isUUID=Jr.v4=Jr.empty=void 0;var Ys=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ge=class extends Ys{constructor(){super([ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-","4",ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._oneOf(ge._timeHighBits),ge._randomHex(),ge._randomHex(),ge._randomHex(),"-",ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex(),ge._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return ge._oneOf(ge._chars)}};ge._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ge._timeHighBits=["8","9","a","b"];Jr.empty=new Ys("00000000-0000-0000-0000-000000000000");function YR(){return new ge}Jr.v4=YR;var c1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function XR(t){return c1.test(t)}Jr.isUUID=XR;function f1(t){if(!XR(t))throw new Error("invalid uuid");return new Ys(t)}Jr.parse=f1;function d1(){return YR().asHex()}Jr.generateUuid=d1});var ZR=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.attachPartialResult=to.ProgressFeature=to.attachWorkDone=void 0;var eo=Lt(),p1=fm(),oi=class{constructor(e,r){this._connection=e,this._token=r,oi.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,n)}done(){oi.Instances.delete(this._token),this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,{kind:"end"})}};oi.Instances=new Map;var Kl=class extends oi{constructor(e,r){super(e,r),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Xs=class{constructor(){}begin(){}report(){}done(){}},zl=class extends Xs{constructor(){super(),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function h1(t,e){if(e===void 0||e.workDoneToken===void 0)return new Xs;let r=e.workDoneToken;return delete e.workDoneToken,new oi(t,r)}to.attachWorkDone=h1;var m1=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(eo.WorkDoneProgressCancelNotification.type,r=>{let n=oi.Instances.get(r.token);(n instanceof Kl||n instanceof zl)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Xs:new oi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,p1.generateUuid)();return this.connection.sendRequest(eo.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Kl(this.connection,e))}else return Promise.resolve(new zl)}};to.ProgressFeature=m1;var dm;(function(t){t.type=new eo.ProgressType})(dm||(dm={}));var pm=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(dm.type,this._token,e)}};function g1(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new pm(t,r)}to.attachPartialResult=g1});var JR=b(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.ConfigurationFeature=void 0;var y1=Lt(),v1=xl(),_1=t=>class extends t{getConfiguration(e){return e?v1.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(y1.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Vl.ConfigurationFeature=_1});var QR=b(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.WorkspaceFoldersFeature=void 0;var Yl=Lt(),T1=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Yl.Emitter,this.connection.onNotification(Yl.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Yl.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Yl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Xl.WorkspaceFoldersFeature=T1});var eb=b(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.CallHierarchyFeature=void 0;var hm=Lt(),R1=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(hm.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=hm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=hm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Zl.CallHierarchyFeature=R1});var gm=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.SemanticTokensBuilder=ro.SemanticTokensDiff=ro.SemanticTokensFeature=void 0;var Jl=Lt(),b1=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Jl.SemanticTokensRefreshRequest.type),on:e=>{let r=Jl.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Jl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Jl.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ro.SemanticTokensFeature=b1;var Ql=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let a=i-n+1,s=this.modifiedSequence.slice(n,o+1);return s.length===1&&s[0]===this.originalSequence[i]?[{start:n,deleteCount:a-1}]:[{start:n,deleteCount:a,data:s}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};ro.SemanticTokensDiff=Ql;var mm=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,r,n,i,o){let a=e,s=r;this._dataLen>0&&(a-=this._prevLine,a===0&&(s-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Ql(this._prevData,this._data).computeDiff()}:this.build()}};ro.SemanticTokensBuilder=mm});var tb=b(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.ShowDocumentFeature=void 0;var A1=Lt(),E1=t=>class extends t{showDocument(e){return this.connection.sendRequest(A1.ShowDocumentRequest.type,e)}};ec.ShowDocumentFeature=E1});var rb=b(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.FileOperationsFeature=void 0;var wa=Lt(),C1=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(wa.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(wa.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(wa.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(wa.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(wa.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(wa.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};tc.FileOperationsFeature=C1});var nb=b(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.LinkedEditingRangeFeature=void 0;var x1=Lt(),w1=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(x1.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};rc.LinkedEditingRangeFeature=w1});var ib=b(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.TypeHierarchyFeature=void 0;var ym=Lt(),S1=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(ym.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=ym.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=ym.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};nc.TypeHierarchyFeature=S1});var ab=b(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.InlineValueFeature=void 0;var ob=Lt(),k1=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ob.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(ob.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};ic.InlineValueFeature=k1});var sb=b(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.InlayHintFeature=void 0;var vm=Lt(),P1=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(vm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(vm.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(vm.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};oc.InlayHintFeature=P1});var ub=b(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.DiagnosticFeature=void 0;var Zs=Lt(),D1=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Zs.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Zs.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Zs.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(Zs.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(Zs.WorkspaceDiagnosticRequest.partialResult,r)))}}};ac.DiagnosticFeature=D1});var Tm=b(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.TextDocuments=void 0;var Mo=Lt(),_m=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Mo.Emitter,this._onDidOpen=new Mo.Emitter,this._onDidClose=new Mo.Emitter,this._onDidSave=new Mo.Emitter,this._onWillSave=new Mo.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Mo.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:a}=i;if(a==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let s=this._syncedDocuments.get(i.uri);s!==void 0&&(s=this._configuration.update(s,o,a),this._syncedDocuments.set(i.uri,s),this._onDidChangeContent.fire(Object.freeze({document:s})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Mo.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};sc.TextDocuments=_m});var bm=b(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.NotebookDocuments=Sa.NotebookSyncFeature=void 0;var Qr=Lt(),lb=Tm(),N1=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Qr.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Qr.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Qr.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Qr.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};Sa.NotebookSyncFeature=N1;var no=class{onDidOpenTextDocument(e){return this.openHandler=e,Qr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Qr.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Qr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return no.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return no.NULL_DISPOSE}onDidSaveTextDocument(){return no.NULL_DISPOSE}};no.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Rm=class{constructor(e){e instanceof lb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new lb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Qr.Emitter,this._onDidChange=new Qr.Emitter,this._onDidSave=new Qr.Emitter,this._onDidClose=new Qr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new no,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let a=o.metadata,s=!1,u=i.change;u.metadata!==void 0&&(s=!0,o.metadata=u.metadata);let l=[],c=[],f=[],p=[];if(u.cells!==void 0){let x=u.cells;if(x.structure!==void 0){let T=x.structure.array;if(o.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),x.structure.didOpen!==void 0)for(let v of x.structure.didOpen)r.openTextDocument({textDocument:v}),l.push(v.uri);if(x.structure.didClose)for(let v of x.structure.didClose)r.closeTextDocument({textDocument:v}),c.push(v.uri)}if(x.data!==void 0){let T=new Map(x.data.map(v=>[v.document,v]));for(let v=0;v<=o.cells.length;v++){let k=T.get(o.cells[v].document);if(k!==void 0){let j=o.cells.splice(v,1,k);if(f.push({old:j[0],new:k}),T.delete(k.document),T.size===0)break}}}if(x.textContent!==void 0)for(let T of x.textContent)r.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),p.push(T.document.uri)}this.updateCellMap(o);let h={notebookDocument:o};s&&(h.metadata={old:a,new:o.metadata});let d=[];for(let x of l)d.push(this.getNotebookCell(x));let g=[];for(let x of c)g.push(this.getNotebookCell(x));let C=[];for(let x of p)C.push(this.getNotebookCell(x));(d.length>0||g.length>0||f.length>0||C.length>0)&&(h.cells={added:d,removed:g,changed:{data:f,textContent:C}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let a of i.cellTextDocuments)r.closeTextDocument({textDocument:a});this.notebookDocuments.delete(i.notebookDocument.uri);for(let a of o.cells)this.notebookCellMap.delete(a.document)}})),Qr.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Sa.NotebookDocuments=Rm});var cb=b(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.MonikerFeature=void 0;var O1=Lt(),I1=t=>class extends t{get moniker(){return{on:e=>{let r=O1.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};uc.MonikerFeature=I1});var Sm=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.createConnection=we.combineFeatures=we.combineNotebooksFeatures=we.combineLanguagesFeatures=we.combineWorkspaceFeatures=we.combineWindowFeatures=we.combineClientFeatures=we.combineTracerFeatures=we.combineTelemetryFeatures=we.combineConsoleFeatures=we._NotebooksImpl=we._LanguagesImpl=we.BulkUnregistration=we.BulkRegistration=we.ErrorMessageTracker=void 0;var V=Lt(),en=xl(),Em=fm(),ce=ZR(),$1=JR(),M1=QR(),L1=eb(),F1=gm(),q1=tb(),j1=rb(),G1=nb(),U1=ib(),H1=ab(),B1=sb(),W1=ub(),K1=bm(),z1=cb();function Am(t){if(t!==null)return t}var Cm=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};we.ErrorMessageTracker=Cm;var lc=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},xm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:V.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}showWarningMessage(e,...r){let n={type:V.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}showInformationMessage(e,...r){let n={type:V.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(V.ShowMessageRequest.type,n).then(Am)}},fb=(0,q1.ShowDocumentFeature)((0,ce.ProgressFeature)(xm)),V1;(function(t){function e(){return new cc}t.create=e})(V1=we.BulkRegistration||(we.BulkRegistration={}));var cc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=en.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=Em.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Y1;(function(t){function e(){return new Js(void 0,[])}t.create=e})(Y1=we.BulkUnregistration||(we.BulkUnregistration={}));var Js=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(V.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=en.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},fc=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof cc?this.registerMany(e):e instanceof Js?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=en.string(r)?r:r.method,o=Em.generateUuid(),a={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,a).then(s=>(e.add({id:o,method:i}),e),s=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(s)))}registerSingle2(e,r){let n=en.string(e)?e:e.method,i=Em.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,o).then(a=>V.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),a=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(a)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(V.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(V.RegistrationRequest.type,r).then(()=>new Js(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},wm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,n)}},db=(0,j1.FileOperationsFeature)((0,M1.WorkspaceFoldersFeature)((0,$1.ConfigurationFeature)(wm))),dc=class{constructor(){this._trace=V.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?r:void 0}).catch(()=>{})}},pc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},hc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ce.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,ce.attachPartialResult)(this.connection,r)}};we._LanguagesImpl=hc;var pb=(0,z1.MonikerFeature)((0,W1.DiagnosticFeature)((0,B1.InlayHintFeature)((0,H1.InlineValueFeature)((0,U1.TypeHierarchyFeature)((0,G1.LinkedEditingRangeFeature)((0,F1.SemanticTokensFeature)((0,L1.CallHierarchyFeature)(hc)))))))),mc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ce.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,ce.attachPartialResult)(this.connection,r)}};we._NotebooksImpl=mc;var hb=(0,K1.NotebookSyncFeature)(mc);function mb(t,e){return function(r){return e(t(r))}}we.combineConsoleFeatures=mb;function gb(t,e){return function(r){return e(t(r))}}we.combineTelemetryFeatures=gb;function yb(t,e){return function(r){return e(t(r))}}we.combineTracerFeatures=yb;function vb(t,e){return function(r){return e(t(r))}}we.combineClientFeatures=vb;function _b(t,e){return function(r){return e(t(r))}}we.combineWindowFeatures=_b;function Tb(t,e){return function(r){return e(t(r))}}we.combineWorkspaceFeatures=Tb;function Rb(t,e){return function(r){return e(t(r))}}we.combineLanguagesFeatures=Rb;function bb(t,e){return function(r){return e(t(r))}}we.combineNotebooksFeatures=bb;function X1(t,e){function r(i,o,a){return i&&o?a(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,mb),tracer:r(t.tracer,e.tracer,yb),telemetry:r(t.telemetry,e.telemetry,gb),client:r(t.client,e.client,vb),window:r(t.window,e.window,_b),workspace:r(t.workspace,e.workspace,Tb),languages:r(t.languages,e.languages,Rb),notebooks:r(t.notebooks,e.notebooks,bb)}}we.combineFeatures=X1;function Z1(t,e,r){let n=r&&r.console?new(r.console(lc)):new lc,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(dc)):new dc,a=r&&r.telemetry?new(r.telemetry(pc)):new pc,s=r&&r.client?new(r.client(fc)):new fc,u=r&&r.window?new(r.window(fb)):new fb,l=r&&r.workspace?new(r.workspace(db)):new db,c=r&&r.languages?new(r.languages(pb)):new pb,f=r&&r.notebooks?new(r.notebooks(hb)):new hb,p=[n,o,a,s,u,l,c,f];function h(T){return T instanceof Promise?T:en.thenable(T)?new Promise((v,k)=>{T.then(j=>v(j),j=>k(j))}):Promise.resolve(T)}let d,g,C,x={listen:()=>i.listen(),sendRequest:(T,...v)=>i.sendRequest(en.string(T)?T:T.method,...v),onRequest:(T,v)=>i.onRequest(T,v),sendNotification:(T,v)=>{let k=en.string(T)?T:T.method;return arguments.length===1?i.sendNotification(k):i.sendNotification(k,v)},onNotification:(T,v)=>i.onNotification(T,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(g=T,{dispose:()=>{g=void 0}}),onInitialized:T=>i.onNotification(V.InitializedNotification.type,T),onShutdown:T=>(d=T,{dispose:()=>{d=void 0}}),onExit:T=>(C=T,{dispose:()=>{C=void 0}}),get console(){return n},get telemetry(){return a},get tracer(){return o},get client(){return s},get window(){return u},get workspace(){return l},get languages(){return c},get notebooks(){return f},onDidChangeConfiguration:T=>i.onNotification(V.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(V.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(V.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(V.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(V.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(V.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(V.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(V.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(V.HoverRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onCompletion:T=>i.onRequest(V.CompletionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCompletionResolve:T=>i.onRequest(V.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(V.SignatureHelpRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDeclaration:T=>i.onRequest(V.DeclarationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDefinition:T=>i.onRequest(V.DefinitionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onTypeDefinition:T=>i.onRequest(V.TypeDefinitionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onImplementation:T=>i.onRequest(V.ImplementationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onReferences:T=>i.onRequest(V.ReferencesRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentHighlight:T=>i.onRequest(V.DocumentHighlightRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentSymbol:T=>i.onRequest(V.DocumentSymbolRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onWorkspaceSymbol:T=>i.onRequest(V.WorkspaceSymbolRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:T=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(V.CodeActionRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCodeActionResolve:T=>i.onRequest(V.CodeActionResolveRequest.type,(v,k)=>T(v,k)),onCodeLens:T=>i.onRequest(V.CodeLensRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onCodeLensResolve:T=>i.onRequest(V.CodeLensResolveRequest.type,(v,k)=>T(v,k)),onDocumentFormatting:T=>i.onRequest(V.DocumentFormattingRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:T=>i.onRequest(V.DocumentRangeFormattingRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(v,k)=>T(v,k)),onRenameRequest:T=>i.onRequest(V.RenameRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),onPrepareRename:T=>i.onRequest(V.PrepareRenameRequest.type,(v,k)=>T(v,k)),onDocumentLinks:T=>i.onRequest(V.DocumentLinkRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onDocumentLinkResolve:T=>i.onRequest(V.DocumentLinkResolveRequest.type,(v,k)=>T(v,k)),onDocumentColor:T=>i.onRequest(V.DocumentColorRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onColorPresentation:T=>i.onRequest(V.ColorPresentationRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onFoldingRanges:T=>i.onRequest(V.FoldingRangeRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onSelectionRanges:T=>i.onRequest(V.SelectionRangeRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),(0,ce.attachPartialResult)(i,v))),onExecuteCommand:T=>i.onRequest(V.ExecuteCommandRequest.type,(v,k)=>T(v,k,(0,ce.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let T of p)T.attach(x);return i.onRequest(V.InitializeRequest.type,T=>{e.initialize(T),en.string(T.trace)&&(o.trace=V.Trace.fromString(T.trace));for(let v of p)v.initialize(T.capabilities);if(g){let v=g(T,new V.CancellationTokenSource().token,(0,ce.attachWorkDone)(i,T),void 0);return h(v).then(k=>{if(k instanceof V.ResponseError)return k;let j=k;j||(j={capabilities:{}});let O=j.capabilities;O||(O={},j.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=en.number(x.__textDocumentSync)?x.__textDocumentSync:V.TextDocumentSyncKind.None:!en.number(O.textDocumentSync)&&!en.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=en.number(x.__textDocumentSync)?x.__textDocumentSync:V.TextDocumentSyncKind.None);for(let $ of p)$.fillServerCapabilities(O);return j})}else{let v={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let k of p)k.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,d)return d(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,T=>{o.trace=V.Trace.fromString(T.value)}),x}we.createConnection=Z1});var Eb=b(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.resolveModulePath=xr.FileSystem=xr.resolveGlobalYarnPath=xr.resolveGlobalNodePath=xr.resolve=xr.uriToFilePath=void 0;var J1=require("url"),On=require("path"),km=require("fs"),Nm=require("child_process");function Q1(t){let e=J1.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let o=r[0],a=r[1];o.length===0&&a.length>1&&a[1]===":"&&r.shift()}return On.normalize(r.join("/"))}xr.uriToFilePath=Q1;function Pm(){return process.platform==="win32"}function gc(t,e,r,n){let i="NODE_PATH",o=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((a,s)=>{let u=process.env,l=Object.create(null);Object.keys(u).forEach(c=>l[c]=u[c]),e&&km.existsSync(e)&&(l[i]?l[i]=e+On.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let c=(0,Nm.fork)("",[],{cwd:r,env:l,execArgv:["-e",o]});if(c.pid===void 0){s(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",p=>{s(p)}),c.on("message",p=>{p.c==="r"&&(c.send({c:"e"}),p.s?a(p.r):s(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){s(c)}})}xr.resolve=gc;function Dm(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(o=>r[o]=process.env[o]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Pm()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let o=(0,Nm.spawnSync)(e,["config","get","prefix"],n).stdout;if(!o){t&&t("'npm config get prefix' didn't return a value.");return}let a=o.trim();return t&&t(`'npm config get prefix' value is: ${a}`),a.length>0?Pm()?On.join(a,"node_modules"):On.join(a,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}xr.resolveGlobalNodePath=Dm;function eM(t){let e="yarn",r={encoding:"utf8"};Pm()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,Nm.spawnSync)(e,["global","dir","--json"],r),o=i.stdout;if(!o){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let a=o.trim().split(/\r?\n/);for(let s of a)try{let u=JSON.parse(s);if(u.type==="log")return On.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}xr.resolveGlobalYarnPath=eM;var Ab;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!km.existsSync(__filename.toUpperCase())||!km.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,o){return r()?On.normalize(o).indexOf(On.normalize(i))===0:On.normalize(o).toLowerCase().indexOf(On.normalize(i).toLowerCase())===0}t.isParent=n})(Ab=xr.FileSystem||(xr.FileSystem={}));function tM(t,e,r,n){return r?(On.isAbsolute(r)||(r=On.join(t,r)),gc(e,r,r,n).then(i=>Ab.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>gc(e,Dm(n),t,n))):gc(e,Dm(n),t,n)}xr.resolveModulePath=tM});var Om=b((d4,Cb)=>{"use strict";Cb.exports=Lt()});var wb=b(rr=>{"use strict";var rM=rr&&rr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xb=rr&&rr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rM(e,t,r)};Object.defineProperty(rr,"__esModule",{value:!0});rr.ProposedFeatures=rr.NotebookDocuments=rr.TextDocuments=rr.SemanticTokensBuilder=void 0;var nM=gm();Object.defineProperty(rr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return nM.SemanticTokensBuilder}});xb(Lt(),rr);var iM=Tm();Object.defineProperty(rr,"TextDocuments",{enumerable:!0,get:function(){return iM.TextDocuments}});var oM=bm();Object.defineProperty(rr,"NotebookDocuments",{enumerable:!0,get:function(){return oM.NotebookDocuments}});xb(Sm(),rr);var aM;(function(t){t.all={__brand:"features"}})(aM=rr.ProposedFeatures||(rr.ProposedFeatures={}))});var Xe=b(Wr=>{"use strict";var sM=Wr&&Wr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kb=Wr&&Wr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sM(e,t,r)};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createConnection=Wr.Files=void 0;var Im=xl(),uM=Sm(),Qs=Eb(),Lo=Om();kb(Om(),Wr);kb(wb(),Wr);var lM;(function(t){t.uriToFilePath=Qs.uriToFilePath,t.resolveGlobalNodePath=Qs.resolveGlobalNodePath,t.resolveGlobalYarnPath=Qs.resolveGlobalYarnPath,t.resolve=Qs.resolve,t.resolveModulePath=Qs.resolveModulePath})(lM=Wr.Files||(Wr.Files={}));var Sb;function yc(){if(Sb!==void 0)try{Sb.end()}catch{}}var ka=!1,Pb;function cM(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(Pb=setInterval(()=>{try{process.kill(n,0)}catch{yc(),process.exit(ka?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}cM();var fM={initialize:t=>{let e=t.processId;Im.number(e)&&Pb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ka?0:1)}},3e3)},get shutdownReceived(){return ka},set shutdownReceived(t){ka=t},exit:t=>{yc(),process.exit(t)}};function dM(t,e,r,n){let i,o,a,s;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Lo.ConnectionStrategy.is(t)||Lo.ConnectionOptions.is(t)?s=t:(o=t,a=e,s=r),pM(o,a,s,i)}Wr.createConnection=dM;function pM(t,e,r,n){if(!t&&!e&&process.argv.length>2){let s,u,l=process.argv.slice(2);for(let c=0;c<l.length;c++){let f=l[c];if(f==="--node-ipc"){t=new Lo.IPCMessageReader(process),e=new Lo.IPCMessageWriter(process);break}else if(f==="--stdio"){t=process.stdin,e=process.stdout;break}else if(f==="--socket"){s=parseInt(l[c+1]);break}else if(f==="--pipe"){u=l[c+1];break}else{var i=f.split("=");if(i[0]==="--socket"){s=parseInt(i[1]);break}else if(i[0]==="--pipe"){u=i[1];break}}}if(s){let c=(0,Lo.createServerSocketTransport)(s);t=c[0],e=c[1]}else if(u){let c=(0,Lo.createServerPipeTransport)(u);t=c[0],e=c[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Im.func(t.read)&&Im.func(t.on)){let s=t;s.on("end",()=>{yc(),process.exit(ka?0:1)}),s.on("close",()=>{yc(),process.exit(ka?0:1)})}let a=s=>(0,Lo.createProtocolConnection)(t,e,s,r);return(0,uM.createConnection)(a,fM,n)}});var _c=b((Db,vc)=>{(function(t){if(typeof vc=="object"&&typeof vc.exports=="object"){var e=t(require,Db);e!==void 0&&(vc.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=void 0;class r{constructor(l,c,f,p){this._uri=l,this._languageId=c,this._version=f,this._content=p,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(l){if(l){let c=this.offsetAt(l.start),f=this.offsetAt(l.end);return this._content.substring(c,f)}return this._content}update(l,c){for(let f of l)if(r.isIncremental(f)){let p=a(f.range),h=this.offsetAt(p.start),d=this.offsetAt(p.end);this._content=this._content.substring(0,h)+f.text+this._content.substring(d,this._content.length);let g=Math.max(p.start.line,0),C=Math.max(p.end.line,0),x=this._lineOffsets,T=o(f.text,!1,h);if(C-g===T.length)for(let k=0,j=T.length;k<j;k++)x[k+g+1]=T[k];else T.length<1e4?x.splice(g+1,C-g,...T):this._lineOffsets=x=x.slice(0,g+1).concat(T,x.slice(C+1));let v=f.text.length-(d-h);if(v!==0)for(let k=g+1+T.length,j=x.length;k<j;k++)x[k]=x[k]+v}else if(r.isFull(f))this._content=f.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=c}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=o(this._content,!0)),this._lineOffsets}positionAt(l){l=Math.max(Math.min(l,this._content.length),0);let c=this.getLineOffsets(),f=0,p=c.length;if(p===0)return{line:0,character:l};for(;f<p;){let d=Math.floor((f+p)/2);c[d]>l?p=d:f=d+1}let h=f-1;return{line:h,character:l-c[h]}}offsetAt(l){let c=this.getLineOffsets();if(l.line>=c.length)return this._content.length;if(l.line<0)return 0;let f=c[l.line],p=l.line+1<c.length?c[l.line+1]:this._content.length;return Math.max(Math.min(f+l.character,p),f)}get lineCount(){return this.getLineOffsets().length}static isIncremental(l){let c=l;return c!=null&&typeof c.text=="string"&&c.range!==void 0&&(c.rangeLength===void 0||typeof c.rangeLength=="number")}static isFull(l){let c=l;return c!=null&&typeof c.text=="string"&&c.range===void 0&&c.rangeLength===void 0}}var n;(function(u){function l(p,h,d,g){return new r(p,h,d,g)}u.create=l;function c(p,h,d){if(p instanceof r)return p.update(h,d),p;throw new Error("TextDocument.update: document must be created by TextDocument.create")}u.update=c;function f(p,h){let d=p.getText(),g=i(h.map(s),(T,v)=>{let k=T.range.start.line-v.range.start.line;return k===0?T.range.start.character-v.range.start.character:k}),C=0,x=[];for(let T of g){let v=p.offsetAt(T.range.start);if(v<C)throw new Error("Overlapping edit");v>C&&x.push(d.substring(C,v)),T.newText.length&&x.push(T.newText),C=p.offsetAt(T.range.end)}return x.push(d.substr(C)),x.join("")}u.applyEdits=f})(n=e.TextDocument||(e.TextDocument={}));function i(u,l){if(u.length<=1)return u;let c=u.length/2|0,f=u.slice(0,c),p=u.slice(c);i(f,l),i(p,l);let h=0,d=0,g=0;for(;h<f.length&&d<p.length;)l(f[h],p[d])<=0?u[g++]=f[h++]:u[g++]=p[d++];for(;h<f.length;)u[g++]=f[h++];for(;d<p.length;)u[g++]=p[d++];return u}function o(u,l,c=0){let f=l?[c]:[];for(let p=0;p<u.length;p++){let h=u.charCodeAt(p);(h===13||h===10)&&(h===13&&p+1<u.length&&u.charCodeAt(p+1)===10&&p++,f.push(c+p+1))}return f}function a(u){let l=u.start,c=u.end;return l.line>c.line||l.line===c.line&&l.character>c.character?{start:c,end:l}:u}function s(u){let l=a(u.range);return l!==u.range?{newText:u.newText,range:l}:u}})});var Pa=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.isRootCstNode=io.isLeafCstNode=io.isCompositeCstNode=void 0;function Nb(t){return typeof t=="object"&&!!t&&"children"in t}io.isCompositeCstNode=Nb;function hM(t){return typeof t=="object"&&!!t&&"tokenType"in t}io.isLeafCstNode=hM;function mM(t){return Nb(t)&&"fullText"in t}io.isRootCstNode=mM});var Bt=b(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.Reduction=it.TreeStreamImpl=it.stream=it.DONE_RESULT=it.EMPTY_STREAM=it.StreamImpl=void 0;var nr=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new nr(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return it.DONE_RESULT})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=gM(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new nr(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?it.DONE_RESULT:{done:!1,value:e(i)}})}filter(e){return new nr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return it.DONE_RESULT})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new nr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Tc(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return it.DONE_RESULT})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new nr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Tc(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return it.DONE_RESULT})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new nr(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new nr(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?it.DONE_RESULT:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};it.StreamImpl=nr;function gM(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Tc(t){return!!t&&typeof t[Symbol.iterator]=="function"}it.EMPTY_STREAM=new nr(()=>{},()=>it.DONE_RESULT);it.DONE_RESULT=Object.freeze({done:!0,value:void 0});function yM(...t){if(t.length===1){let e=t[0];if(e instanceof nr)return e;if(Tc(e))return new nr(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new nr(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:it.DONE_RESULT)}return t.length>1?new nr(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Tc(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return it.DONE_RESULT}):it.EMPTY_STREAM}it.stream=yM;var $m=class extends nr{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return it.DONE_RESULT})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}};it.TreeStreamImpl=$m;var vM;(function(t){function e(o){return o.reduce((a,s)=>a+s,0)}t.sum=e;function r(o){return o.reduce((a,s)=>a*s,0)}t.product=r;function n(o){return o.reduce((a,s)=>Math.min(a,s))}t.min=n;function i(o){return o.reduce((a,s)=>Math.max(a,s))}t.max=i})(vM=it.Reduction||(it.Reduction={}))});var pt=b(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.getInteriorNodes=Be.getStartlineNode=Be.getNextNode=Be.getPreviousNode=Be.findLeafNodeAtOffset=Be.isCommentNode=Be.findCommentNode=Be.findDeclarationNodeAtOffset=Be.DefaultNameRegexp=Be.toDocumentSegment=Be.tokenToRange=Be.flattenCst=Be.streamCst=void 0;var Da=Pa(),_M=Bt();function Ib(t){return new _M.TreeStreamImpl(t,e=>(0,Da.isCompositeCstNode)(e)?e.children:[],{includeRoot:!0})}Be.streamCst=Ib;function TM(t){return Ib(t).filter(Da.isLeafCstNode)}Be.flattenCst=TM;function RM(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}Be.tokenToRange=RM;function bM(t){let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}Be.toDocumentSegment=bM;Be.DefaultNameRegexp=/^[\w\p{L}]$/u;function AM(t,e,r=Be.DefaultNameRegexp){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Lm(t,e)}}Be.findDeclarationNodeAtOffset=AM;function EM(t,e){if(t){let r=$b(t,!0);if(r&&Mm(r,e))return r;if((0,Da.isRootCstNode)(t)){let n=t.children.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.children[i];if(Mm(o,e))return o}}}}Be.findCommentNode=EM;function Mm(t,e){return(0,Da.isLeafCstNode)(t)&&e.includes(t.tokenType.name)}Be.isCommentNode=Mm;function Lm(t,e){if((0,Da.isLeafCstNode)(t))return t;if((0,Da.isCompositeCstNode)(t)){let r=0,n=t.children.length-1;for(;r<=n;){let i=Math.floor((r+n)/2),o=t.children[i];if(o.offset>e)n=i-1;else if(o.end<=e)r=i+1;else return Lm(o,e)}}}Be.findLeafNodeAtOffset=Lm;function $b(t,e=!0){for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);if(n===0)t=r;else{n--;let i=r.children[n];if(e||!i.hidden)return i}}}Be.getPreviousNode=$b;function CM(t,e=!0){for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);if(r.children.length-1===n)t=r;else{n++;let i=r.children[n];if(e||!i.hidden)return i}}}Be.getNextNode=CM;function xM(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.parent;){let i=t.parent,o=n??i.children.indexOf(t);if(o===0?(t=i,n=void 0):(n=o-1,t=i.children[n]),t.range.start.line!==e)break;r=t}return r}Be.getStartlineNode=xM;function wM(t,e){let r=SM(t,e);return r?r.parent.children.slice(r.a+1,r.b):[]}Be.getInteriorNodes=wM;function SM(t,e){let r=Ob(t),n=Ob(e),i;for(let o=0;o<r.length&&o<n.length;o++){let a=r[o],s=n[o];if(a.parent===s.parent)i={parent:a.parent,a:a.index,b:s.index};else break}return i}function Ob(t){let e=[];for(;t.parent;){let r=t.parent,n=r.children.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}});var eu=b(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.eagerLoad=Na.inject=void 0;function kM(t,e,r,n){let i=[t,e,r,n].reduce(jb,{});return qb(i)}Na.inject=kM;var Fm=Symbol("isProxy");function Fb(t){if(t&&t[Fm])for(let e of Object.values(t))Fb(e);return t}Na.eagerLoad=Fb;function qb(t,e){let r=new Proxy({},{deleteProperty:()=>!1,get:(n,i)=>Lb(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(Lb(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Reflect.ownKeys(t),Fm]});return r[Fm]=!0,r}var Mb=Symbol();function Lb(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===Mb)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/di/cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=Mb;try{t[e]=typeof i=="function"?i(n):qb(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function jb(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=jb(i,n):t[r]=n}}return t}});var Ie=b(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.findLocalReferences=je.streamReferences=je.streamAst=je.streamAllContents=je.streamContents=je.findRootNode=je.getDocument=je.hasContainerOfType=je.getContainerOfType=je.isLinkingError=je.isAstNodeDescription=je.isReference=je.linkContentToContainer=je.isAstNode=void 0;var Fo=Bt();function Oa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}je.isAstNode=Oa;function PM(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Oa(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Oa(r)&&(r.$container=t,r.$containerProperty=e))}je.linkContentToContainer=PM;function Rc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}je.isReference=Rc;function DM(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}je.isAstNodeDescription=DM;function NM(t){return typeof t=="object"&&t!==null&&Oa(t.container)&&Rc(t.reference)&&typeof t.message=="string"}je.isLinkingError=NM;function OM(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}je.getContainerOfType=OM;function IM(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}je.hasContainerOfType=IM;function Gb(t){let r=Ub(t).$document;if(!r)throw new Error("AST node has no document.");return r}je.getDocument=Gb;function Ub(t){for(;t.$container;)t=t.$container;return t}je.findRootNode=Ub;function qm(t){return new Fo.StreamImpl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Oa(n))return e.keyIndex++,{done:!1,value:n};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Oa(o))return{done:!1,value:o}}e.arrayIndex=0}}e.keyIndex++}return Fo.DONE_RESULT})}je.streamContents=qm;function $M(t){return new Fo.TreeStreamImpl(t,e=>qm(e))}je.streamAllContents=$M;function Hb(t){return new Fo.TreeStreamImpl(t,e=>qm(e),{includeRoot:!0})}je.streamAst=Hb;function Bb(t){return new Fo.StreamImpl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Rc(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Rc(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Fo.DONE_RESULT})}je.streamReferences=Bb;function MM(t,e=Gb(t).parseResult.value){let r=[];return Hb(e).forEach(n=>{Bb(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),(0,Fo.stream)(r)}je.findLocalReferences=MM});var tn=b(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.MultiMap=void 0;var Ia=Bt(),jm=class{constructor(){this.map=new Map}get size(){return Ia.Reduction.sum((0,Ia.stream)(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return(0,Ia.stream)(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return(0,Ia.stream)(this.map.keys())}values(){return(0,Ia.stream)(this.map.values()).flat()}entriesGroupedByKey(){return(0,Ia.stream)(this.map.entries())}};bc.MultiMap=jm});var Ec=b($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.EmptyFileSystem=$a.EmptyFileSystemProvider=void 0;var Ac=class{readFile(){throw new Error("Method not implemented.")}readFileSync(){throw new Error("Method not implemented.")}async readDirectory(){return[]}};$a.EmptyFileSystemProvider=Ac;$a.EmptyFileSystem={fileSystemProvider:()=>new Ac}});var ot=b(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.isParserRule=A.ParserRule=A.isParameterReference=A.ParameterReference=A.isParameter=A.Parameter=A.isNegation=A.Negation=A.isNegatedToken=A.NegatedToken=A.isNamedArgument=A.NamedArgument=A.isLiteralCondition=A.LiteralCondition=A.isKeyword=A.Keyword=A.isInterface=A.Interface=A.isInferredType=A.InferredType=A.isGroup=A.Group=A.isGrammarImport=A.GrammarImport=A.isGrammar=A.Grammar=A.isDisjunction=A.Disjunction=A.isCrossReference=A.CrossReference=A.isConjunction=A.Conjunction=A.isCharacterRange=A.CharacterRange=A.isAtomType=A.AtomType=A.isAssignment=A.Assignment=A.isAlternatives=A.Alternatives=A.isAction=A.Action=A.isAbstractElement=A.AbstractElement=A.isCondition=A.Condition=A.isAbstractType=A.AbstractType=A.isAbstractRule=A.AbstractRule=void 0;A.reflection=A.LangiumGrammarAstReflection=A.isWildcard=A.Wildcard=A.isUntilToken=A.UntilToken=A.isUnorderedGroup=A.UnorderedGroup=A.isTypeAttribute=A.TypeAttribute=A.isType=A.Type=A.isTerminalRuleCall=A.TerminalRuleCall=A.isTerminalRule=A.TerminalRule=A.isTerminalGroup=A.TerminalGroup=A.isTerminalAlternatives=A.TerminalAlternatives=A.isRuleCall=A.RuleCall=A.isReturnType=A.ReturnType=A.isRegexToken=A.RegexToken=void 0;var LM=Ie();A.AbstractRule="AbstractRule";function FM(t){return A.reflection.isInstance(t,A.AbstractRule)}A.isAbstractRule=FM;A.AbstractType="AbstractType";function qM(t){return A.reflection.isInstance(t,A.AbstractType)}A.isAbstractType=qM;A.Condition="Condition";function jM(t){return A.reflection.isInstance(t,A.Condition)}A.isCondition=jM;A.AbstractElement="AbstractElement";function GM(t){return A.reflection.isInstance(t,A.AbstractElement)}A.isAbstractElement=GM;A.Action="Action";function UM(t){return A.reflection.isInstance(t,A.Action)}A.isAction=UM;A.Alternatives="Alternatives";function HM(t){return A.reflection.isInstance(t,A.Alternatives)}A.isAlternatives=HM;A.Assignment="Assignment";function BM(t){return A.reflection.isInstance(t,A.Assignment)}A.isAssignment=BM;A.AtomType="AtomType";function WM(t){return A.reflection.isInstance(t,A.AtomType)}A.isAtomType=WM;A.CharacterRange="CharacterRange";function KM(t){return A.reflection.isInstance(t,A.CharacterRange)}A.isCharacterRange=KM;A.Conjunction="Conjunction";function zM(t){return A.reflection.isInstance(t,A.Conjunction)}A.isConjunction=zM;A.CrossReference="CrossReference";function VM(t){return A.reflection.isInstance(t,A.CrossReference)}A.isCrossReference=VM;A.Disjunction="Disjunction";function YM(t){return A.reflection.isInstance(t,A.Disjunction)}A.isDisjunction=YM;A.Grammar="Grammar";function XM(t){return A.reflection.isInstance(t,A.Grammar)}A.isGrammar=XM;A.GrammarImport="GrammarImport";function ZM(t){return A.reflection.isInstance(t,A.GrammarImport)}A.isGrammarImport=ZM;A.Group="Group";function JM(t){return A.reflection.isInstance(t,A.Group)}A.isGroup=JM;A.InferredType="InferredType";function QM(t){return A.reflection.isInstance(t,A.InferredType)}A.isInferredType=QM;A.Interface="Interface";function eL(t){return A.reflection.isInstance(t,A.Interface)}A.isInterface=eL;A.Keyword="Keyword";function tL(t){return A.reflection.isInstance(t,A.Keyword)}A.isKeyword=tL;A.LiteralCondition="LiteralCondition";function rL(t){return A.reflection.isInstance(t,A.LiteralCondition)}A.isLiteralCondition=rL;A.NamedArgument="NamedArgument";function nL(t){return A.reflection.isInstance(t,A.NamedArgument)}A.isNamedArgument=nL;A.NegatedToken="NegatedToken";function iL(t){return A.reflection.isInstance(t,A.NegatedToken)}A.isNegatedToken=iL;A.Negation="Negation";function oL(t){return A.reflection.isInstance(t,A.Negation)}A.isNegation=oL;A.Parameter="Parameter";function aL(t){return A.reflection.isInstance(t,A.Parameter)}A.isParameter=aL;A.ParameterReference="ParameterReference";function sL(t){return A.reflection.isInstance(t,A.ParameterReference)}A.isParameterReference=sL;A.ParserRule="ParserRule";function uL(t){return A.reflection.isInstance(t,A.ParserRule)}A.isParserRule=uL;A.RegexToken="RegexToken";function lL(t){return A.reflection.isInstance(t,A.RegexToken)}A.isRegexToken=lL;A.ReturnType="ReturnType";function cL(t){return A.reflection.isInstance(t,A.ReturnType)}A.isReturnType=cL;A.RuleCall="RuleCall";function fL(t){return A.reflection.isInstance(t,A.RuleCall)}A.isRuleCall=fL;A.TerminalAlternatives="TerminalAlternatives";function dL(t){return A.reflection.isInstance(t,A.TerminalAlternatives)}A.isTerminalAlternatives=dL;A.TerminalGroup="TerminalGroup";function pL(t){return A.reflection.isInstance(t,A.TerminalGroup)}A.isTerminalGroup=pL;A.TerminalRule="TerminalRule";function hL(t){return A.reflection.isInstance(t,A.TerminalRule)}A.isTerminalRule=hL;A.TerminalRuleCall="TerminalRuleCall";function mL(t){return A.reflection.isInstance(t,A.TerminalRuleCall)}A.isTerminalRuleCall=mL;A.Type="Type";function gL(t){return A.reflection.isInstance(t,A.Type)}A.isType=gL;A.TypeAttribute="TypeAttribute";function yL(t){return A.reflection.isInstance(t,A.TypeAttribute)}A.isTypeAttribute=yL;A.UnorderedGroup="UnorderedGroup";function vL(t){return A.reflection.isInstance(t,A.UnorderedGroup)}A.isUnorderedGroup=vL;A.UntilToken="UntilToken";function _L(t){return A.reflection.isInstance(t,A.UntilToken)}A.isUntilToken=_L;A.Wildcard="Wildcard";function TL(t){return A.reflection.isInstance(t,A.Wildcard)}A.isWildcard=TL;var Cc=class{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","Assignment","AtomType","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","LiteralCondition","NamedArgument","NegatedToken","Negation","Parameter","ParameterReference","ParserRule","RegexToken","ReturnType","RuleCall","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","UnorderedGroup","UntilToken","Wildcard"]}isInstance(e,r){return(0,LM.isAstNode)(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;switch(e){case A.Action:return this.isSubtype(A.AbstractElement,r)||this.isSubtype(A.AbstractType,r);case A.Alternatives:case A.Assignment:case A.CharacterRange:case A.CrossReference:case A.Group:case A.Keyword:case A.NegatedToken:case A.RegexToken:case A.RuleCall:case A.TerminalAlternatives:case A.TerminalGroup:case A.TerminalRuleCall:case A.UnorderedGroup:case A.UntilToken:case A.Wildcard:return this.isSubtype(A.AbstractElement,r);case A.Conjunction:case A.Disjunction:case A.LiteralCondition:case A.Negation:case A.ParameterReference:return this.isSubtype(A.Condition,r);case A.Interface:case A.Type:return this.isSubtype(A.AbstractType,r);case A.ParserRule:return this.isSubtype(A.AbstractRule,r)||this.isSubtype(A.AbstractType,r);case A.TerminalRule:return this.isSubtype(A.AbstractRule,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":return A.AbstractType;case"AtomType:refType":return A.AbstractType;case"CrossReference:type":return A.AbstractType;case"Grammar:hiddenTokens":return A.AbstractRule;case"Grammar:usedGrammars":return A.Grammar;case"Interface:superTypes":return A.AbstractType;case"NamedArgument:parameter":return A.Parameter;case"ParameterReference:parameter":return A.Parameter;case"ParserRule:hiddenTokens":return A.AbstractRule;case"ParserRule:returnType":return A.AbstractType;case"RuleCall:rule":return A.AbstractRule;case"TerminalRuleCall:rule":return A.TerminalRule;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"Alternatives":return{name:"Alternatives",mandatory:[{name:"elements",type:"array"}]};case"AtomType":return{name:"AtomType",mandatory:[{name:"isArray",type:"boolean"},{name:"isRef",type:"boolean"}]};case"CrossReference":return{name:"CrossReference",mandatory:[{name:"deprecatedSyntax",type:"boolean"}]};case"Grammar":return{name:"Grammar",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"imports",type:"array"},{name:"interfaces",type:"array"},{name:"isDeclared",type:"boolean"},{name:"rules",type:"array"},{name:"types",type:"array"},{name:"usedGrammars",type:"array"}]};case"Group":return{name:"Group",mandatory:[{name:"elements",type:"array"}]};case"Interface":return{name:"Interface",mandatory:[{name:"attributes",type:"array"},{name:"superTypes",type:"array"}]};case"LiteralCondition":return{name:"LiteralCondition",mandatory:[{name:"true",type:"boolean"}]};case"NamedArgument":return{name:"NamedArgument",mandatory:[{name:"calledByName",type:"boolean"}]};case"ParserRule":return{name:"ParserRule",mandatory:[{name:"definesHiddenTokens",type:"boolean"},{name:"entry",type:"boolean"},{name:"fragment",type:"boolean"},{name:"hiddenTokens",type:"array"},{name:"parameters",type:"array"},{name:"wildcard",type:"boolean"}]};case"RuleCall":return{name:"RuleCall",mandatory:[{name:"arguments",type:"array"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",mandatory:[{name:"elements",type:"array"}]};case"TerminalGroup":return{name:"TerminalGroup",mandatory:[{name:"elements",type:"array"}]};case"TerminalRule":return{name:"TerminalRule",mandatory:[{name:"fragment",type:"boolean"},{name:"hidden",type:"boolean"}]};case"Type":return{name:"Type",mandatory:[{name:"typeAlternatives",type:"array"}]};case"TypeAttribute":return{name:"TypeAttribute",mandatory:[{name:"isOptional",type:"boolean"},{name:"typeAlternatives",type:"array"}]};case"UnorderedGroup":return{name:"UnorderedGroup",mandatory:[{name:"elements",type:"array"}]};default:return{name:e,mandatory:[]}}}};A.LangiumGrammarAstReflection=Cc;A.reflection=new Cc});var Wb=b(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.LangiumGrammarGrammar=void 0;var RL=Wt(),xc,bL=()=>xc??(xc=(0,RL.loadGrammarFromJson)(`{
50
50
  "$type": "Grammar",
51
51
  "isDeclared": true,
52
52
  "name": "LangiumGrammar",
@@ -3582,10 +3582,10 @@ ${JSON.stringify(w,null,4)}`);let F=w;if(Ht.string(F.id)||Ht.number(F.id)){let W
3582
3582
  "imports": [],
3583
3583
  "interfaces": [],
3584
3584
  "usedGrammars": []
3585
- }`));wc.LangiumGrammarGrammar=AL});var Kb=b(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.LangiumGrammarGeneratedModule=Ni.LangiumGrammarGeneratedSharedModule=Ni.LangiumGrammarLanguageMetaData=void 0;var EL=ot(),CL=Wb();Ni.LangiumGrammarLanguageMetaData={languageId:"langium",fileExtensions:[".langium"],caseInsensitive:!1};Ni.LangiumGrammarGeneratedSharedModule={AstReflection:()=>new EL.LangiumGrammarAstReflection};Ni.LangiumGrammarGeneratedModule={Grammar:()=>(0,CL.LangiumGrammarGrammar)(),LanguageMetaData:()=>Ni.LangiumGrammarLanguageMetaData,parser:{}}});var In=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.Deferred=Ft.MutexLock=Ft.interruptAndCheck=Ft.isOperationCancelled=Ft.OperationCancelled=Ft.setInterruptionPeriod=Ft.startCancelableOperation=Ft.delayNextTick=void 0;var Sc=ti();function zb(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}Ft.delayNextTick=zb;var Gm=0,Vb=10;function xL(){return Gm=Date.now(),new Sc.CancellationTokenSource}Ft.startCancelableOperation=xL;function wL(t){Vb=t}Ft.setInterruptionPeriod=wL;Ft.OperationCancelled=Symbol("OperationCancelled");function Yb(t){return t===Ft.OperationCancelled}Ft.isOperationCancelled=Yb;async function SL(t){if(t===Sc.CancellationToken.None)return;let e=Date.now();if(e-Gm>=Vb&&(Gm=e,await zb()),t.isCancellationRequested)throw Ft.OperationCancelled}Ft.interruptAndCheck=SL;var Um=class{constructor(){this.previousAction=Promise.resolve(),this.previousTokenSource=new Sc.CancellationTokenSource}lock(e){this.cancel();let r=new Sc.CancellationTokenSource;return this.previousTokenSource=r,this.previousAction=this.previousAction.then(()=>e(r.token).catch(n=>{Yb(n)||console.error("Error: ",n)}))}cancel(){this.previousTokenSource.cancel()}};Ft.MutexLock=Um;var Hm=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};Ft.Deferred=Hm});var Pc=b(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.DefaultScopeComputation=void 0;var Bm=ti(),Xb=Ie(),kL=tn(),Zb=In(),Wm=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=Bm.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=Xb.streamContents,i=Bm.CancellationToken.None){let o=[];this.exportNode(e,o,r);for(let a of n(e))await(0,Zb.interruptAndCheck)(i),this.exportNode(a,o,r);return o}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=Bm.CancellationToken.None){let n=e.parseResult.value,i=new kL.MultiMap;for(let o of(0,Xb.streamAllContents)(n))await(0,Zb.interruptAndCheck)(r),this.processNode(o,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}computeScope(){throw new Error("Deprecated: This method has been renamed to `computeLocalScopes`.")}};kc.DefaultScopeComputation=Wm});var Nc=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.DefaultScopeProvider=oo.EMPTY_SCOPE=oo.StreamScope=void 0;var PL=Ie(),Dc=Bt(),Ma=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}};oo.StreamScope=Ma;oo.EMPTY_SCOPE={getElement(){},getAllElements(){return Dc.EMPTY_STREAM}};var Km=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=(0,PL.getDocument)(e.container).precomputedScopes;if(i){let a=e.container;do{let s=i.get(a);s.length>0&&r.push((0,Dc.stream)(s).filter(u=>this.reflection.isSubtype(u.type,n))),a=a.$container}while(a)}let o=this.getGlobalScope(n);for(let a=r.length-1;a>=0;a--)o=this.createScope(r[a],o);return o}createScope(e,r,n){return new Ma((0,Dc.stream)(e),r,n)}createScopeForNodes(e,r,n){let i=(0,Dc.stream)(e).map(o=>{let a=this.nameProvider.getName(o);if(a)return this.descriptions.createDescription(o,a)}).nonNullable();return new Ma(i,r,n)}getGlobalScope(e){return new Ma(this.indexManager.allElements(e))}};oo.DefaultScopeProvider=Km});var $n=b((tu,zm)=>{(function(t,e){if(typeof tu=="object"&&typeof zm=="object")zm.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r=e();for(var n in r)(typeof tu=="object"?tu:t)[n]=r[n]}})(tu,()=>(()=>{"use strict";var t={470:i=>{function o(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function a(u,l){for(var c,f="",p=0,h=-1,d=0,g=0;g<=u.length;++g){if(g<u.length)c=u.charCodeAt(g);else{if(c===47)break;c=47}if(c===47){if(!(h===g-1||d===1))if(h!==g-1&&d===2){if(f.length<2||p!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var C=f.lastIndexOf("/");if(C!==f.length-1){C===-1?(f="",p=0):p=(f=f.slice(0,C)).length-1-f.lastIndexOf("/"),h=g,d=0;continue}}else if(f.length===2||f.length===1){f="",p=0,h=g,d=0;continue}}l&&(f.length>0?f+="/..":f="..",p=2)}else f.length>0?f+="/"+u.slice(h+1,g):f=u.slice(h+1,g),p=g-h-1;h=g,d=0}else c===46&&d!==-1?++d:d=-1}return f}var s={resolve:function(){for(var u,l="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var p;f>=0?p=arguments[f]:(u===void 0&&(u=process.cwd()),p=u),o(p),p.length!==0&&(l=p+"/"+l,c=p.charCodeAt(0)===47)}return l=a(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(o(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=a(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+u:u},isAbsolute:function(u){return o(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,l=0;l<arguments.length;++l){var c=arguments[l];o(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":s.normalize(u)},relative:function(u,l){if(o(u),o(l),u===l||(u=s.resolve(u))===(l=s.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var f=u.length,p=f-c,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var d=l.length-h,g=p<d?p:d,C=-1,x=0;x<=g;++x){if(x===g){if(d>g){if(l.charCodeAt(h+x)===47)return l.slice(h+x+1);if(x===0)return l.slice(h+x)}else p>g&&(u.charCodeAt(c+x)===47?C=x:x===0&&(C=0));break}var T=u.charCodeAt(c+x);if(T!==l.charCodeAt(h+x))break;T===47&&(C=x)}var v="";for(x=c+C+1;x<=f;++x)x!==f&&u.charCodeAt(x)!==47||(v.length===0?v+="..":v+="/..");return v.length>0?v+l.slice(h+C):(h+=C,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(u){return u},dirname:function(u){if(o(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,f=-1,p=!0,h=u.length-1;h>=1;--h)if((l=u.charCodeAt(h))===47){if(!p){f=h;break}}else p=!1;return f===-1?c?"/":".":c&&f===1?"//":u.slice(0,f)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');o(u);var c,f=0,p=-1,h=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var d=l.length-1,g=-1;for(c=u.length-1;c>=0;--c){var C=u.charCodeAt(c);if(C===47){if(!h){f=c+1;break}}else g===-1&&(h=!1,g=c+1),d>=0&&(C===l.charCodeAt(d)?--d==-1&&(p=c):(d=-1,p=g))}return f===p?p=g:p===-1&&(p=u.length),u.slice(f,p)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!h){f=c+1;break}}else p===-1&&(h=!1,p=c+1);return p===-1?"":u.slice(f,p)},extname:function(u){o(u);for(var l=-1,c=0,f=-1,p=!0,h=0,d=u.length-1;d>=0;--d){var g=u.charCodeAt(d);if(g!==47)f===-1&&(p=!1,f=d+1),g===46?l===-1?l=d:h!==1&&(h=1):l!==-1&&(h=-1);else if(!p){c=d+1;break}}return l===-1||f===-1||h===0||h===1&&l===f-1&&l===c+1?"":u.slice(l,f)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(l,c){var f=c.dir||c.root,p=c.base||(c.name||"")+(c.ext||"");return f?f===c.root?f+p:f+"/"+p:p}(0,u)},parse:function(u){o(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,f=u.charCodeAt(0),p=f===47;p?(l.root="/",c=1):c=0;for(var h=-1,d=0,g=-1,C=!0,x=u.length-1,T=0;x>=c;--x)if((f=u.charCodeAt(x))!==47)g===-1&&(C=!1,g=x+1),f===46?h===-1?h=x:T!==1&&(T=1):h!==-1&&(T=-1);else if(!C){d=x+1;break}return h===-1||g===-1||T===0||T===1&&h===g-1&&h===d+1?g!==-1&&(l.base=l.name=d===0&&p?u.slice(1,g):u.slice(d,g)):(d===0&&p?(l.name=u.slice(1,h),l.base=u.slice(1,g)):(l.name=u.slice(d,h),l.base=u.slice(d,g)),l.ext=u.slice(h,g)),d>0?l.dir=u.slice(0,d-1):p&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,i.exports=s},674:(i,o)=>{if(Object.defineProperty(o,"__esModule",{value:!0}),o.isWindows=void 0,typeof process=="object")o.isWindows=process.platform==="win32";else if(typeof navigator=="object"){var a=navigator.userAgent;o.isWindows=a.indexOf("Windows")>=0}},796:function(i,o,a){var s,u,l=this&&this.__extends||(s=function(G,I){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,z){U.__proto__=z}||function(U,z){for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(U[de]=z[de])},s(G,I)},function(G,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function U(){this.constructor=G}s(G,I),G.prototype=I===null?Object.create(I):(U.prototype=I.prototype,new U)});Object.defineProperty(o,"__esModule",{value:!0}),o.uriToFsPath=o.URI=void 0;var c=a(674),f=/^\w[\w\d+.-]*$/,p=/^\//,h=/^\/\//,d="",g="/",C=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=function(){function G(I,U,z,de,ie,re){re===void 0&&(re=!1),typeof I=="object"?(this.scheme=I.scheme||d,this.authority=I.authority||d,this.path=I.path||d,this.query=I.query||d,this.fragment=I.fragment||d):(this.scheme=function(he,me){return he||me?he:"file"}(I,re),this.authority=U||d,this.path=function(he,me){switch(he){case"https":case"http":case"file":me?me[0]!==g&&(me=g+me):me=g}return me}(this.scheme,z||d),this.query=de||d,this.fragment=ie||d,function(he,me){if(!he.scheme&&me)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(he.authority,'", path: "').concat(he.path,'", query: "').concat(he.query,'", fragment: "').concat(he.fragment,'"}'));if(he.scheme&&!f.test(he.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(he.path){if(he.authority){if(!p.test(he.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(h.test(he.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,re))}return G.isUri=function(I){return I instanceof G||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"},Object.defineProperty(G.prototype,"fsPath",{get:function(){return $(this,!1)},enumerable:!1,configurable:!0}),G.prototype.with=function(I){if(!I)return this;var U=I.scheme,z=I.authority,de=I.path,ie=I.query,re=I.fragment;return U===void 0?U=this.scheme:U===null&&(U=d),z===void 0?z=this.authority:z===null&&(z=d),de===void 0?de=this.path:de===null&&(de=d),ie===void 0?ie=this.query:ie===null&&(ie=d),re===void 0?re=this.fragment:re===null&&(re=d),U===this.scheme&&z===this.authority&&de===this.path&&ie===this.query&&re===this.fragment?this:new v(U,z,de,ie,re)},G.parse=function(I,U){U===void 0&&(U=!1);var z=C.exec(I);return z?new v(z[2]||d,pe(z[4]||d),pe(z[5]||d),pe(z[7]||d),pe(z[9]||d),U):new v(d,d,d,d,d)},G.file=function(I){var U=d;if(c.isWindows&&(I=I.replace(/\\/g,g)),I[0]===g&&I[1]===g){var z=I.indexOf(g,2);z===-1?(U=I.substring(2),I=g):(U=I.substring(2,z),I=I.substring(z)||g)}return new v("file",U,I,d,d)},G.from=function(I){return new v(I.scheme,I.authority,I.path,I.query,I.fragment)},G.prototype.toString=function(I){return I===void 0&&(I=!1),X(this,I)},G.prototype.toJSON=function(){return this},G.revive=function(I){if(I){if(I instanceof G)return I;var U=new v(I);return U._formatted=I.external,U._fsPath=I._sep===T?I.fsPath:null,U}return I},G}();o.URI=x;var T=c.isWindows?1:void 0,v=function(G){function I(){var U=G!==null&&G.apply(this,arguments)||this;return U._formatted=null,U._fsPath=null,U}return l(I,G),Object.defineProperty(I.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=$(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),I.prototype.toString=function(U){return U===void 0&&(U=!1),U?X(this,!0):(this._formatted||(this._formatted=X(this,!1)),this._formatted)},I.prototype.toJSON=function(){var U={$mid:1};return this._fsPath&&(U.fsPath=this._fsPath,U._sep=T),this._formatted&&(U.external=this._formatted),this.path&&(U.path=this.path),this.scheme&&(U.scheme=this.scheme),this.authority&&(U.authority=this.authority),this.query&&(U.query=this.query),this.fragment&&(U.fragment=this.fragment),U},I}(x),k=((u={})[58]="%3A",u[47]="%2F",u[63]="%3F",u[35]="%23",u[91]="%5B",u[93]="%5D",u[64]="%40",u[33]="%21",u[36]="%24",u[38]="%26",u[39]="%27",u[40]="%28",u[41]="%29",u[42]="%2A",u[43]="%2B",u[44]="%2C",u[59]="%3B",u[61]="%3D",u[32]="%20",u);function j(G,I){for(var U=void 0,z=-1,de=0;de<G.length;de++){var ie=G.charCodeAt(de);if(ie>=97&&ie<=122||ie>=65&&ie<=90||ie>=48&&ie<=57||ie===45||ie===46||ie===95||ie===126||I&&ie===47)z!==-1&&(U+=encodeURIComponent(G.substring(z,de)),z=-1),U!==void 0&&(U+=G.charAt(de));else{U===void 0&&(U=G.substr(0,de));var re=k[ie];re!==void 0?(z!==-1&&(U+=encodeURIComponent(G.substring(z,de)),z=-1),U+=re):z===-1&&(z=de)}}return z!==-1&&(U+=encodeURIComponent(G.substring(z))),U!==void 0?U:G}function O(G){for(var I=void 0,U=0;U<G.length;U++){var z=G.charCodeAt(U);z===35||z===63?(I===void 0&&(I=G.substr(0,U)),I+=k[z]):I!==void 0&&(I+=G[U])}return I!==void 0?I:G}function $(G,I){var U;return U=G.authority&&G.path.length>1&&G.scheme==="file"?"//".concat(G.authority).concat(G.path):G.path.charCodeAt(0)===47&&(G.path.charCodeAt(1)>=65&&G.path.charCodeAt(1)<=90||G.path.charCodeAt(1)>=97&&G.path.charCodeAt(1)<=122)&&G.path.charCodeAt(2)===58?I?G.path.substr(1):G.path[1].toLowerCase()+G.path.substr(2):G.path,c.isWindows&&(U=U.replace(/\//g,"\\")),U}function X(G,I){var U=I?O:j,z="",de=G.scheme,ie=G.authority,re=G.path,he=G.query,me=G.fragment;if(de&&(z+=de,z+=":"),(ie||de==="file")&&(z+=g,z+=g),ie){var ze=ie.indexOf("@");if(ze!==-1){var H=ie.substr(0,ze);ie=ie.substr(ze+1),(ze=H.indexOf(":"))===-1?z+=U(H,!1):(z+=U(H.substr(0,ze),!1),z+=":",z+=U(H.substr(ze+1),!1)),z+="@"}(ze=(ie=ie.toLowerCase()).indexOf(":"))===-1?z+=U(ie,!1):(z+=U(ie.substr(0,ze),!1),z+=ie.substr(ze))}if(re){if(re.length>=3&&re.charCodeAt(0)===47&&re.charCodeAt(2)===58)(K=re.charCodeAt(1))>=65&&K<=90&&(re="/".concat(String.fromCharCode(K+32),":").concat(re.substr(3)));else if(re.length>=2&&re.charCodeAt(1)===58){var K;(K=re.charCodeAt(0))>=65&&K<=90&&(re="".concat(String.fromCharCode(K+32),":").concat(re.substr(2)))}z+=U(re,!0)}return he&&(z+="?",z+=U(he,!1)),me&&(z+="#",z+=I?me:j(me,!1)),z}function J(G){try{return decodeURIComponent(G)}catch{return G.length>3?G.substr(0,3)+J(G.substr(3)):G}}o.uriToFsPath=$;var le=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pe(G){return G.match(le)?G.replace(le,function(I){return J(I)}):G}},679:function(i,o,a){var s=this&&this.__spreadArray||function(p,h,d){if(d||arguments.length===2)for(var g,C=0,x=h.length;C<x;C++)!g&&C in h||(g||(g=Array.prototype.slice.call(h,0,C)),g[C]=h[C]);return p.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(o,"__esModule",{value:!0}),o.Utils=void 0;var u,l=a(470),c=l.posix||l,f="/";(u=o.Utils||(o.Utils={})).joinPath=function(p){for(var h=[],d=1;d<arguments.length;d++)h[d-1]=arguments[d];return p.with({path:c.join.apply(c,s([p.path],h,!1))})},u.resolvePath=function(p){for(var h=[],d=1;d<arguments.length;d++)h[d-1]=arguments[d];var g=p.path,C=!1;g[0]!==f&&(g=f+g,C=!0);var x=c.resolve.apply(c,s([g],h,!1));return C&&x[0]===f&&!p.authority&&(x=x.substring(1)),p.with({path:x})},u.dirname=function(p){if(p.path.length===0||p.path===f)return p;var h=c.dirname(p.path);return h.length===1&&h.charCodeAt(0)===46&&(h=""),p.with({path:h})},u.basename=function(p){return c.basename(p.path)},u.extname=function(p){return c.extname(p.path)}}},e={};function r(i){var o=e[i];if(o!==void 0)return o.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,r),a.exports}var n={};return(()=>{var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;var o=r(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return o.URI}});var a=r(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return a.Utils}})})(),n})())});var $c=b(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.NLEmpty=rn.NL=rn.NewLineNode=rn.IndentNode=rn.CompositeGeneratorNode=void 0;var DL=typeof process>"u"?`
3585
+ }`));wc.LangiumGrammarGrammar=bL});var Kb=b(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.LangiumGrammarGeneratedModule=Ni.LangiumGrammarGeneratedSharedModule=Ni.LangiumGrammarLanguageMetaData=void 0;var AL=ot(),EL=Wb();Ni.LangiumGrammarLanguageMetaData={languageId:"langium",fileExtensions:[".langium"],caseInsensitive:!1};Ni.LangiumGrammarGeneratedSharedModule={AstReflection:()=>new AL.LangiumGrammarAstReflection};Ni.LangiumGrammarGeneratedModule={Grammar:()=>(0,EL.LangiumGrammarGrammar)(),LanguageMetaData:()=>Ni.LangiumGrammarLanguageMetaData,parser:{}}});var In=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.Deferred=Ft.MutexLock=Ft.interruptAndCheck=Ft.isOperationCancelled=Ft.OperationCancelled=Ft.setInterruptionPeriod=Ft.startCancelableOperation=Ft.delayNextTick=void 0;var Sc=ti();function zb(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}Ft.delayNextTick=zb;var Gm=0,Vb=10;function CL(){return Gm=Date.now(),new Sc.CancellationTokenSource}Ft.startCancelableOperation=CL;function xL(t){Vb=t}Ft.setInterruptionPeriod=xL;Ft.OperationCancelled=Symbol("OperationCancelled");function Yb(t){return t===Ft.OperationCancelled}Ft.isOperationCancelled=Yb;async function wL(t){if(t===Sc.CancellationToken.None)return;let e=Date.now();if(e-Gm>=Vb&&(Gm=e,await zb()),t.isCancellationRequested)throw Ft.OperationCancelled}Ft.interruptAndCheck=wL;var Um=class{constructor(){this.previousAction=Promise.resolve(),this.previousTokenSource=new Sc.CancellationTokenSource}lock(e){this.cancel();let r=new Sc.CancellationTokenSource;return this.previousTokenSource=r,this.previousAction=this.previousAction.then(()=>e(r.token).catch(n=>{Yb(n)||console.error("Error: ",n)}))}cancel(){this.previousTokenSource.cancel()}};Ft.MutexLock=Um;var Hm=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};Ft.Deferred=Hm});var Pc=b(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.DefaultScopeComputation=void 0;var Bm=ti(),Xb=Ie(),SL=tn(),Zb=In(),Wm=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=Bm.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=Xb.streamContents,i=Bm.CancellationToken.None){let o=[];this.exportNode(e,o,r);for(let a of n(e))await(0,Zb.interruptAndCheck)(i),this.exportNode(a,o,r);return o}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=Bm.CancellationToken.None){let n=e.parseResult.value,i=new SL.MultiMap;for(let o of(0,Xb.streamAllContents)(n))await(0,Zb.interruptAndCheck)(r),this.processNode(o,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}computeScope(){throw new Error("Deprecated: This method has been renamed to `computeLocalScopes`.")}};kc.DefaultScopeComputation=Wm});var Nc=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.DefaultScopeProvider=oo.EMPTY_SCOPE=oo.StreamScope=void 0;var kL=Ie(),Dc=Bt(),Ma=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}};oo.StreamScope=Ma;oo.EMPTY_SCOPE={getElement(){},getAllElements(){return Dc.EMPTY_STREAM}};var Km=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=(0,kL.getDocument)(e.container).precomputedScopes;if(i){let a=e.container;do{let s=i.get(a);s.length>0&&r.push((0,Dc.stream)(s).filter(u=>this.reflection.isSubtype(u.type,n))),a=a.$container}while(a)}let o=this.getGlobalScope(n);for(let a=r.length-1;a>=0;a--)o=this.createScope(r[a],o);return o}createScope(e,r,n){return new Ma((0,Dc.stream)(e),r,n)}createScopeForNodes(e,r,n){let i=(0,Dc.stream)(e).map(o=>{let a=this.nameProvider.getName(o);if(a)return this.descriptions.createDescription(o,a)}).nonNullable();return new Ma(i,r,n)}getGlobalScope(e){return new Ma(this.indexManager.allElements(e))}};oo.DefaultScopeProvider=Km});var $n=b((tu,zm)=>{(function(t,e){if(typeof tu=="object"&&typeof zm=="object")zm.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r=e();for(var n in r)(typeof tu=="object"?tu:t)[n]=r[n]}})(tu,()=>(()=>{"use strict";var t={470:i=>{function o(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function a(u,l){for(var c,f="",p=0,h=-1,d=0,g=0;g<=u.length;++g){if(g<u.length)c=u.charCodeAt(g);else{if(c===47)break;c=47}if(c===47){if(!(h===g-1||d===1))if(h!==g-1&&d===2){if(f.length<2||p!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var C=f.lastIndexOf("/");if(C!==f.length-1){C===-1?(f="",p=0):p=(f=f.slice(0,C)).length-1-f.lastIndexOf("/"),h=g,d=0;continue}}else if(f.length===2||f.length===1){f="",p=0,h=g,d=0;continue}}l&&(f.length>0?f+="/..":f="..",p=2)}else f.length>0?f+="/"+u.slice(h+1,g):f=u.slice(h+1,g),p=g-h-1;h=g,d=0}else c===46&&d!==-1?++d:d=-1}return f}var s={resolve:function(){for(var u,l="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var p;f>=0?p=arguments[f]:(u===void 0&&(u=process.cwd()),p=u),o(p),p.length!==0&&(l=p+"/"+l,c=p.charCodeAt(0)===47)}return l=a(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(o(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=a(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+u:u},isAbsolute:function(u){return o(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,l=0;l<arguments.length;++l){var c=arguments[l];o(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":s.normalize(u)},relative:function(u,l){if(o(u),o(l),u===l||(u=s.resolve(u))===(l=s.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var f=u.length,p=f-c,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var d=l.length-h,g=p<d?p:d,C=-1,x=0;x<=g;++x){if(x===g){if(d>g){if(l.charCodeAt(h+x)===47)return l.slice(h+x+1);if(x===0)return l.slice(h+x)}else p>g&&(u.charCodeAt(c+x)===47?C=x:x===0&&(C=0));break}var T=u.charCodeAt(c+x);if(T!==l.charCodeAt(h+x))break;T===47&&(C=x)}var v="";for(x=c+C+1;x<=f;++x)x!==f&&u.charCodeAt(x)!==47||(v.length===0?v+="..":v+="/..");return v.length>0?v+l.slice(h+C):(h+=C,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(u){return u},dirname:function(u){if(o(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,f=-1,p=!0,h=u.length-1;h>=1;--h)if((l=u.charCodeAt(h))===47){if(!p){f=h;break}}else p=!1;return f===-1?c?"/":".":c&&f===1?"//":u.slice(0,f)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');o(u);var c,f=0,p=-1,h=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var d=l.length-1,g=-1;for(c=u.length-1;c>=0;--c){var C=u.charCodeAt(c);if(C===47){if(!h){f=c+1;break}}else g===-1&&(h=!1,g=c+1),d>=0&&(C===l.charCodeAt(d)?--d==-1&&(p=c):(d=-1,p=g))}return f===p?p=g:p===-1&&(p=u.length),u.slice(f,p)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!h){f=c+1;break}}else p===-1&&(h=!1,p=c+1);return p===-1?"":u.slice(f,p)},extname:function(u){o(u);for(var l=-1,c=0,f=-1,p=!0,h=0,d=u.length-1;d>=0;--d){var g=u.charCodeAt(d);if(g!==47)f===-1&&(p=!1,f=d+1),g===46?l===-1?l=d:h!==1&&(h=1):l!==-1&&(h=-1);else if(!p){c=d+1;break}}return l===-1||f===-1||h===0||h===1&&l===f-1&&l===c+1?"":u.slice(l,f)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(l,c){var f=c.dir||c.root,p=c.base||(c.name||"")+(c.ext||"");return f?f===c.root?f+p:f+"/"+p:p}(0,u)},parse:function(u){o(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,f=u.charCodeAt(0),p=f===47;p?(l.root="/",c=1):c=0;for(var h=-1,d=0,g=-1,C=!0,x=u.length-1,T=0;x>=c;--x)if((f=u.charCodeAt(x))!==47)g===-1&&(C=!1,g=x+1),f===46?h===-1?h=x:T!==1&&(T=1):h!==-1&&(T=-1);else if(!C){d=x+1;break}return h===-1||g===-1||T===0||T===1&&h===g-1&&h===d+1?g!==-1&&(l.base=l.name=d===0&&p?u.slice(1,g):u.slice(d,g)):(d===0&&p?(l.name=u.slice(1,h),l.base=u.slice(1,g)):(l.name=u.slice(d,h),l.base=u.slice(d,g)),l.ext=u.slice(h,g)),d>0?l.dir=u.slice(0,d-1):p&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,i.exports=s},674:(i,o)=>{if(Object.defineProperty(o,"__esModule",{value:!0}),o.isWindows=void 0,typeof process=="object")o.isWindows=process.platform==="win32";else if(typeof navigator=="object"){var a=navigator.userAgent;o.isWindows=a.indexOf("Windows")>=0}},796:function(i,o,a){var s,u,l=this&&this.__extends||(s=function(G,I){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,z){U.__proto__=z}||function(U,z){for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(U[de]=z[de])},s(G,I)},function(G,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function U(){this.constructor=G}s(G,I),G.prototype=I===null?Object.create(I):(U.prototype=I.prototype,new U)});Object.defineProperty(o,"__esModule",{value:!0}),o.uriToFsPath=o.URI=void 0;var c=a(674),f=/^\w[\w\d+.-]*$/,p=/^\//,h=/^\/\//,d="",g="/",C=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=function(){function G(I,U,z,de,ie,re){re===void 0&&(re=!1),typeof I=="object"?(this.scheme=I.scheme||d,this.authority=I.authority||d,this.path=I.path||d,this.query=I.query||d,this.fragment=I.fragment||d):(this.scheme=function(he,me){return he||me?he:"file"}(I,re),this.authority=U||d,this.path=function(he,me){switch(he){case"https":case"http":case"file":me?me[0]!==g&&(me=g+me):me=g}return me}(this.scheme,z||d),this.query=de||d,this.fragment=ie||d,function(he,me){if(!he.scheme&&me)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(he.authority,'", path: "').concat(he.path,'", query: "').concat(he.query,'", fragment: "').concat(he.fragment,'"}'));if(he.scheme&&!f.test(he.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(he.path){if(he.authority){if(!p.test(he.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(h.test(he.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,re))}return G.isUri=function(I){return I instanceof G||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"},Object.defineProperty(G.prototype,"fsPath",{get:function(){return $(this,!1)},enumerable:!1,configurable:!0}),G.prototype.with=function(I){if(!I)return this;var U=I.scheme,z=I.authority,de=I.path,ie=I.query,re=I.fragment;return U===void 0?U=this.scheme:U===null&&(U=d),z===void 0?z=this.authority:z===null&&(z=d),de===void 0?de=this.path:de===null&&(de=d),ie===void 0?ie=this.query:ie===null&&(ie=d),re===void 0?re=this.fragment:re===null&&(re=d),U===this.scheme&&z===this.authority&&de===this.path&&ie===this.query&&re===this.fragment?this:new v(U,z,de,ie,re)},G.parse=function(I,U){U===void 0&&(U=!1);var z=C.exec(I);return z?new v(z[2]||d,pe(z[4]||d),pe(z[5]||d),pe(z[7]||d),pe(z[9]||d),U):new v(d,d,d,d,d)},G.file=function(I){var U=d;if(c.isWindows&&(I=I.replace(/\\/g,g)),I[0]===g&&I[1]===g){var z=I.indexOf(g,2);z===-1?(U=I.substring(2),I=g):(U=I.substring(2,z),I=I.substring(z)||g)}return new v("file",U,I,d,d)},G.from=function(I){return new v(I.scheme,I.authority,I.path,I.query,I.fragment)},G.prototype.toString=function(I){return I===void 0&&(I=!1),X(this,I)},G.prototype.toJSON=function(){return this},G.revive=function(I){if(I){if(I instanceof G)return I;var U=new v(I);return U._formatted=I.external,U._fsPath=I._sep===T?I.fsPath:null,U}return I},G}();o.URI=x;var T=c.isWindows?1:void 0,v=function(G){function I(){var U=G!==null&&G.apply(this,arguments)||this;return U._formatted=null,U._fsPath=null,U}return l(I,G),Object.defineProperty(I.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=$(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),I.prototype.toString=function(U){return U===void 0&&(U=!1),U?X(this,!0):(this._formatted||(this._formatted=X(this,!1)),this._formatted)},I.prototype.toJSON=function(){var U={$mid:1};return this._fsPath&&(U.fsPath=this._fsPath,U._sep=T),this._formatted&&(U.external=this._formatted),this.path&&(U.path=this.path),this.scheme&&(U.scheme=this.scheme),this.authority&&(U.authority=this.authority),this.query&&(U.query=this.query),this.fragment&&(U.fragment=this.fragment),U},I}(x),k=((u={})[58]="%3A",u[47]="%2F",u[63]="%3F",u[35]="%23",u[91]="%5B",u[93]="%5D",u[64]="%40",u[33]="%21",u[36]="%24",u[38]="%26",u[39]="%27",u[40]="%28",u[41]="%29",u[42]="%2A",u[43]="%2B",u[44]="%2C",u[59]="%3B",u[61]="%3D",u[32]="%20",u);function j(G,I){for(var U=void 0,z=-1,de=0;de<G.length;de++){var ie=G.charCodeAt(de);if(ie>=97&&ie<=122||ie>=65&&ie<=90||ie>=48&&ie<=57||ie===45||ie===46||ie===95||ie===126||I&&ie===47)z!==-1&&(U+=encodeURIComponent(G.substring(z,de)),z=-1),U!==void 0&&(U+=G.charAt(de));else{U===void 0&&(U=G.substr(0,de));var re=k[ie];re!==void 0?(z!==-1&&(U+=encodeURIComponent(G.substring(z,de)),z=-1),U+=re):z===-1&&(z=de)}}return z!==-1&&(U+=encodeURIComponent(G.substring(z))),U!==void 0?U:G}function O(G){for(var I=void 0,U=0;U<G.length;U++){var z=G.charCodeAt(U);z===35||z===63?(I===void 0&&(I=G.substr(0,U)),I+=k[z]):I!==void 0&&(I+=G[U])}return I!==void 0?I:G}function $(G,I){var U;return U=G.authority&&G.path.length>1&&G.scheme==="file"?"//".concat(G.authority).concat(G.path):G.path.charCodeAt(0)===47&&(G.path.charCodeAt(1)>=65&&G.path.charCodeAt(1)<=90||G.path.charCodeAt(1)>=97&&G.path.charCodeAt(1)<=122)&&G.path.charCodeAt(2)===58?I?G.path.substr(1):G.path[1].toLowerCase()+G.path.substr(2):G.path,c.isWindows&&(U=U.replace(/\//g,"\\")),U}function X(G,I){var U=I?O:j,z="",de=G.scheme,ie=G.authority,re=G.path,he=G.query,me=G.fragment;if(de&&(z+=de,z+=":"),(ie||de==="file")&&(z+=g,z+=g),ie){var ze=ie.indexOf("@");if(ze!==-1){var H=ie.substr(0,ze);ie=ie.substr(ze+1),(ze=H.indexOf(":"))===-1?z+=U(H,!1):(z+=U(H.substr(0,ze),!1),z+=":",z+=U(H.substr(ze+1),!1)),z+="@"}(ze=(ie=ie.toLowerCase()).indexOf(":"))===-1?z+=U(ie,!1):(z+=U(ie.substr(0,ze),!1),z+=ie.substr(ze))}if(re){if(re.length>=3&&re.charCodeAt(0)===47&&re.charCodeAt(2)===58)(K=re.charCodeAt(1))>=65&&K<=90&&(re="/".concat(String.fromCharCode(K+32),":").concat(re.substr(3)));else if(re.length>=2&&re.charCodeAt(1)===58){var K;(K=re.charCodeAt(0))>=65&&K<=90&&(re="".concat(String.fromCharCode(K+32),":").concat(re.substr(2)))}z+=U(re,!0)}return he&&(z+="?",z+=U(he,!1)),me&&(z+="#",z+=I?me:j(me,!1)),z}function J(G){try{return decodeURIComponent(G)}catch{return G.length>3?G.substr(0,3)+J(G.substr(3)):G}}o.uriToFsPath=$;var le=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pe(G){return G.match(le)?G.replace(le,function(I){return J(I)}):G}},679:function(i,o,a){var s=this&&this.__spreadArray||function(p,h,d){if(d||arguments.length===2)for(var g,C=0,x=h.length;C<x;C++)!g&&C in h||(g||(g=Array.prototype.slice.call(h,0,C)),g[C]=h[C]);return p.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(o,"__esModule",{value:!0}),o.Utils=void 0;var u,l=a(470),c=l.posix||l,f="/";(u=o.Utils||(o.Utils={})).joinPath=function(p){for(var h=[],d=1;d<arguments.length;d++)h[d-1]=arguments[d];return p.with({path:c.join.apply(c,s([p.path],h,!1))})},u.resolvePath=function(p){for(var h=[],d=1;d<arguments.length;d++)h[d-1]=arguments[d];var g=p.path,C=!1;g[0]!==f&&(g=f+g,C=!0);var x=c.resolve.apply(c,s([g],h,!1));return C&&x[0]===f&&!p.authority&&(x=x.substring(1)),p.with({path:x})},u.dirname=function(p){if(p.path.length===0||p.path===f)return p;var h=c.dirname(p.path);return h.length===1&&h.charCodeAt(0)===46&&(h=""),p.with({path:h})},u.basename=function(p){return c.basename(p.path)},u.extname=function(p){return c.extname(p.path)}}},e={};function r(i){var o=e[i];if(o!==void 0)return o.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,r),a.exports}var n={};return(()=>{var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;var o=r(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return o.URI}});var a=r(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return a.Utils}})})(),n})())});var $c=b(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.NLEmpty=rn.NL=rn.NewLineNode=rn.IndentNode=rn.CompositeGeneratorNode=void 0;var PL=typeof process>"u"?`
3586
3586
  `:process.platform==="win32"?`\r
3587
3587
  `:`
3588
- `,Oc=class{constructor(...e){this.contents=[],this.append(...e)}append(...e){for(let r of e)typeof r=="function"?r(this):this.contents.push(r);return this}indent(e){let r=new Ic;return this.contents.push(r),e&&e(r),this}};rn.CompositeGeneratorNode=Oc;var Ic=class extends Oc{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}};rn.IndentNode=Ic;var ru=class{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??DL,this.ifNotEmpty=r}};rn.NewLineNode=ru;rn.NL=new ru;rn.NLEmpty=new ru(void 0,!0)});var Ym=b(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.processGeneratorNode=void 0;var nu=$c(),Vm=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.lines=[[]],typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}append(e){e.length>0&&this.lines[this.currentLineNumber].push(e)}increaseIndent(e){this.currentIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}resetCurrentLine(){this.lines[this.currentLineNumber]=[]}addNewLine(){this.pendingIndent=!0,this.lines.push([])}};function NL(t,e){let r=new Vm(e);return Jb(t,r),r.content}Mc.processGeneratorNode=NL;function Jb(t,e){typeof t=="string"?OL(t,e):t instanceof nu.IndentNode?IL(t,e):t instanceof nu.CompositeGeneratorNode?tA(t,e):t instanceof nu.NewLineNode&&$L(t,e)}function Qb(t,e){return typeof t=="string"?rA(t):t instanceof nu.CompositeGeneratorNode?t.contents.some(r=>Qb(r,e)):t instanceof nu.NewLineNode?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function OL(t,e){t&&(e.pendingIndent&&eA(e,!1),e.append(t))}function eA(t,e){var r;let n="";for(let i of t.currentIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n),t.pendingIndent=!1}function tA(t,e){for(let r of t.contents)Jb(r,e)}function IL(t,e){var r;if(Qb(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation);try{e.increaseIndent(t),tA(t,e)}finally{e.decreaseIndent()}}}function $L(t,e){t.ifNotEmpty&&!rA(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&eA(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function rA(t){return t.trimStart()!==""}});var so=b(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.collectSuperTypes=St.collectChildrenTypes=St.typePropertyToString=St.distinctAndSorted=St.propertyTypeArrayToString=St.collectAllAstResources=St.collectAllProperties=St.TypeResolutionError=St.InterfaceType=St.UnionType=void 0;var wr=$c(),iA=Ym(),ML=Ie(),LL=tn(),ao=ot(),nA=ir(),Xm=class{constructor(e,r,n){var i;this.superTypes=new Set,this.name=e,this.union=r,this.reflection=(i=n?.reflection)!==null&&i!==void 0?i:!1}toString(){let e=new wr.CompositeGeneratorNode;return e.contents.push(`export type ${this.name} = ${eg(this.union)};`,wr.NL),this.reflection&&sA(this.name,e),(0,iA.processGeneratorNode)(e)}};St.UnionType=Xm;var Zm=class{constructor(e,r,n){this.superTypes=new Set,this.interfaceSuperTypes=[],this.subTypes=new Set,this.containerTypes=new Set,this.name=e,this.superTypes=new Set(r),this.interfaceSuperTypes=[...r],this.properties=n}toString(){let e=new wr.CompositeGeneratorNode,r=this.interfaceSuperTypes.length>0?La([...this.interfaceSuperTypes]):["AstNode"];e.contents.push(`export interface ${this.name} extends ${r.join(", ")} {`,wr.NL);let n=new wr.IndentNode;this.containerTypes.size>0&&n.contents.push(`readonly $container: ${La([...this.containerTypes]).join(" | ")};`,wr.NL);for(let i of La(this.properties,(o,a)=>o.name.localeCompare(a.name))){let o=i.optional&&!i.typeAlternatives.some(s=>s.array)&&!i.typeAlternatives.every(s=>s.types.length===1&&s.types[0]==="boolean")?"?":"",a=eg(i.typeAlternatives);n.contents.push(`${i.name}${o}: ${a}`,wr.NL)}return e.contents.push(n,"}",wr.NL),sA(this.name,e),(0,iA.processGeneratorNode)(e)}};St.InterfaceType=Zm;var Jm=class extends Error{constructor(e,r){super(e),this.name="TypeResolutionError",this.target=r}};St.TypeResolutionError=Jm;function FL(t){let e=new LL.MultiMap;for(let r of t)e.addAll(r.name,r.properties);for(let r of t)for(let n of r.interfaceSuperTypes){let i=e.get(n);i&&e.addAll(r.name,i)}return e}St.collectAllProperties=FL;function oA(t,e,r=new Set,n={parserRules:new Set,datatypeRules:new Set,interfaces:new Set,types:new Set}){for(let i of t){let o=(0,ML.getDocument)(i);if(!r.has(o.uri)){r.add(o.uri);for(let a of i.rules)(0,ao.isParserRule)(a)&&!a.fragment&&((0,nA.isDataTypeRule)(a)?n.datatypeRules.add(a):n.parserRules.add(a));if(i.interfaces.forEach(a=>n.interfaces.add(a)),i.types.forEach(a=>n.types.add(a)),e){let a=i.imports.map(s=>(0,nA.resolveImport)(e,s));oA(a,e,r,n)}}}return n}St.collectAllAstResources=oA;function eg(t){return La(t.map(aA)).join(" | ")}St.propertyTypeArrayToString=eg;function La(t,e){return Array.from(new Set(t)).sort(e)}St.distinctAndSorted=La;function aA(t){let e=La(t.types).join(" | ");return e=t.reference?`Reference<${e}>`:e,e=t.array?`Array<${e}>`:e,e}St.typePropertyToString=aA;function sA(t,e){e.contents.push(wr.NL,`export const ${t} = '${t}';`,wr.NL,wr.NL),e.contents.push(`export function is${t}(item: unknown): item is ${t} {`,wr.NL);let r=new wr.IndentNode;r.contents.push(`return reflection.isInstance(item, ${t});`,wr.NL),e.contents.push(r,"}",wr.NL)}function uA(t,e,r,n){let i=new Set;return i.add(t),e.findReferences(t,{}).forEach(a=>{let s=r.getOrCreateDocument(a.sourceUri),u=n.getAstNode(s,a.sourcePath);(0,ao.isInterface)(u)?(i.add(u),uA(u,e,r,n).forEach(c=>i.add(c))):u&&(0,ao.isType)(u.$container)&&i.add(u.$container)}),i}St.collectChildrenTypes=uA;function Qm(t){let e=new Set;return(0,ao.isInterface)(t)?(e.add(t),t.superTypes.forEach(r=>{if((0,ao.isInterface)(r.ref)){e.add(r.ref);let n=Qm(r.ref);for(let i of n)e.add(i)}})):(0,ao.isType)(t)&&t.typeAlternatives.forEach(r=>{var n;if(!((n=r.refType)===null||n===void 0)&&n.ref&&((0,ao.isInterface)(r.refType.ref)||(0,ao.isType)(r.refType.ref))){let i=Qm(r.refType.ref);for(let o of i)e.add(o)}}),e}St.collectSuperTypes=Qm});var iu=b((lA,Lc)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Lc=="object"&&Lc.exports?Lc.exports=e():t.regexpToAst=e()})(typeof self<"u"?self:lA,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(d){this.idx=d.idx,this.input=d.input,this.groupIdx=d.groupIdx},t.prototype.pattern=function(d){this.idx=0,this.input=d,this.groupIdx=0,this.consumeChar("/");var g=this.disjunction();this.consumeChar("/");for(var C={type:"Flags",loc:{begin:this.idx,end:d.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":a(C,"global");break;case"i":a(C,"ignoreCase");break;case"m":a(C,"multiLine");break;case"u":a(C,"unicode");break;case"y":a(C,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:C,value:g,loc:this.loc(0)}},t.prototype.disjunction=function(){var d=[],g=this.idx;for(d.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),d.push(this.alternative());return{type:"Disjunction",value:d,loc:this.loc(g)}},t.prototype.alternative=function(){for(var d=[],g=this.idx;this.isTerm();)d.push(this.term());return{type:"Alternative",value:d,loc:this.loc(g)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var d=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(d)};case"$":return{type:"EndAnchor",loc:this.loc(d)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(d)};case"B":return{type:"NonWordBoundary",loc:this.loc(d)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var g;switch(this.popChar()){case"=":g="Lookahead";break;case"!":g="NegativeLookahead";break}s(g);var C=this.disjunction();return this.consumeChar(")"),{type:g,value:C,loc:this.loc(d)}}u()},t.prototype.quantifier=function(d){var g,C=this.idx;switch(this.popChar()){case"*":g={atLeast:0,atMost:1/0};break;case"+":g={atLeast:1,atMost:1/0};break;case"?":g={atLeast:0,atMost:1};break;case"{":var x=this.integerIncludingZero();switch(this.popChar()){case"}":g={atLeast:x,atMost:x};break;case",":var T;this.isDigit()?(T=this.integerIncludingZero(),g={atLeast:x,atMost:T}):g={atLeast:x,atMost:1/0},this.consumeChar("}");break}if(d===!0&&g===void 0)return;s(g);break}if(!(d===!0&&g===void 0))return s(g),this.peekChar(0)==="?"?(this.consumeChar("?"),g.greedy=!1):g.greedy=!0,g.type="Quantifier",g.loc=this.loc(C),g},t.prototype.atom=function(){var d,g=this.idx;switch(this.peekChar()){case".":d=this.dotAll();break;case"\\":d=this.atomEscape();break;case"[":d=this.characterClass();break;case"(":d=this.group();break}return d===void 0&&this.isPatternCharacter()&&(d=this.patternCharacter()),s(d),d.loc=this.loc(g),this.isQuantifier()&&(d.quantifier=this.quantifier()),d},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[i(`
3588
+ `,Oc=class{constructor(...e){this.contents=[],this.append(...e)}append(...e){for(let r of e)typeof r=="function"?r(this):this.contents.push(r);return this}indent(e){let r=new Ic;return this.contents.push(r),e&&e(r),this}};rn.CompositeGeneratorNode=Oc;var Ic=class extends Oc{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}};rn.IndentNode=Ic;var ru=class{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??PL,this.ifNotEmpty=r}};rn.NewLineNode=ru;rn.NL=new ru;rn.NLEmpty=new ru(void 0,!0)});var Ym=b(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.processGeneratorNode=void 0;var nu=$c(),Vm=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.lines=[[]],typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}append(e){e.length>0&&this.lines[this.currentLineNumber].push(e)}increaseIndent(e){this.currentIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}resetCurrentLine(){this.lines[this.currentLineNumber]=[]}addNewLine(){this.pendingIndent=!0,this.lines.push([])}};function DL(t,e){let r=new Vm(e);return Jb(t,r),r.content}Mc.processGeneratorNode=DL;function Jb(t,e){typeof t=="string"?NL(t,e):t instanceof nu.IndentNode?OL(t,e):t instanceof nu.CompositeGeneratorNode?tA(t,e):t instanceof nu.NewLineNode&&IL(t,e)}function Qb(t,e){return typeof t=="string"?rA(t):t instanceof nu.CompositeGeneratorNode?t.contents.some(r=>Qb(r,e)):t instanceof nu.NewLineNode?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function NL(t,e){t&&(e.pendingIndent&&eA(e,!1),e.append(t))}function eA(t,e){var r;let n="";for(let i of t.currentIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n),t.pendingIndent=!1}function tA(t,e){for(let r of t.contents)Jb(r,e)}function OL(t,e){var r;if(Qb(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation);try{e.increaseIndent(t),tA(t,e)}finally{e.decreaseIndent()}}}function IL(t,e){t.ifNotEmpty&&!rA(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&eA(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function rA(t){return t.trimStart()!==""}});var so=b(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.collectSuperTypes=St.collectChildrenTypes=St.typePropertyToString=St.distinctAndSorted=St.propertyTypeArrayToString=St.collectAllAstResources=St.collectAllProperties=St.TypeResolutionError=St.InterfaceType=St.UnionType=void 0;var wr=$c(),iA=Ym(),$L=Ie(),ML=tn(),ao=ot(),nA=ir(),Xm=class{constructor(e,r,n){var i;this.superTypes=new Set,this.name=e,this.union=r,this.reflection=(i=n?.reflection)!==null&&i!==void 0?i:!1}toString(){let e=new wr.CompositeGeneratorNode;return e.contents.push(`export type ${this.name} = ${eg(this.union)};`,wr.NL),this.reflection&&sA(this.name,e),(0,iA.processGeneratorNode)(e)}};St.UnionType=Xm;var Zm=class{constructor(e,r,n){this.superTypes=new Set,this.interfaceSuperTypes=[],this.subTypes=new Set,this.containerTypes=new Set,this.name=e,this.superTypes=new Set(r),this.interfaceSuperTypes=[...r],this.properties=n}toString(){let e=new wr.CompositeGeneratorNode,r=this.interfaceSuperTypes.length>0?La([...this.interfaceSuperTypes]):["AstNode"];e.contents.push(`export interface ${this.name} extends ${r.join(", ")} {`,wr.NL);let n=new wr.IndentNode;this.containerTypes.size>0&&n.contents.push(`readonly $container: ${La([...this.containerTypes]).join(" | ")};`,wr.NL);for(let i of La(this.properties,(o,a)=>o.name.localeCompare(a.name))){let o=i.optional&&!i.typeAlternatives.some(s=>s.array)&&!i.typeAlternatives.every(s=>s.types.length===1&&s.types[0]==="boolean")?"?":"",a=eg(i.typeAlternatives);n.contents.push(`${i.name}${o}: ${a}`,wr.NL)}return e.contents.push(n,"}",wr.NL),sA(this.name,e),(0,iA.processGeneratorNode)(e)}};St.InterfaceType=Zm;var Jm=class extends Error{constructor(e,r){super(e),this.name="TypeResolutionError",this.target=r}};St.TypeResolutionError=Jm;function LL(t){let e=new ML.MultiMap;for(let r of t)e.addAll(r.name,r.properties);for(let r of t)for(let n of r.interfaceSuperTypes){let i=e.get(n);i&&e.addAll(r.name,i)}return e}St.collectAllProperties=LL;function oA(t,e,r=new Set,n={parserRules:new Set,datatypeRules:new Set,interfaces:new Set,types:new Set}){for(let i of t){let o=(0,$L.getDocument)(i);if(!r.has(o.uri)){r.add(o.uri);for(let a of i.rules)(0,ao.isParserRule)(a)&&!a.fragment&&((0,nA.isDataTypeRule)(a)?n.datatypeRules.add(a):n.parserRules.add(a));if(i.interfaces.forEach(a=>n.interfaces.add(a)),i.types.forEach(a=>n.types.add(a)),e){let a=i.imports.map(s=>(0,nA.resolveImport)(e,s));oA(a,e,r,n)}}}return n}St.collectAllAstResources=oA;function eg(t){return La(t.map(aA)).join(" | ")}St.propertyTypeArrayToString=eg;function La(t,e){return Array.from(new Set(t)).sort(e)}St.distinctAndSorted=La;function aA(t){let e=La(t.types).join(" | ");return e=t.reference?`Reference<${e}>`:e,e=t.array?`Array<${e}>`:e,e}St.typePropertyToString=aA;function sA(t,e){e.contents.push(wr.NL,`export const ${t} = '${t}';`,wr.NL,wr.NL),e.contents.push(`export function is${t}(item: unknown): item is ${t} {`,wr.NL);let r=new wr.IndentNode;r.contents.push(`return reflection.isInstance(item, ${t});`,wr.NL),e.contents.push(r,"}",wr.NL)}function uA(t,e,r,n){let i=new Set;return i.add(t),e.findReferences(t,{}).forEach(a=>{let s=r.getOrCreateDocument(a.sourceUri),u=n.getAstNode(s,a.sourcePath);(0,ao.isInterface)(u)?(i.add(u),uA(u,e,r,n).forEach(c=>i.add(c))):u&&(0,ao.isType)(u.$container)&&i.add(u.$container)}),i}St.collectChildrenTypes=uA;function Qm(t){let e=new Set;return(0,ao.isInterface)(t)?(e.add(t),t.superTypes.forEach(r=>{if((0,ao.isInterface)(r.ref)){e.add(r.ref);let n=Qm(r.ref);for(let i of n)e.add(i)}})):(0,ao.isType)(t)&&t.typeAlternatives.forEach(r=>{var n;if(!((n=r.refType)===null||n===void 0)&&n.ref&&((0,ao.isInterface)(r.refType.ref)||(0,ao.isType)(r.refType.ref))){let i=Qm(r.refType.ref);for(let o of i)e.add(o)}}),e}St.collectSuperTypes=Qm});var iu=b((lA,Lc)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Lc=="object"&&Lc.exports?Lc.exports=e():t.regexpToAst=e()})(typeof self<"u"?self:lA,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(d){this.idx=d.idx,this.input=d.input,this.groupIdx=d.groupIdx},t.prototype.pattern=function(d){this.idx=0,this.input=d,this.groupIdx=0,this.consumeChar("/");var g=this.disjunction();this.consumeChar("/");for(var C={type:"Flags",loc:{begin:this.idx,end:d.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":a(C,"global");break;case"i":a(C,"ignoreCase");break;case"m":a(C,"multiLine");break;case"u":a(C,"unicode");break;case"y":a(C,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:C,value:g,loc:this.loc(0)}},t.prototype.disjunction=function(){var d=[],g=this.idx;for(d.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),d.push(this.alternative());return{type:"Disjunction",value:d,loc:this.loc(g)}},t.prototype.alternative=function(){for(var d=[],g=this.idx;this.isTerm();)d.push(this.term());return{type:"Alternative",value:d,loc:this.loc(g)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var d=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(d)};case"$":return{type:"EndAnchor",loc:this.loc(d)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(d)};case"B":return{type:"NonWordBoundary",loc:this.loc(d)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var g;switch(this.popChar()){case"=":g="Lookahead";break;case"!":g="NegativeLookahead";break}s(g);var C=this.disjunction();return this.consumeChar(")"),{type:g,value:C,loc:this.loc(d)}}u()},t.prototype.quantifier=function(d){var g,C=this.idx;switch(this.popChar()){case"*":g={atLeast:0,atMost:1/0};break;case"+":g={atLeast:1,atMost:1/0};break;case"?":g={atLeast:0,atMost:1};break;case"{":var x=this.integerIncludingZero();switch(this.popChar()){case"}":g={atLeast:x,atMost:x};break;case",":var T;this.isDigit()?(T=this.integerIncludingZero(),g={atLeast:x,atMost:T}):g={atLeast:x,atMost:1/0},this.consumeChar("}");break}if(d===!0&&g===void 0)return;s(g);break}if(!(d===!0&&g===void 0))return s(g),this.peekChar(0)==="?"?(this.consumeChar("?"),g.greedy=!1):g.greedy=!0,g.type="Quantifier",g.loc=this.loc(C),g},t.prototype.atom=function(){var d,g=this.idx;switch(this.peekChar()){case".":d=this.dotAll();break;case"\\":d=this.atomEscape();break;case"[":d=this.characterClass();break;case"(":d=this.group();break}return d===void 0&&this.isPatternCharacter()&&(d=this.patternCharacter()),s(d),d.loc=this.loc(g),this.isQuantifier()&&(d.quantifier=this.quantifier()),d},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[i(`
3589
3589
  `),i("\r"),i("\u2028"),i("\u2029")]}},t.prototype.atomEscape=function(){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()}},t.prototype.decimalEscapeAtom=function(){var d=this.positiveInteger();return{type:"GroupBackReference",value:d}},t.prototype.characterClassEscape=function(){var d,g=!1;switch(this.popChar()){case"d":d=c;break;case"D":d=c,g=!0;break;case"s":d=p;break;case"S":d=p,g=!0;break;case"w":d=f;break;case"W":d=f,g=!0;break}return s(d),{type:"Set",value:d,complement:g}},t.prototype.controlEscapeAtom=function(){var d;switch(this.popChar()){case"f":d=i("\f");break;case"n":d=i(`
3590
3590
  `);break;case"r":d=i("\r");break;case"t":d=i(" ");break;case"v":d=i("\v");break}return s(d),{type:"Character",value:d}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var d=this.popChar();if(/[a-zA-Z]/.test(d)===!1)throw Error("Invalid ");var g=d.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:g}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:i("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var d=this.popChar();return{type:"Character",value:i(d)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
3591
3591
  `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var d=this.popChar();return{type:"Character",value:i(d)}}},t.prototype.characterClass=function(){var d=[],g=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),g=!0);this.isClassAtom();){var C=this.classAtom(),x=C.type==="Character";if(x&&this.isRangeDash()){this.consumeChar("-");var T=this.classAtom(),v=T.type==="Character";if(v){if(T.value<C.value)throw Error("Range out of order in character class");d.push({from:C.value,to:T.value})}else o(C.value,d),d.push(i("-")),o(T.value,d)}else o(C.value,d)}return this.consumeChar("]"),{type:"Set",complement:g,value:d}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
@@ -3595,16 +3595,16 @@ ${JSON.stringify(w,null,4)}`);let F=w;if(Ht.string(F.id)||Ht.number(F.id)){let W
3595
3595
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(d){for(var g="",C=0;C<d;C++){var x=this.popChar();if(e.test(x)===!1)throw Error("Expecting a HexDecimal digits");g+=x}var T=parseInt(g,16);return{type:"Character",value:T}},t.prototype.peekChar=function(d){return d===void 0&&(d=0),this.input[this.idx+d]},t.prototype.popChar=function(){var d=this.peekChar(0);return this.consumeChar(),d},t.prototype.consumeChar=function(d){if(d!==void 0&&this.input[this.idx]!==d)throw Error("Expected: '"+d+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(d){return{begin:d,end:this.idx}};var e=/[0-9a-fA-F]/,r=/[0-9]/,n=/[1-9]/;function i(d){return d.charCodeAt(0)}function o(d,g){d.length!==void 0?d.forEach(function(C){g.push(C)}):g.push(d)}function a(d,g){if(d[g]===!0)throw"duplicate flag "+g;d[g]=!0}function s(d){if(d===void 0)throw Error("Internal Error - Should never get here!")}function u(){throw Error("Internal Error - Should never get here!")}var l,c=[];for(l=i("0");l<=i("9");l++)c.push(l);var f=[i("_")].concat(c);for(l=i("a");l<=i("z");l++)f.push(l);for(l=i("A");l<=i("Z");l++)f.push(l);var p=[i(" "),i("\f"),i(`
3596
3596
  `),i("\r"),i(" "),i("\v"),i(" "),i("\xA0"),i("\u1680"),i("\u2000"),i("\u2001"),i("\u2002"),i("\u2003"),i("\u2004"),i("\u2005"),i("\u2006"),i("\u2007"),i("\u2008"),i("\u2009"),i("\u200A"),i("\u2028"),i("\u2029"),i("\u202F"),i("\u205F"),i("\u3000"),i("\uFEFF")];function h(){}return h.prototype.visitChildren=function(d){for(var g in d){var C=d[g];d.hasOwnProperty(g)&&(C.type!==void 0?this.visit(C):Array.isArray(C)&&C.forEach(function(x){this.visit(x)},this))}},h.prototype.visit=function(d){switch(d.type){case"Pattern":this.visitPattern(d);break;case"Flags":this.visitFlags(d);break;case"Disjunction":this.visitDisjunction(d);break;case"Alternative":this.visitAlternative(d);break;case"StartAnchor":this.visitStartAnchor(d);break;case"EndAnchor":this.visitEndAnchor(d);break;case"WordBoundary":this.visitWordBoundary(d);break;case"NonWordBoundary":this.visitNonWordBoundary(d);break;case"Lookahead":this.visitLookahead(d);break;case"NegativeLookahead":this.visitNegativeLookahead(d);break;case"Character":this.visitCharacter(d);break;case"Set":this.visitSet(d);break;case"Group":this.visitGroup(d);break;case"GroupBackReference":this.visitGroupBackReference(d);break;case"Quantifier":this.visitQuantifier(d);break}this.visitChildren(d)},h.prototype.visitPattern=function(d){},h.prototype.visitFlags=function(d){},h.prototype.visitDisjunction=function(d){},h.prototype.visitAlternative=function(d){},h.prototype.visitStartAnchor=function(d){},h.prototype.visitEndAnchor=function(d){},h.prototype.visitWordBoundary=function(d){},h.prototype.visitNonWordBoundary=function(d){},h.prototype.visitLookahead=function(d){},h.prototype.visitNegativeLookahead=function(d){},h.prototype.visitCharacter=function(d){},h.prototype.visitSet=function(d){},h.prototype.visitGroup=function(d){},h.prototype.visitGroupBackReference=function(d){},h.prototype.visitQuantifier=function(d){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var Fa=b(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.partialRegex=hr.partialMatches=hr.getCaseInsensitivePattern=hr.escapeRegExp=hr.isWhitespaceRegExp=hr.isMultilineComment=hr.getTerminalParts=void 0;var cA=iu(),fA=new cA.RegExpParser,tg=class extends cA.BaseRegExpVisitor{constructor(){super(...arguments),this.isStarting=!0,this.endRegexStack=[],this.multiline=!1}get endRegex(){return this.endRegexStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegex="",this.isStarting=!0,this.endRegexStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
3597
3597
  `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let n=rg(r);this.endRegexStack.push(n),this.isStarting&&(this.startRegex+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
3598
- `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexStack.push(r),this.isStarting&&(this.startRegex+=r)}}},qo=new tg;function qL(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=fA.pattern(t),r=[];for(let n of e.value.value)qo.reset(t),qo.visit(n),r.push({start:qo.startRegex,end:qo.endRegex});return r}catch{return[]}}hr.getTerminalParts=qL;function jL(t){try{return typeof t!="string"&&(t=t.source),t=`/${t}/`,qo.reset(t),qo.visit(fA.pattern(t)),qo.multiline}catch{return!1}}hr.isMultilineComment=jL;function GL(t){return(typeof t=="string"?new RegExp(t):t).test(" ")}hr.isWhitespaceRegExp=GL;function rg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}hr.escapeRegExp=rg;function UL(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:rg(e)).join("")}hr.getCaseInsensitivePattern=UL;function HL(t,e){let r=dA(t),n=e.match(r);return!!n&&n[0].length>0}hr.partialMatches=HL;function dA(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",a;function s(l){o+=r.substr(n,l),n+=l}function u(l){o+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?r[n+2]==="{"?u(r.indexOf("}",n)-n+1):u(6):u(2);break;case"p":case"P":e.unicode?u(r.indexOf("}",n)-n+1):u(2);break;case"k":u(r.indexOf(">",n)-n+1);break;default:u(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],u(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?s(a[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":a=n,n+=3,i(),o+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),o+=r.substr(a,n-a);break;default:s(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else s(1),o+=i()+"|$)";break;case")":return++n,o;default:u(1);break}return o}return new RegExp(i(),t.flags)}hr.partialRegex=dA});var ir=b(ve=>{"use strict";var BL=ve&&ve.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WL=ve&&ve.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KL=ve&&ve.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&BL(e,t,r);return WL(e,t),e};Object.defineProperty(ve,"__esModule",{value:!0});ve.extractAssignments=ve.processActionNodeWithNodeDescriptionProvider=ve.processTypeNodeWithNodeLocator=ve.prepareGrammar=ve.resolveTransitiveImports=ve.resolveImport=ve.terminalRegex=ve.getRuleType=ve.getExplicitRuleType=ve.getTypeName=ve.getActionAtElement=ve.isDataTypeRule=ve.isArrayOperator=ve.isArrayCardinality=ve.isOptionalCardinality=void 0;var xe=KL(ot()),ig=$n(),jo=Ie(),zL=tn(),VL=so(),YL=Fa();function XL(t){return t==="?"||t==="*"}ve.isOptionalCardinality=XL;function ZL(t){return t==="*"||t==="+"}ve.isArrayCardinality=ZL;function JL(t){return t==="+="}ve.isArrayOperator=JL;function ag(t){return pA(t,new Set)}ve.isDataTypeRule=ag;function pA(t,e){if(e.has(t))return!0;e.add(t);for(let r of(0,jo.streamAllContents)(t))if(xe.isRuleCall(r)&&xe.isParserRule(r.rule.ref)){if(!pA(r.rule.ref,e))return!1}else{if(xe.isAssignment(r))return!1;if(xe.isAction(r))return!1}return!0}function hA(t){let e=t.$container;if(xe.isGroup(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(xe.isAction(o))return o;{let a=(0,jo.streamAllContents)(r[i]).find(xe.isAction);if(a)return a}}}if(xe.isAbstractElement(e))return hA(e)}ve.getActionAtElement=hA;function mA(t){var e;if(xe.isParserRule(t))return ag(t)?t.name:(e=sg(t))!==null&&e!==void 0?e:t.name;if(xe.isInterface(t)||xe.isType(t)||xe.isReturnType(t))return t.name;if(xe.isAction(t)){let r=gA(t);if(r)return r}else if(xe.isInferredType(t))return t.name;throw new VL.TypeResolutionError("Cannot get name of Unknown Type",t.$cstNode)}ve.getTypeName=mA;function sg(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e){if(xe.isParserRule(e))return e.name;if(xe.isInterface(e)||xe.isType(e))return e.name}}}ve.getExplicitRuleType=sg;function gA(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return mA(t.type.ref)}function QL(t){var e,r,n;return xe.isTerminalRule(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":ag(t)?t.name:(n=sg(t))!==null&&n!==void 0?n:t.name}ve.getRuleType=QL;function yA(t){return ou(t.definition)}ve.terminalRegex=yA;var ug=/[\s\S]/.source;function ou(t){if(xe.isTerminalAlternatives(t))return eF(t);if(xe.isTerminalGroup(t))return tF(t);if(xe.isCharacterRange(t))return iF(t);if(xe.isTerminalRuleCall(t)){let e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return Oi(yA(e),t.cardinality)}else{if(xe.isNegatedToken(t))return nF(t);if(xe.isUntilToken(t))return rF(t);if(xe.isRegexToken(t))return Oi(t.regex,t.cardinality,!1);if(xe.isWildcard(t))return Oi(ug,t.cardinality);throw new Error("Invalid terminal element.")}}function eF(t){return Oi(t.elements.map(ou).join("|"),t.cardinality)}function tF(t){return Oi(t.elements.map(ou).join(""),t.cardinality)}function rF(t){return Oi(`${ug}*?${ou(t.terminal)}`,t.cardinality)}function nF(t){return Oi(`(?!${ou(t.terminal)})${ug}*?`,t.cardinality)}function iF(t){return t.right?Oi(`[${ng(t.left)}-${ng(t.right)}]`,t.cardinality,!1):Oi(ng(t.left),t.cardinality,!1)}function ng(t){return(0,YL.escapeRegExp)(t.value)}function Oi(t,e,r=!0){return r&&(t=`(${t})`),e?`${t}${e}`:t}function lg(t,e){if(e.path===void 0||e.path.length===0)return;let r=ig.Utils.dirname((0,jo.getDocument)(e).uri),n=e.path;n.endsWith(".langium")||(n+=".langium");let i=ig.Utils.resolvePath(r,n);try{let a=t.getOrCreateDocument(i).parseResult.value;if(xe.isGrammar(a))return a}catch{}}ve.resolveImport=lg;function oF(t,e){if(xe.isGrammarImport(e)){let r=lg(t,e);if(r){let n=og(t,r);return n.push(r),n}return[]}else return og(t,e)}ve.resolveTransitiveImports=oF;function og(t,e,r=e,n=new Set,i=new Set){let o=(0,jo.getDocument)(e);if(r!==e&&i.add(e),!n.has(o.uri)){n.add(o.uri);for(let a of e.imports){let s=lg(t,a);s&&og(t,s,r,n,i)}}return Array.from(i)}function aF(t,e){let r=e,n=t.shared.workspace.LangiumDocumentFactory.fromModel(e,ig.URI.parse("memory://grammar.langium"));return r.$document=n,n.precomputedScopes=sF(t,e),e}ve.prepareGrammar=aF;function sF(t,e){let r=t.references.NameProvider,n=t.workspace.AstNodeDescriptionProvider,i=(0,jo.getDocument)(e),o=new zL.MultiMap,a=vA(t.workspace.AstNodeLocator),s=_A(n);for(let u of(0,jo.streamAllContents)(e)){if(xe.isReturnType(u))continue;s(u,i,o),a(u,i,o);let l=u.$container;if(l){let c=r.getName(u);c&&o.add(l,n.createDescription(u,c,i))}}return o}function vA(t){return(e,r,n)=>{var i;let o=e.$container;if(o&&xe.isParserRule(e)&&!e.returnType&&!e.dataType){let a=(i=e.inferredType)!==null&&i!==void 0?i:e;n.add(o,{node:a,name:a.name,type:"Interface",documentUri:r.uri,path:t.getAstNodePath(a)})}}}ve.processTypeNodeWithNodeLocator=vA;function _A(t){return(e,r,n)=>{let i=(0,jo.findRootNode)(e);if(i&&xe.isAction(e)&&e.inferredType){let o=gA(e);o&&n.add(i,t.createDescription(e,o,r))}}}ve.processActionNodeWithNodeDescriptionProvider=_A;function TA(t){return xe.isAssignment(t)?[t]:xe.isAlternatives(t)||xe.isGroup(t)||xe.isUnorderedGroup(t)?t.elements.flatMap(e=>TA(e)):[]}ve.extractAssignments=TA});var AA=b(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.LangiumGrammarScopeComputation=qa.LangiumGrammarScopeProvider=void 0;var uF=Pc(),lF=Nc(),RA=Ie(),cF=Bt(),fF=ot(),bA=ir(),cg=class extends lF.DefaultScopeProvider{constructor(e){super(e)}getScope(e){let r=this.reflection.getReferenceType(e);if(r!=="AbstractType")return super.getScope(e);let n=[],i=(0,RA.getDocument)(e.container).precomputedScopes,o=(0,RA.findRootNode)(e.container);if(i&&o){let s=i.get(o),u=[],l=[];if(s.length>0){for(let c of s)this.reflection.isSubtype(c.type,"ParserRule")?u.push(c):this.reflection.isSubtype(c.type,r)&&l.push(c);n.push((0,cF.stream)(l.concat(u.filter(c=>!l.some(f=>f.name===c.name)))))}}let a=this.getGlobalScope(r);for(let s=n.length-1;s>=0;s--)a=this.createScope(n[s],a);return a}};qa.LangiumGrammarScopeProvider=cg;var fg=class extends uF.DefaultScopeComputation{constructor(e){super(e),this.processTypeNode=(0,bA.processTypeNodeWithNodeLocator)(e.workspace.AstNodeLocator),this.processActionNode=(0,bA.processActionNodeWithNodeDescriptionProvider)(e.workspace.AstNodeDescriptionProvider)}processNode(e,r,n){(0,fF.isReturnType)(e)||(this.processTypeNode(e,r,n),this.processActionNode(e,r,n),super.processNode(e,r,n))}};qa.LangiumGrammarScopeComputation=fg});var uo=b(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.relativeURI=ja.equalURI=void 0;function dF(t,e){return t?.toString()===e?.toString()}ja.equalURI=dF;function pF(t,e){let r=t.path,n=e.path,i=r.split("/").filter(l=>l.length>0),o=n.split("/").filter(l=>l.length>0),a=0;for(;a<i.length&&i[a]===o[a];a++);let s="../".repeat(i.length-a),u=o.slice(a).join("/");return s+u}ja.relativeURI=pF});var qc=b(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ValidationRegistry=void 0;var hF=tn(),mF=In(),dg=class{constructor(e){this.validationChecks=new hF.MultiMap,this.reflection=e.shared.AstReflection}register(e,r=this){for(let[n,i]of Object.entries(e))if(Array.isArray(i))for(let o of i)this.doRegister(n,this.wrapValidationException(o,r));else i&&this.doRegister(n,this.wrapValidationException(i,r))}wrapValidationException(e,r){return async(n,i,o)=>{try{await e.call(r,n,i,o)}catch(a){if((0,mF.isOperationCancelled)(a))throw a;console.error("An error occurred during validation:",a);let s=a instanceof Error?a.message:String(a);a instanceof Error&&a.stack&&console.error(a.stack),i("error","An error occurred during validation: "+s,{node:n})}}}doRegister(e,r){for(let n of this.reflection.getAllTypes())this.reflection.isSubtype(n,e)&&this.validationChecks.add(n,r)}getChecks(e){return this.validationChecks.get(e)}};Fc.ValidationRegistry=dg});var hg=b(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.collectDeclaredTypes=void 0;var pg=ir(),EA=so(),gF=tn();function yF(t,e,r){var n;function i(s,u){var l;let c=(l=u.unions.find(f=>f.name===s))!==null&&l!==void 0?l:u.interfaces.find(f=>f.name===s);c&&a.get(s).forEach(f=>c.superTypes.add(f))}let o={unions:[],interfaces:[]};for(let s of t){let u=s.superTypes.filter(c=>c.ref).map(c=>(0,pg.getTypeName)(c.ref)),l=s.attributes.map(c=>({name:c.name,optional:c.isOptional===!0,typeAlternatives:c.typeAlternatives.map(CA)}));o.interfaces.push(new EA.InterfaceType(s.name,u,l))}let a=new gF.MultiMap;for(let s of e){let u=s.typeAlternatives.map(CA),l=s.typeAlternatives.length>1&&s.typeAlternatives.some(c=>{var f;return((f=c.refType)===null||f===void 0?void 0:f.ref)!==void 0});if(o.unions.push(new EA.UnionType(s.name,u,{reflection:l})),l)for(let c of s.typeAlternatives)!((n=c.refType)===null||n===void 0)&&n.ref&&a.add((0,pg.getTypeName)(c.refType.ref),s.name)}for(let s of a.keys())i(s,r),i(s,o);return o}jc.collectDeclaredTypes=yF;function CA(t){var e,r;let n=[];return t.refType?n=[t.refType.ref?(0,pg.getTypeName)(t.refType.ref):t.refType.$refText]:n=[(e=t.primitiveType)!==null&&e!==void 0?e:`'${(r=t.keywordType)===null||r===void 0?void 0:r.value}'`],{types:n,reference:t.isRef===!0,array:t.isArray===!0}}});var Ua=b(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.DefaultNameProvider=Ga.isNamed=void 0;var vF=Wt();function xA(t){return typeof t.name=="string"}Ga.isNamed=xA;var mg=class{getName(e){if(xA(e))return e.name}getNameNode(e){return(0,vF.findNodeForProperty)(e.$cstNode,"name")}};Ga.DefaultNameProvider=mg});var _g=b(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.collectInferredTypes=void 0;var Vt=ot(),_F=Ua(),TF=Bt(),Ha=so(),SA=tn(),Ii=ir();function wA(t){return JSON.parse(JSON.stringify(t))}function gg(t,e,r){if(e.ruleCalls.length>0){for(let n of e.ruleCalls)r.add(n);return}for(let n of e.parents)t.name===void 0?gg(n,n,r):n.name!==void 0&&n.name!==t.name?r.add(n.name):gg(t,n,r);e.parents.length===0&&e.name&&r.add(e.name)}var yg=class{constructor(e,r){this.context=e,this.root=r}getTypes(){let e={name:this.root.name,properties:this.root.properties,ruleCalls:this.root.ruleCalls,super:[]};return this.root.children.length===0?[e]:this.applyNext(this.root,{alt:e,next:this.root.children}).map(r=>r.alt)}applyNext(e,r){let n=this.splitType(r.alt,r.next.length),i=[];for(let o=0;o<r.next.length;o++){let a=n[o],s=r.next[o];if(s.declaredType)continue;s.actionWithAssignment&&i.push({alt:wA(a),next:[]}),s.name!==void 0&&s.name!==a.name&&(s.actionWithAssignment?(a.properties=[],a.ruleCalls=[],a.super=[e.name],a.name=s.name):(a.super=[a.name],a.name=s.name)),a.properties.push(...s.properties),a.ruleCalls.push(...s.ruleCalls);let u={alt:a,next:s.children};u.next.length===0?(u.alt.super=u.alt.super.filter(l=>l!==u.alt.name),i.push(u)):i.push(...this.applyNext(e,u))}return i}splitType(e,r){let n=[];for(let i=0;i<r;i++)n.push(wA(e));return n}getSuperTypes(e){let r=new Set;return gg(e,e,r),Array.from(r).sort()}connect(e,r){return r.parents.push(e),e.children.push(r),r}merge(...e){if(e.length===1)return e[0];if(e.length===0)return;let r=au();r.parents=e;for(let n of e)n.children.push(r);return r}};function RF(t,e){var r;let n=[],i={fragments:new Map};for(let u of t)n.push(...kA(i,u));let o=DA(n);NF(o);let a=bF(o),s=$F(o,a);for(let u of e){let l=(0,Vt.isAlternatives)(u.definition)&&u.definition.elements.every(c=>(0,Vt.isKeyword)(c))?(0,TF.stream)(u.definition.elements).filter(Vt.isKeyword).map(c=>`'${c.value}'`).toArray().sort():[(r=(0,Ii.getExplicitRuleType)(u))!==null&&r!==void 0?r:"string"];s.unions.push(new Ha.UnionType(u.name,su(!1,!1,l)))}return s}Gc.collectInferredTypes=RF;function bF(t){let e=[],r=new SA.MultiMap;for(let n of t)for(let i of n.superTypes)r.add(i,n.name);for(let[n,i]of r.entriesGroupedByKey())t.some(o=>o.name===n)||e.push(new Ha.UnionType(n,su(!1,!1,i),{reflection:!0}));return e}function kA(t,e){let r=au(e),n=new yg(t,r);return vg(n,n.root,e.definition),n.getTypes()}function au(t){return{name:(0,Vt.isParserRule)(t)?(0,Ii.getTypeName)(t):t,properties:[],ruleCalls:[],children:[],parents:[],actionWithAssignment:!1}}function vg(t,e,r){let n=(0,Ii.isOptionalCardinality)(r.cardinality);if((0,Vt.isAlternatives)(r)){let i=[];n&&i.push(e);for(let o of r.elements){let a=t.connect(e,au());i.push(vg(t,a,o))}return t.merge(...i)}else if((0,Vt.isGroup)(r)||(0,Vt.isUnorderedGroup)(r)){let i=n?t.connect(e,au()):e;for(let o of r.elements)i=vg(t,i,o);return n?t.merge(e,i):i}else{if((0,Vt.isAction)(r))return AF(t,e,r);(0,Vt.isAssignment)(r)?EF(e,r):(0,Vt.isRuleCall)(r)&&xF(t,e,r)}return e}function AF(t,e,r){var n,i;let o=t.connect(e,au((n=r.inferredType)===null||n===void 0?void 0:n.name));if(r.type){o.declaredType=!0;let a=(i=r.type)===null||i===void 0?void 0:i.ref;a&&(0,_F.isNamed)(a)&&(o.name=a.name)}return r.feature&&r.operator&&(o.actionWithAssignment=!0,o.properties.push({name:r.feature,optional:!1,typeAlternatives:su(r.operator==="+=",!1,t.root.ruleCalls.length!==0?t.root.ruleCalls:t.getSuperTypes(o))})),o}function EF(t,e){let r={types:new Set,reference:!1};PA(e.terminal,r);let n=su(e.operator==="+=",r.reference,e.operator==="?="?["boolean"]:Array.from(r.types));t.properties.push({name:e.feature,optional:(0,Ii.isOptionalCardinality)(e.cardinality),typeAlternatives:n})}function PA(t,e){(0,Vt.isAlternatives)(t)||(0,Vt.isUnorderedGroup)(t)||(0,Vt.isGroup)(t)?CF(t,e):(0,Vt.isKeyword)(t)?e.types.add(`'${t.value}'`):(0,Vt.isRuleCall)(t)&&t.rule.ref?e.types.add((0,Ii.getRuleType)(t.rule.ref)):(0,Vt.isCrossReference)(t)&&t.type.ref&&(e.types.add((0,Ii.getTypeName)(t.type.ref)),e.reference=!0)}function CF(t,e){for(let r of t.elements)PA(r,e)}function xF(t,e,r){let n=r.rule.ref;if((0,Vt.isParserRule)(n)&&n.fragment){let i=wF(n,t.context);(0,Ii.isOptionalCardinality)(r.cardinality)?e.properties.push(...i.map(o=>Object.assign(Object.assign({},o),{optional:!0}))):e.properties.push(...i)}else(0,Vt.isParserRule)(n)&&e.ruleCalls.push((0,Ii.getRuleType)(n))}function wF(t,e){let r=e.fragments.get(t);if(r)return r;let n=[];e.fragments.set(t,n);let i=(0,Ii.getTypeName)(t),o=kA(e,t),s=DA(o).find(u=>u.name===i);return s&&n.push(...s.properties),n}function DA(t){let e=new Map,r=[],n=SF(t);for(let i of n){let o=new Ha.InterfaceType(i.name,i.super,i.properties);e.set(o.name,o),i.ruleCalls.length>0&&(r.push(i),i.ruleCalls.forEach(a=>{a!==o.name&&o.subTypes.add(a)}))}for(let i of r)for(let o of i.ruleCalls){let a=e.get(o);a&&a.name!==i.name&&a.superTypes.add(i.name)}return Array.from(e.values())}function SF(t){let e=t.reduce((n,i)=>n.add(i.name,i),new SA.MultiMap),r=[];for(let[n,i]of e.entriesGroupedByKey()){let o=[],a=new Set,s={name:n,properties:o,ruleCalls:[],super:[]};for(let u of i){s.super.push(...u.super);let l=u.properties,c=new Set;for(let f of l){c.add(f.name);let p=o.find(h=>h.name===f.name);p?f.typeAlternatives.filter(kF(p.typeAlternatives)).forEach(h=>p.typeAlternatives.push(h)):o.push(Object.assign({},f))}l.length===0&&u.ruleCalls.forEach(f=>a.add(f))}for(let u of i)if(u.ruleCalls.length===0)for(let l of o)u.properties.find(c=>c.name===l.name)||(l.optional=!0);s.ruleCalls=Array.from(a),r.push(s)}return r}function kF(t){return e=>!t.some(r=>PF(r,e))}function PF(t,e){return t.array===e.array&&t.reference===e.reference&&DF(t.types,e.types)}function DF(t,e,r=(n,i)=>n===i){let n=(0,Ha.distinctAndSorted)(t),i=(0,Ha.distinctAndSorted)(e);return n.length!==i.length?!1:i.every((o,a)=>r(o,n[a]))}function NF(t){var e,r;for(let i of t){for(let o of i.properties.flatMap(a=>a.typeAlternatives.filter(s=>!s.reference).flatMap(s=>s.types)))(e=t.find(a=>a.name===o))===null||e===void 0||e.containerTypes.add(i.name);for(let o of i.superTypes)(r=t.find(a=>a.name===o))===null||r===void 0||r.subTypes.add(i.name)}let n=[];OF(n,t),IF(n)}function OF(t,e){function r(i){let o=[i];n.add(i.name);let a=[...i.subTypes,...i.superTypes];for(let s of a)if(!n.has(s)){let u=e.find(l=>l.name===s);u&&o.push(...r(u))}return o}let n=new Set;for(let i of e)n.has(i.name)||t.push(r(i))}function IF(t){for(let e of t){let r=new Set;e.forEach(n=>n.containerTypes.forEach(i=>r.add(i))),e.forEach(n=>n.containerTypes=r)}}function $F(t,e){let r={interfaces:[],unions:e},n=new Set(e.map(i=>i.name));for(let i of t)if(i.properties.length===0&&i.subTypes.size>0){let o=su(!1,!1,Array.from(i.subTypes)),a=e.find(s=>s.name===i.name);if(a)a.union.push(...o);else{let s=new Ha.UnionType(i.name,o,{reflection:!0});s.superTypes=i.superTypes,r.unions.push(s),n.add(i.name)}}else r.interfaces.push(i);for(let i of r.interfaces)i.interfaceSuperTypes=[...i.superTypes].filter(o=>!n.has(o)).sort();return r}function su(t,e,r){return t||e?[{array:t,reference:e,types:r}]:r.map(n=>({array:t,reference:e,types:[n]}))}});var jA=b(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.collectAllInterfaces=ai.collectValidationResources=ai.applyErrorToAssignment=ai.validateTypesConsistency=void 0;var Tg=tn(),IA=hg(),$A=_g(),lu=so(),cu=Bt(),Rg=ir();function MF(t,e){function r(a,s){return u=>{a.forEach(l=>e("error",u+` in a rule that returns type '${s}'.`,{node:l?.inferredType?l.inferredType:l,property:"name"}))}}function n(a,s){return(u,l)=>{a.forEach(c=>{(0,Rg.extractAssignments)(c.definition).find(p=>p.feature===u)===void 0&&e("error",l+` in rule '${c.name}', but is required in type '${s}'.`,{node:c,property:"parameters"})})}}let i=LA(t),o=new Tg.MultiMap;for(let[a,s]of i.entries())"declared"in s&&uu(s.declared)&&o.addAll(a,Uc(s.declared,"declared",i).values());for(let[a,s]of i.entries()){if("declared"in s&&LF(s,o,e),!jF(s))continue;let u=r(s.nodes,a),l=n(s.nodes,a),c=MA(s.nodes,e);if(NA(s.inferred)&&NA(s.declared))UF(s.inferred.union,s.declared.union,u);else if(uu(s.inferred)&&uu(s.declared)){let f=Uc(s.inferred,"inferred",i),p=Uc(s.declared,"declared",i);HF(f,p,u,c,l)}else{let f=`Inferred and declared versions of type ${a} both have to be interfaces or unions.`;s.nodes.forEach(p=>e("error",f,{node:p?.inferredType?p.inferredType:p,property:"name"})),e("error",f,{node:s.node,property:"name"})}}}ai.validateTypesConsistency=MF;function LF(t,e,r){let n=t.declared;if(!uu(n))return;let i=n.interfaceSuperTypes;for(let a=0;a<i.length;a++)for(let s=a+1;s<i.length;s++){let u=i[a],l=i[s],c=e.get(u),f=e.get(l),p=FF(c,f);p.length>0&&r("error",`Cannot simultaneously inherit from '${u}' and '${l}'. Their ${p.map(h=>"'"+h+"'").join(", ")} properties are not identical.`,{node:t.node,property:"name"})}let o=new Set;for(let a of i){let s=e.get(a);for(let u of s)o.add(u.name)}for(let a of n.properties)if(o.has(a.name)){let u=t.node.attributes.find(l=>l.name===a.name);u&&r("error",`Cannot redeclare property '${a.name}'. It is already inherited from another interface.`,{node:u,property:"name"})}}function FF(t,e){let r=[];for(let n of t){let i=e.find(o=>o.name===n.name);i&&!qF(n,i)&&r.push(n.name)}return r}function qF(t,e){if(t.optional!==e.optional||t.typeAlternatives.length!==e.typeAlternatives.length)return!1;for(let r of t.typeAlternatives){let n=!1;for(let i of e.typeAlternatives)i.array===r.array&&i.reference===r.reference&&i.types.length===r.types.length&&i.types.every(o=>r.types.includes(o))&&(n=!0);if(!n)return!1}return!0}function Uc(t,e,r,n=new Tg.MultiMap,i=new Set){if(i.has(t.name))return n;i.add(t.name);let o=t.properties;for(let a of o)n.add(a.name,a);for(let a of t.interfaceSuperTypes){let s=r.get(a),u=s?.[e];uu(u)&&Uc(u,e,r,n,i)}return n}function MA(t,e){let r=t.flatMap(n=>(0,Rg.extractAssignments)(n.definition));return(n,i)=>{let o=r.find(a=>a.feature===n);o&&e("error",i,{node:o,property:"feature"})}}ai.applyErrorToAssignment=MA;function NA(t){return t&&"union"in t}function uu(t){return t&&"properties"in t}function jF(t){return t&&"inferred"in t&&"declared"in t}function LA(t){let e=(0,lu.collectAllAstResources)([t]),r=(0,$A.collectInferredTypes)(Array.from(e.parserRules),Array.from(e.datatypeRules)),n=(0,IA.collectDeclaredTypes)(Array.from(e.interfaces),Array.from(e.types),r),i=FA(e),o=OA(r).reduce((s,u)=>s.set(u.name,{inferred:u,nodes:i.get(u.name)}),new Map);return OA(n).reduce((s,u)=>{var l;let c=(l=(0,cu.stream)(e.types).find(f=>f.name===u.name))!==null&&l!==void 0?l:(0,cu.stream)(e.interfaces).find(f=>f.name===u.name);if(c){let f=o.get(u.name);s.set(u.name,f?Object.assign(Object.assign({},f),{declared:u,node:c}):{declared:u,node:c})}return s},new Map)}ai.collectValidationResources=LA;function FA(t){return(0,cu.stream)(t.parserRules).concat(t.datatypeRules).reduce((e,r)=>e.add((0,Rg.getRuleType)(r),r),new Tg.MultiMap)}function OA(t){return t.interfaces.concat(t.unions)}var GF=(t,e)=>t.array&&!e.array&&t.reference&&!e.reference?"can't be an array and a reference":!t.array&&e.array&&!t.reference&&e.reference?"has to be an array and a reference":t.array&&!e.array?"can't be an array":!t.array&&e.array?"has to be an array":t.reference&&!e.reference?"can't be a reference":!t.reference&&e.reference?"has to be a reference":"";function qA(t,e){let r=a=>a.reduce((s,u)=>s.set((0,lu.distinctAndSorted)(u.types).join(" | "),u),new Map),n=r(t),i=r(e),o=[];for(let[a,s]of(0,cu.stream)(n)){let u=i.get(a);u?(u.array!==s.array||u.reference!==s.reference)&&o.push({typeString:a,errorMessage:GF(s,u)}):o.push({typeString:a,errorMessage:"is not expected"})}return o}function UF(t,e,r){let n=qA(t,e);for(let i of n)r(`A type '${i.typeString}' ${i.errorMessage}`)}function HF(t,e,r,n,i){let o=(s,u,l)=>`The assigned type '${u}' is not compatible with the declared property '${s}' of type '${l}'.`,a=(s,u)=>!(s.typeAlternatives.length===1&&s.typeAlternatives[0].array||u.typeAlternatives.length===1&&u.typeAlternatives[0].array);for(let s of t.keys()){let l=t.get(s)[0],f=e.get(s)[0];if(f){let p=(0,lu.propertyTypeArrayToString)(l.typeAlternatives),h=(0,lu.propertyTypeArrayToString)(f.typeAlternatives);if(p!==h){let d=qA(l.typeAlternatives,f.typeAlternatives);if(d.length>0){let g=o(l.name,p,h);for(let C of d)g=g+` '${C.typeString}' ${C.errorMessage};`;g=g.replace(/;$/,"."),n(l.name,g)}}a(l,f)&&!f.optional&&l.optional&&i(l.name,`Property '${l.name}' is missing`)}else n(l.name,`A property '${l.name}' is not expected.`)}for(let[s,u]of e.entriesGroupedByKey())t.get(s).length===0&&!u.some(c=>c.optional)&&r(`A property '${s}' is expected`)}function BF(t){let e=(0,lu.collectAllAstResources)([t]),r=(0,$A.collectInferredTypes)(Array.from(e.parserRules),Array.from(e.datatypeRules)),n=(0,IA.collectDeclaredTypes)(Array.from(e.interfaces),Array.from(e.types),r),i=FA(e),o=r.interfaces.reduce((a,s)=>a.set(s.name,{type:s,node:i.get(s.name)}),new Map);return n.interfaces.reduce((a,s)=>{if(!a.has(s.name)){let u=(0,cu.stream)(e.interfaces).find(l=>l.name===s.name);u&&a.set(s.name,{type:s,node:u})}return a},o)}ai.collectAllInterfaces=BF});var Sg=b(Sr=>{"use strict";var WF=Sr&&Sr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KF=Sr&&Sr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zF=Sr&&Sr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&WF(e,t,r);return KF(e,t),e};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.LangiumGrammarValidator=Sr.IssueCodes=Sr.LangiumGrammarValidationRegistry=void 0;var bg=Ta(),VF=$n(),lo=Ie(),Hc=tn(),Ag=pt(),$i=Wt(),Eg=Bt(),YF=uo(),XF=qc(),at=zF(ot()),GA=ot(),or=ir(),Cg=jA(),xg=class extends XF.ValidationRegistry{constructor(e){super(e);let r=e.validation.LangiumGrammarValidator,n={Action:r.checkActionTypeUnions,AbstractRule:r.checkRuleName,Assignment:[r.checkAssignmentWithFeatureName,r.checkAssignmentToFragmentRule],ParserRule:[r.checkParserRuleDataType,r.checkRuleParametersUsed],TerminalRule:[r.checkTerminalRuleReturnType,r.checkHiddenTerminalRule,r.checkEmptyTerminalRule],Keyword:r.checkKeyword,UnorderedGroup:r.checkUnorderedGroup,Grammar:[r.checkGrammarName,r.checkEntryGrammarRule,r.checkUniqueRuleName,r.checkUniqueTypeName,r.checkUniqueImportedRules,r.checkDuplicateImportedGrammar,r.checkGrammarHiddenTokens,r.checkGrammarForUnusedRules,r.checkGrammarImports,r.checkGrammarTypeUnions,r.checkGrammarTypeInfer,r.checkTypesConsistency,r.checkPropertyNameDuplication],GrammarImport:r.checkPackageImport,CharacterRange:r.checkInvalidCharacterRange,RuleCall:[r.checkUsedHiddenTerminalRule,r.checkUsedFragmentTerminalRule,r.checkRuleCallParameters],TerminalRuleCall:r.checkUsedHiddenTerminalRule,CrossReference:[r.checkCrossReferenceSyntax,r.checkCrossRefNameAssignment,r.checkCrossRefTerminalType,r.checkCrossRefType],AtomType:[r.checkAtomTypeRefType,r.checkFragmentsInTypes]};this.register(n,r)}};Sr.LangiumGrammarValidationRegistry=xg;var mr;(function(t){t.GrammarNameUppercase="grammar-name-uppercase",t.RuleNameUppercase="rule-name-uppercase",t.HiddenGrammarTokens="hidden-grammar-tokens",t.UseRegexTokens="use-regex-tokens",t.EntryRuleTokenSyntax="entry-rule-token-syntax",t.CrossRefTokenSyntax="cross-ref-token-syntax",t.MissingImport="missing-import",t.UnnecessaryFileExtension="unnecessary-file-extension",t.InvalidReturns="invalid-returns",t.InvalidInfers="invalid-infers",t.MissingInfer="missing-infer",t.SuperfluousInfer="superfluous-infer",t.OptionalUnorderedGroup="optional-unordered-group"})(mr=Sr.IssueCodes||(Sr.IssueCodes={}));var wg=class{constructor(e){this.references=e.references.References,this.documents=e.shared.workspace.LangiumDocuments}checkGrammarName(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Grammar name should start with an upper case letter.",{node:e,property:"name",code:mr.GrammarNameUppercase})}}checkEntryGrammarRule(e,r){let n=e.rules.filter(i=>at.isParserRule(i)&&i.entry);if(e.isDeclared&&n.length===0){let i=e.rules.find(o=>at.isParserRule(o)&&!(0,or.isDataTypeRule)(o));i?r("error","The grammar is missing an entry parser rule. This rule can be an entry one.",{node:i,property:"name",code:mr.EntryRuleTokenSyntax}):r("error","This grammar is missing an entry parser rule.",{node:e,property:"name"})}else!e.isDeclared&&n.length>=1?n.forEach(i=>r("error","Cannot declare entry rules for unnamed grammars.",{node:i,property:"name"})):n.length>1?n.forEach(i=>r("error","The entry rule has to be unique.",{node:i,property:"name"})):n.length===1&&(0,or.isDataTypeRule)(n[0])&&r("error","The entry rule cannot be a data type rule.",{node:n[0],property:"name"})}checkUniqueRuleName(e,r){let n=i=>(0,Eg.stream)(i.rules).filter(o=>!fu(o));this.checkUniqueName(e,r,n,"rule")}checkUniqueTypeName(e,r){let n=i=>(0,Eg.stream)(i.types).concat(i.interfaces);this.checkUniqueName(e,r,n,"type")}checkUniqueName(e,r,n,i){let o=new Hc.MultiMap;n(e).forEach(u=>o.add(u.name,u));for(let[,u]of o.entriesGroupedByKey())u.length>1&&u.forEach(l=>{r("error",`A ${i}'s name has to be unique.`,{node:l,property:"name"})});let a=new Set,s=(0,or.resolveTransitiveImports)(this.documents,e);for(let u of s)n(u).forEach(l=>a.add(l.name));for(let u of o.keys())a.has(u)&&o.get(u).forEach(c=>{r("error",`A ${i} with the name '${c.name}' already exists in an imported grammar.`,{node:c,property:"name"})})}checkDuplicateImportedGrammar(e,r){let n=new Hc.MultiMap;for(let i of e.imports){let o=(0,or.resolveImport)(this.documents,i);o&&n.add(o,i)}for(let[,i]of n.entriesGroupedByKey())i.length>1&&i.forEach((o,a)=>{a>0&&r("warning","The grammar is already being directly imported.",{node:o,tags:[bg.DiagnosticTag.Unnecessary]})})}checkUniqueImportedRules(e,r){let n=new Map;for(let o of e.imports){let a=(0,or.resolveTransitiveImports)(this.documents,o);n.set(o,a)}let i=new Hc.MultiMap;for(let o of e.imports){let a=n.get(o);for(let s of e.imports){if(o===s)continue;let u=n.get(s),l=this.getDuplicateExportedRules(a,u);for(let c of l)i.add(o,c)}}for(let o of e.imports){let a=i.get(o);a.length>0&&r("error","Some rules exported by this grammar are also included in other imports: "+(0,Eg.stream)(a).distinct().join(", "),{node:o,property:"path"})}}getDuplicateExportedRules(e,r){let i=e.filter(s=>!r.includes(s)).flatMap(s=>s.rules),o=r.flatMap(s=>s.rules),a=new Set;for(let s of i){let u=s.name;for(let l of o){let c=l.name;u===c&&a.add(l.name)}}return a}checkGrammarTypeInfer(e,r){var n,i;let o=new Set;for(let s of e.types)o.add(s.name);for(let s of e.interfaces)o.add(s.name);(0,or.resolveTransitiveImports)(this.documents,e).forEach(s=>{s.types.forEach(u=>o.add(u.name)),s.interfaces.forEach(u=>o.add(u.name))});for(let s of e.rules.filter(at.isParserRule)){if(fu(s))continue;let u=(0,or.isDataTypeRule)(s),l=!s.returnType&&!s.dataType,c=(0,or.getTypeName)(s);if(!u&&c&&o.has(c)===l){let f=l?(0,$i.findNodeForKeyword)(s.$cstNode,"infer"):(0,$i.findNodeForKeyword)(s.$cstNode,"returns");r("error",a(c,l),{node:(n=s.inferredType)!==null&&n!==void 0?n:s,property:"name",code:l?mr.InvalidInfers:mr.InvalidReturns,data:f&&(0,Ag.toDocumentSegment)(f)})}else if(u&&l){let f=(0,$i.findNodeForKeyword)(s.$cstNode,"infer");r("error","Data type rules cannot infer a type.",{node:s,property:"inferredType",code:mr.InvalidInfers,data:f&&(0,Ag.toDocumentSegment)(f)})}}for(let s of(0,lo.streamAllContents)(e).filter(at.isAction)){let u=this.getActionType(s);if(u){let l=!!s.inferredType,c=(0,or.getTypeName)(s);if(s.type&&o.has(c)===l){let f=l?(0,$i.findNodeForKeyword)(s.$cstNode,"infer"):(0,$i.findNodeForKeyword)(s.$cstNode,"{");r("error",a(c,l),{node:s,property:"type",code:l?mr.SuperfluousInfer:mr.MissingInfer,data:f&&(0,Ag.toDocumentSegment)(f)})}else if(u&&o.has(c)&&l&&s.$cstNode){let f=(0,$i.findNodeForProperty)((i=s.inferredType)===null||i===void 0?void 0:i.$cstNode,"name"),p=(0,$i.findNodeForKeyword)(s.$cstNode,"{");f&&p&&r("error",`${c} is a declared type and cannot be redefined.`,{node:s,property:"type",code:mr.SuperfluousInfer,data:{start:p.range.end,end:f.range.start}})}}}function a(s,u){return u?`The type '${s}' is already explicitly declared and cannot be inferred.`:`The type '${s}' is not explicitly declared and must be inferred.`}}getActionType(e){var r;if(e.type)return(r=e.type)===null||r===void 0?void 0:r.ref;if(e.inferredType)return e.inferredType}checkGrammarHiddenTokens(e,r){e.definesHiddenTokens&&r("error","Hidden terminals are declared at the terminal definition.",{node:e,property:"definesHiddenTokens",code:mr.HiddenGrammarTokens})}checkHiddenTerminalRule(e,r){e.hidden&&e.fragment&&r("error","Cannot use terminal fragments as hidden tokens.",{node:e,property:"hidden"})}checkEmptyTerminalRule(e,r){try{let n=(0,or.terminalRegex)(e);new RegExp(n).test("")&&r("error","This terminal could match an empty string.",{node:e,property:"name"})}catch{}}checkUsedHiddenTerminalRule(e,r){let n=(0,lo.getContainerOfType)(e,i=>at.isTerminalRule(i)||at.isParserRule(i));if(n){if("hidden"in n&&n.hidden)return;let i=e.rule.ref;at.isTerminalRule(i)&&i.hidden&&r("error","Cannot use hidden terminal in non-hidden rule",{node:e,property:"rule"})}}checkUsedFragmentTerminalRule(e,r){let n=e.rule.ref;at.isTerminalRule(n)&&n.fragment&&(0,lo.getContainerOfType)(e,at.isParserRule)&&r("error","Cannot use terminal fragments as part of parser rules.",{node:e,property:"rule"})}checkCrossReferenceSyntax(e,r){e.deprecatedSyntax&&r("error","'|' is deprecated. Please, use ':' instead.",{node:e,property:"deprecatedSyntax",code:mr.CrossRefTokenSyntax})}checkPackageImport(e,r){(0,or.resolveImport)(this.documents,e)===void 0?r("error","Import cannot be resolved.",{node:e,property:"path"}):e.path.endsWith(".langium")&&r("warning","Imports do not need file extensions.",{node:e,property:"path",code:mr.UnnecessaryFileExtension})}checkGrammarImports(e,r){let n=new Set((0,or.resolveTransitiveImports)(this.documents,e).map(i=>(0,lo.getDocument)(i)));(0,lo.streamAllContents)(e).forEach(i=>{(at.isRuleCall(i)||at.isTerminalRuleCall(i))&&this.checkRuleCallImport(i,n,r)})}checkRuleCallImport(e,r,n){var i;let o=e.rule.ref;if(o){let a=(0,lo.getDocument)(o),s=(0,lo.getDocument)(e),u=s.parseResult.value;if(at.isGrammar(u)&&a!==s&&!r.has(a)){let l=(0,YF.relativeURI)(VF.Utils.dirname(s.uri),a.uri);l.endsWith(".langium")&&(l=l.substring(0,l.length-8)),l.startsWith(".")||(l="./"+l),n("error",`Referenced rule "${(i=e.rule.ref)===null||i===void 0?void 0:i.name}" is not imported.`,{node:e,property:"rule",code:mr.MissingImport,data:l})}}}checkGrammarTypeUnions(e,r){for(let n of e.rules)at.isParserRule(n)&&at.isType(n.returnType)&&r("error","Rules are not allowed to return union types.",{node:n,property:"returnType"});for(let n of e.interfaces)n.superTypes.forEach((i,o)=>{i.ref&&at.isType(i.ref)&&r("error","Interfaces cannot extend union types.",{node:n,property:"superTypes",index:o})})}checkActionTypeUnions(e,r){at.isType(e.type)&&r("error","Actions cannot create union types.",{node:e,property:"type"})}checkTypesConsistency(e,r){(0,Cg.validateTypesConsistency)(e,r)}checkPropertyNameDuplication(e,r){if(e.interfaces.length===0)return;let n=(0,Cg.collectAllInterfaces)(e);for(let i of e.interfaces.map(o=>o.name)){let o=new Hc.MultiMap;this.collectPropertyNamesForHierarchy(n,new Set,o,i);for(let[a,s]of o.entriesGroupedByKey())if(!(s.length<2))for(let u of s){let l=`A property '${a}' has to be unique for the whole hierarchy.`;if(at.isInterface(u)){let c=u.attributes.find(f=>f.name===a);c&&r("error",l,{node:c,property:"name"})}else(0,Cg.applyErrorToAssignment)(u,r)(a,l)}}}collectPropertyNamesForHierarchy(e,r,n,i){function o(a){if(r.has(a))return;r.add(a);let s=e.get(a);s&&(s.type.properties.forEach(u=>n.add(u.name,s.node)),s.type.interfaceSuperTypes.forEach(u=>o(u)))}o(i)}checkInvalidCharacterRange(e,r){if(e.right){let n="Character ranges cannot use more than one character",i=!1;e.left.value.length>1&&(i=!0,r("error",n,{node:e.left,property:"value"})),e.right.value.length>1&&(i=!0,r("error",n,{node:e.right,property:"value"})),i||r("hint","Consider using regex instead of character ranges",{node:e,code:mr.UseRegexTokens})}}checkGrammarForUnusedRules(e,r){let n=(0,$i.getAllReachableRules)(e,!0);for(let i of e.rules)at.isTerminalRule(i)&&i.hidden||fu(i)||n.has(i)||r("hint","This rule is declared but never referenced.",{node:i,property:"name",tags:[bg.DiagnosticTag.Unnecessary]})}checkRuleName(e,r){if(e.name&&!fu(e)){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Rule name should start with an upper case letter.",{node:e,property:"name",code:mr.RuleNameUppercase})}}checkKeyword(e,r){e.value.length===0?r("error","Keywords cannot be empty.",{node:e}):e.value.trim().length===0?r("error","Keywords cannot only consist of whitespace characters.",{node:e}):/\s/g.test(e.value)&&r("warning","Keywords should not contain whitespace characters.",{node:e})}checkUnorderedGroup(e,r){e.elements.forEach(n=>{(0,or.isOptionalCardinality)(n.cardinality)&&r("error","Optional elements in Unordered groups are currently not supported",{node:n,code:mr.OptionalUnorderedGroup})})}checkRuleParametersUsed(e,r){let n=e.parameters;if(n.length>0){let i=(0,lo.streamAllContents)(e).filter(at.isParameterReference);for(let o of n)i.some(a=>a.parameter.ref===o)||r("hint",`Parameter '${o.name}' is unused.`,{node:o,tags:[bg.DiagnosticTag.Unnecessary]})}}checkParserRuleDataType(e,r){if(fu(e))return;let n=e.dataType,i=(0,or.isDataTypeRule)(e);!n&&i?r("error","This parser rule does not create an object. Add a primitive return type or an action to the start of the rule to force object instantiation.",{node:e,property:"name"}):n&&!i&&r("error","Normal parser rules are not allowed to return a primitive value. Use a datatype rule for that.",{node:e,property:"dataType"})}checkAssignmentToFragmentRule(e,r){(0,GA.isRuleCall)(e.terminal)&&(0,GA.isParserRule)(e.terminal.rule.ref)&&e.terminal.rule.ref.fragment&&r("error",`Cannot use fragment rule '${e.terminal.rule.ref.name}' for assignment of property '${e.feature}'.`,{node:e,property:"terminal"})}checkTerminalRuleReturnType(e,r){var n;((n=e.type)===null||n===void 0?void 0:n.name)&&!JF(e.type.name)&&r("error","Terminal rules can only return primitive types like 'string', 'boolean', 'number', 'Date' or 'bigint'.",{node:e.type,property:"name"})}checkRuleCallParameters(e,r){let n=e.rule.ref;if(at.isParserRule(n)){let i=n.parameters.length,o=e.arguments.length;i!==o&&r("error",`Rule '${n.name}' expects ${i} arguments, but got ${o}.`,{node:e})}else at.isTerminalRule(n)&&e.arguments.length>0&&r("error","Terminal rules do not accept any arguments",{node:e})}checkCrossRefNameAssignment(e,r){!e.terminal&&e.type.ref&&!(0,$i.findNameAssignment)(e.type.ref)&&r("error","Cannot infer terminal or data type rule for cross reference.",{node:e,property:"type"})}checkCrossRefTerminalType(e,r){at.isRuleCall(e.terminal)&&at.isParserRule(e.terminal.rule.ref)&&!(0,or.isDataTypeRule)(e.terminal.rule.ref)&&r("error","Parser rules cannot be used for cross references.",{node:e.terminal,property:"rule"})}checkCrossRefType(e,r){let n=this.checkReferenceToRuleButNotType(e?.type);n&&r("error",n,{node:e,property:"type"})}checkAtomTypeRefType(e,r){if(e?.refType){let n=this.checkReferenceToRuleButNotType(e?.refType);n&&r("error",n,{node:e,property:"refType"})}}checkFragmentsInTypes(e,r){var n,i;at.isParserRule((n=e.refType)===null||n===void 0?void 0:n.ref)&&((i=e.refType)===null||i===void 0?void 0:i.ref.fragment)&&r("error","Cannot use rule fragments in types.",{node:e,property:"refType"})}checkReferenceToRuleButNotType(e){if(e&&at.isParserRule(e.ref)&&!(0,or.isDataTypeRule)(e.ref)&&(e.ref.returnType||e.ref.inferredType)){let r=(0,or.getTypeName)(e.ref);if(r)return`Use the rule type '${r}' instead of the typed rule name '${e.ref.name}' for cross references.`}}checkAssignmentWithFeatureName(e,r){e.feature==="name"&&at.isCrossReference(e.terminal)&&r("warning",'The "name" property is not recommended for cross-references.',{node:e,property:"feature"})}};Sr.LangiumGrammarValidator=wg;var ZF=["string","number","boolean","Date","bigint"];function JF(t){return ZF.includes(t)}function fu(t){return!t.definition||!t.definition.$cstNode||t.definition.$cstNode.length===0}});var Kc=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DocumentValidator=Mn.toDiagnosticSeverity=Mn.getDiagnosticRange=Mn.DefaultDocumentValidator=void 0;var nn=Xe(),UA=Wt(),QF=Ie(),eq=pt(),Bc=In(),kg=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r=nn.CancellationToken.None){let n=e.parseResult,i=[];await(0,Bc.interruptAndCheck)(r);for(let o of n.lexerErrors){let a={severity:nn.DiagnosticSeverity.Error,range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,code:Wc.LexingError,source:this.getSource()};i.push(a)}for(let o of n.parserErrors){let a;if(isNaN(o.token.startOffset)){if("previousToken"in o){let s=o.previousToken;if(isNaN(s.startOffset))a=nn.Range.create(0,0,0,0);else{let u=nn.Position.create(s.endLine-1,s.endColumn);a=nn.Range.create(u,u)}}}else a=(0,eq.tokenToRange)(o.token);if(a){let s={severity:nn.DiagnosticSeverity.Error,range:a,message:o.message,code:Wc.ParsingError,source:this.getSource()};i.push(s)}}for(let o of e.references){let a=o.error;if(a){let s={containerType:a.container.$type,property:a.property,refText:a.reference.$refText},u={node:a.container,property:a.property,index:a.index,code:Wc.LinkingError,data:s};i.push(this.toDiagnostic("error",a.message,u))}}try{i.push(...await this.validateAst(n.value,e,r))}catch(o){if((0,Bc.isOperationCancelled)(o))throw o;console.error("An error occurred during validation:",o)}return await(0,Bc.interruptAndCheck)(r),i}async validateAst(e,r,n=nn.CancellationToken.None){let i=[],o=(a,s,u)=>{i.push(this.toDiagnostic(a,s,u))};return await Promise.all((0,QF.streamAst)(e).map(async a=>{await(0,Bc.interruptAndCheck)(n);let s=this.validationRegistry.getChecks(a.$type);for(let u of s)await u(a,o,n)})),i}toDiagnostic(e,r,n){return{message:r,range:HA(n),severity:BA(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};Mn.DefaultDocumentValidator=kg;function HA(t){if(nn.Range.is(t.range))return t.range;let e;return typeof t.property=="string"?e=(0,UA.findNodeForProperty)(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=(0,UA.findNodeForKeyword)(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}}}Mn.getDiagnosticRange=HA;function BA(t){switch(t){case"error":return nn.DiagnosticSeverity.Error;case"warning":return nn.DiagnosticSeverity.Warning;case"info":return nn.DiagnosticSeverity.Information;case"hint":return nn.DiagnosticSeverity.Hint;default:throw new Error("Invalid diagnostic severity: "+t)}}Mn.toDiagnosticSeverity=BA;var Wc;(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Wc=Mn.DocumentValidator||(Mn.DocumentValidator={}))});var VA=b(si=>{"use strict";var tq=si&&si.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rq=si&&si.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nq=si&&si.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&tq(e,t,r);return rq(e,t),e};Object.defineProperty(si,"__esModule",{value:!0});si.LangiumGrammarCodeActionProvider=void 0;var Ln=Xe(),WA=Ie(),KA=pt(),iq=Wt(),zA=Fa(),oq=Kc(),Pg=nq(ot()),on=Sg(),Dg=class{getCodeActions(e,r){let n=[];for(let i of r.context.diagnostics){let o=this.createCodeAction(i,e);o&&n.push(o)}return n}createCodeAction(e,r){switch(e.code){case on.IssueCodes.GrammarNameUppercase:case on.IssueCodes.RuleNameUppercase:return this.makeUpperCase(e,r);case on.IssueCodes.HiddenGrammarTokens:return this.fixHiddenTerminals(e,r);case on.IssueCodes.UseRegexTokens:return this.fixRegexTokens(e,r);case on.IssueCodes.EntryRuleTokenSyntax:return this.addEntryKeyword(e,r);case on.IssueCodes.CrossRefTokenSyntax:return this.fixCrossRefSyntax(e,r);case on.IssueCodes.MissingImport:return this.fixMissingImport(e,r);case on.IssueCodes.UnnecessaryFileExtension:return this.fixUnnecessaryFileExtension(e,r);case on.IssueCodes.InvalidInfers:case on.IssueCodes.InvalidReturns:return this.fixInvalidReturnsInfers(e,r);case on.IssueCodes.MissingInfer:return this.fixMissingInfer(e,r);case on.IssueCodes.SuperfluousInfer:return this.fixSuperfluousInfer(e,r);case oq.DocumentValidator.LinkingError:{let n=e.data;if(n&&n.containerType==="RuleCall"&&n.property==="rule")return this.addNewRule(e,n,r);break}}}fixInvalidReturnsInfers(e,r){let n=e.data;if(n){let i=r.textDocument.getText(n.range);return{title:`Correct ${i} usage`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.range,newText:i==="infers"?"returns":"infers"}]}}}}}fixMissingInfer(e,r){let n=e.data;if(n)return{title:"Correct 'infer' usage",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:{start:n.range.end,end:n.range.end},newText:"infer "}]}}}}fixSuperfluousInfer(e,r){if(e.data)return{title:"Remove the 'infer' keyword",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:e.data,newText:""}]}}}}fixUnnecessaryFileExtension(e,r){let n=Object.assign({},e.range.end);n.character-=1;let i=Object.assign({},n);return i.character-=8,{title:"Remove file extension",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:i,end:n},newText:""}]}}}}fixMissingImport(e,r){let n,i=r.parseResult.value,o=i.imports,a=i.rules;if(o.length>0)n=o[0].$cstNode.range.start;else if(a.length>0)n=a[0].$cstNode.range.start;else return;let s=e.data;if(typeof s=="string")return{title:`Add import to '${s}'`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:n,end:n},newText:`import '${s}';
3599
- `}]}}}}makeUpperCase(e,r){let n={start:e.range.start,end:{line:e.range.start.line,character:e.range.start.character+1}};return{title:"First letter to upper case",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:n,newText:r.textDocument.getText(n).toUpperCase()}]}}}}addEntryKeyword(e,r){return{title:"Add entry keyword",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:e.range.start,end:e.range.start},newText:"entry "}]}}}}fixRegexTokens(e,r){let n=r.textDocument.offsetAt(e.range.start),i=r.parseResult.value.$cstNode;if(i){let o=(0,KA.findLeafNodeAtOffset)(i,n),a=(0,WA.getContainerOfType)(o?.element,Pg.isCharacterRange);if(a&&a.right&&a.$cstNode){let s=a.left.value,u=a.right.value;return{title:"Refactor into regular expression",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:a.$cstNode.range,newText:`/[${(0,zA.escapeRegExp)(s)}-${(0,zA.escapeRegExp)(u)}]/`}]}}}}}}fixCrossRefSyntax(e,r){return{title:"Replace '|' with ':'",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:":"}]}}}}fixHiddenTerminals(e,r){let n=r.parseResult.value,i=n.hiddenTokens,o=[],a=(0,iq.findNodeForProperty)(n.$cstNode,"definesHiddenTokens");if(a){let s=a.range.start,u=a.offset,l=n.$cstNode.text.indexOf(")",u)+1;o.push({newText:"",range:{start:s,end:r.textDocument.positionAt(l)}})}for(let s of i){let u=s.ref;if(u&&Pg.isTerminalRule(u)&&!u.hidden&&u.$cstNode){let l=u.$cstNode.range.start;o.push({newText:"hidden ",range:{start:l,end:l}})}}return{title:"Fix hidden terminals",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:o}}}}addNewRule(e,r,n){let i=n.textDocument.offsetAt(e.range.start),o=n.parseResult.value.$cstNode;if(o){let a=(0,KA.findLeafNodeAtOffset)(o,i),s=(0,WA.getContainerOfType)(a?.element,Pg.isParserRule);if(s&&s.$cstNode)return{title:`Add new rule '${r.refText}'`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[n.textDocument.uri]:[{range:{start:s.$cstNode.range.end,end:s.$cstNode.range.end},newText:`
3598
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexStack.push(r),this.isStarting&&(this.startRegex+=r)}}},qo=new tg;function FL(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=fA.pattern(t),r=[];for(let n of e.value.value)qo.reset(t),qo.visit(n),r.push({start:qo.startRegex,end:qo.endRegex});return r}catch{return[]}}hr.getTerminalParts=FL;function qL(t){try{return typeof t!="string"&&(t=t.source),t=`/${t}/`,qo.reset(t),qo.visit(fA.pattern(t)),qo.multiline}catch{return!1}}hr.isMultilineComment=qL;function jL(t){return(typeof t=="string"?new RegExp(t):t).test(" ")}hr.isWhitespaceRegExp=jL;function rg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}hr.escapeRegExp=rg;function GL(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:rg(e)).join("")}hr.getCaseInsensitivePattern=GL;function UL(t,e){let r=dA(t),n=e.match(r);return!!n&&n[0].length>0}hr.partialMatches=UL;function dA(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",a;function s(l){o+=r.substr(n,l),n+=l}function u(l){o+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?r[n+2]==="{"?u(r.indexOf("}",n)-n+1):u(6):u(2);break;case"p":case"P":e.unicode?u(r.indexOf("}",n)-n+1):u(2);break;case"k":u(r.indexOf(">",n)-n+1);break;default:u(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],u(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?s(a[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":a=n,n+=3,i(),o+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),o+=r.substr(a,n-a);break;default:s(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else s(1),o+=i()+"|$)";break;case")":return++n,o;default:u(1);break}return o}return new RegExp(i(),t.flags)}hr.partialRegex=dA});var ir=b(ve=>{"use strict";var HL=ve&&ve.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),BL=ve&&ve.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WL=ve&&ve.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HL(e,t,r);return BL(e,t),e};Object.defineProperty(ve,"__esModule",{value:!0});ve.extractAssignments=ve.processActionNodeWithNodeDescriptionProvider=ve.processTypeNodeWithNodeLocator=ve.prepareGrammar=ve.resolveTransitiveImports=ve.resolveImport=ve.terminalRegex=ve.getRuleType=ve.getExplicitRuleType=ve.getTypeName=ve.getActionAtElement=ve.isDataTypeRule=ve.isArrayOperator=ve.isArrayCardinality=ve.isOptionalCardinality=void 0;var xe=WL(ot()),ig=$n(),jo=Ie(),KL=tn(),zL=so(),VL=Fa();function YL(t){return t==="?"||t==="*"}ve.isOptionalCardinality=YL;function XL(t){return t==="*"||t==="+"}ve.isArrayCardinality=XL;function ZL(t){return t==="+="}ve.isArrayOperator=ZL;function ag(t){return pA(t,new Set)}ve.isDataTypeRule=ag;function pA(t,e){if(e.has(t))return!0;e.add(t);for(let r of(0,jo.streamAllContents)(t))if(xe.isRuleCall(r)&&xe.isParserRule(r.rule.ref)){if(!pA(r.rule.ref,e))return!1}else{if(xe.isAssignment(r))return!1;if(xe.isAction(r))return!1}return!0}function hA(t){let e=t.$container;if(xe.isGroup(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(xe.isAction(o))return o;{let a=(0,jo.streamAllContents)(r[i]).find(xe.isAction);if(a)return a}}}if(xe.isAbstractElement(e))return hA(e)}ve.getActionAtElement=hA;function mA(t){var e;if(xe.isParserRule(t))return ag(t)?t.name:(e=sg(t))!==null&&e!==void 0?e:t.name;if(xe.isInterface(t)||xe.isType(t)||xe.isReturnType(t))return t.name;if(xe.isAction(t)){let r=gA(t);if(r)return r}else if(xe.isInferredType(t))return t.name;throw new zL.TypeResolutionError("Cannot get name of Unknown Type",t.$cstNode)}ve.getTypeName=mA;function sg(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e){if(xe.isParserRule(e))return e.name;if(xe.isInterface(e)||xe.isType(e))return e.name}}}ve.getExplicitRuleType=sg;function gA(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return mA(t.type.ref)}function JL(t){var e,r,n;return xe.isTerminalRule(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":ag(t)?t.name:(n=sg(t))!==null&&n!==void 0?n:t.name}ve.getRuleType=JL;function yA(t){return ou(t.definition)}ve.terminalRegex=yA;var ug=/[\s\S]/.source;function ou(t){if(xe.isTerminalAlternatives(t))return QL(t);if(xe.isTerminalGroup(t))return eF(t);if(xe.isCharacterRange(t))return nF(t);if(xe.isTerminalRuleCall(t)){let e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return Oi(yA(e),t.cardinality)}else{if(xe.isNegatedToken(t))return rF(t);if(xe.isUntilToken(t))return tF(t);if(xe.isRegexToken(t))return Oi(t.regex,t.cardinality,!1);if(xe.isWildcard(t))return Oi(ug,t.cardinality);throw new Error("Invalid terminal element.")}}function QL(t){return Oi(t.elements.map(ou).join("|"),t.cardinality)}function eF(t){return Oi(t.elements.map(ou).join(""),t.cardinality)}function tF(t){return Oi(`${ug}*?${ou(t.terminal)}`,t.cardinality)}function rF(t){return Oi(`(?!${ou(t.terminal)})${ug}*?`,t.cardinality)}function nF(t){return t.right?Oi(`[${ng(t.left)}-${ng(t.right)}]`,t.cardinality,!1):Oi(ng(t.left),t.cardinality,!1)}function ng(t){return(0,VL.escapeRegExp)(t.value)}function Oi(t,e,r=!0){return r&&(t=`(${t})`),e?`${t}${e}`:t}function lg(t,e){if(e.path===void 0||e.path.length===0)return;let r=ig.Utils.dirname((0,jo.getDocument)(e).uri),n=e.path;n.endsWith(".langium")||(n+=".langium");let i=ig.Utils.resolvePath(r,n);try{let a=t.getOrCreateDocument(i).parseResult.value;if(xe.isGrammar(a))return a}catch{}}ve.resolveImport=lg;function iF(t,e){if(xe.isGrammarImport(e)){let r=lg(t,e);if(r){let n=og(t,r);return n.push(r),n}return[]}else return og(t,e)}ve.resolveTransitiveImports=iF;function og(t,e,r=e,n=new Set,i=new Set){let o=(0,jo.getDocument)(e);if(r!==e&&i.add(e),!n.has(o.uri)){n.add(o.uri);for(let a of e.imports){let s=lg(t,a);s&&og(t,s,r,n,i)}}return Array.from(i)}function oF(t,e){let r=e,n=t.shared.workspace.LangiumDocumentFactory.fromModel(e,ig.URI.parse("memory://grammar.langium"));return r.$document=n,n.precomputedScopes=aF(t,e),e}ve.prepareGrammar=oF;function aF(t,e){let r=t.references.NameProvider,n=t.workspace.AstNodeDescriptionProvider,i=(0,jo.getDocument)(e),o=new KL.MultiMap,a=vA(t.workspace.AstNodeLocator),s=_A(n);for(let u of(0,jo.streamAllContents)(e)){if(xe.isReturnType(u))continue;s(u,i,o),a(u,i,o);let l=u.$container;if(l){let c=r.getName(u);c&&o.add(l,n.createDescription(u,c,i))}}return o}function vA(t){return(e,r,n)=>{var i;let o=e.$container;if(o&&xe.isParserRule(e)&&!e.returnType&&!e.dataType){let a=(i=e.inferredType)!==null&&i!==void 0?i:e;n.add(o,{node:a,name:a.name,type:"Interface",documentUri:r.uri,path:t.getAstNodePath(a)})}}}ve.processTypeNodeWithNodeLocator=vA;function _A(t){return(e,r,n)=>{let i=(0,jo.findRootNode)(e);if(i&&xe.isAction(e)&&e.inferredType){let o=gA(e);o&&n.add(i,t.createDescription(e,o,r))}}}ve.processActionNodeWithNodeDescriptionProvider=_A;function TA(t){return xe.isAssignment(t)?[t]:xe.isAlternatives(t)||xe.isGroup(t)||xe.isUnorderedGroup(t)?t.elements.flatMap(e=>TA(e)):[]}ve.extractAssignments=TA});var AA=b(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.LangiumGrammarScopeComputation=qa.LangiumGrammarScopeProvider=void 0;var sF=Pc(),uF=Nc(),RA=Ie(),lF=Bt(),cF=ot(),bA=ir(),cg=class extends uF.DefaultScopeProvider{constructor(e){super(e)}getScope(e){let r=this.reflection.getReferenceType(e);if(r!=="AbstractType")return super.getScope(e);let n=[],i=(0,RA.getDocument)(e.container).precomputedScopes,o=(0,RA.findRootNode)(e.container);if(i&&o){let s=i.get(o),u=[],l=[];if(s.length>0){for(let c of s)this.reflection.isSubtype(c.type,"ParserRule")?u.push(c):this.reflection.isSubtype(c.type,r)&&l.push(c);n.push((0,lF.stream)(l.concat(u.filter(c=>!l.some(f=>f.name===c.name)))))}}let a=this.getGlobalScope(r);for(let s=n.length-1;s>=0;s--)a=this.createScope(n[s],a);return a}};qa.LangiumGrammarScopeProvider=cg;var fg=class extends sF.DefaultScopeComputation{constructor(e){super(e),this.processTypeNode=(0,bA.processTypeNodeWithNodeLocator)(e.workspace.AstNodeLocator),this.processActionNode=(0,bA.processActionNodeWithNodeDescriptionProvider)(e.workspace.AstNodeDescriptionProvider)}processNode(e,r,n){(0,cF.isReturnType)(e)||(this.processTypeNode(e,r,n),this.processActionNode(e,r,n),super.processNode(e,r,n))}};qa.LangiumGrammarScopeComputation=fg});var uo=b(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.relativeURI=ja.equalURI=void 0;function fF(t,e){return t?.toString()===e?.toString()}ja.equalURI=fF;function dF(t,e){let r=t.path,n=e.path,i=r.split("/").filter(l=>l.length>0),o=n.split("/").filter(l=>l.length>0),a=0;for(;a<i.length&&i[a]===o[a];a++);let s="../".repeat(i.length-a),u=o.slice(a).join("/");return s+u}ja.relativeURI=dF});var qc=b(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ValidationRegistry=void 0;var pF=tn(),hF=In(),dg=class{constructor(e){this.validationChecks=new pF.MultiMap,this.reflection=e.shared.AstReflection}register(e,r=this){for(let[n,i]of Object.entries(e))if(Array.isArray(i))for(let o of i)this.doRegister(n,this.wrapValidationException(o,r));else i&&this.doRegister(n,this.wrapValidationException(i,r))}wrapValidationException(e,r){return async(n,i,o)=>{try{await e.call(r,n,i,o)}catch(a){if((0,hF.isOperationCancelled)(a))throw a;console.error("An error occurred during validation:",a);let s=a instanceof Error?a.message:String(a);a instanceof Error&&a.stack&&console.error(a.stack),i("error","An error occurred during validation: "+s,{node:n})}}}doRegister(e,r){for(let n of this.reflection.getAllTypes())this.reflection.isSubtype(n,e)&&this.validationChecks.add(n,r)}getChecks(e){return this.validationChecks.get(e)}};Fc.ValidationRegistry=dg});var hg=b(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.collectDeclaredTypes=void 0;var pg=ir(),EA=so(),mF=tn();function gF(t,e,r){var n;function i(s,u){var l;let c=(l=u.unions.find(f=>f.name===s))!==null&&l!==void 0?l:u.interfaces.find(f=>f.name===s);c&&a.get(s).forEach(f=>c.superTypes.add(f))}let o={unions:[],interfaces:[]};for(let s of t){let u=s.superTypes.filter(c=>c.ref).map(c=>(0,pg.getTypeName)(c.ref)),l=s.attributes.map(c=>({name:c.name,optional:c.isOptional===!0,typeAlternatives:c.typeAlternatives.map(CA)}));o.interfaces.push(new EA.InterfaceType(s.name,u,l))}let a=new mF.MultiMap;for(let s of e){let u=s.typeAlternatives.map(CA),l=s.typeAlternatives.length>1&&s.typeAlternatives.some(c=>{var f;return((f=c.refType)===null||f===void 0?void 0:f.ref)!==void 0});if(o.unions.push(new EA.UnionType(s.name,u,{reflection:l})),l)for(let c of s.typeAlternatives)!((n=c.refType)===null||n===void 0)&&n.ref&&a.add((0,pg.getTypeName)(c.refType.ref),s.name)}for(let s of a.keys())i(s,r),i(s,o);return o}jc.collectDeclaredTypes=gF;function CA(t){var e,r;let n=[];return t.refType?n=[t.refType.ref?(0,pg.getTypeName)(t.refType.ref):t.refType.$refText]:n=[(e=t.primitiveType)!==null&&e!==void 0?e:`'${(r=t.keywordType)===null||r===void 0?void 0:r.value}'`],{types:n,reference:t.isRef===!0,array:t.isArray===!0}}});var Ua=b(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.DefaultNameProvider=Ga.isNamed=void 0;var yF=Wt();function xA(t){return typeof t.name=="string"}Ga.isNamed=xA;var mg=class{getName(e){if(xA(e))return e.name}getNameNode(e){return(0,yF.findNodeForProperty)(e.$cstNode,"name")}};Ga.DefaultNameProvider=mg});var _g=b(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.collectInferredTypes=void 0;var Vt=ot(),vF=Ua(),_F=Bt(),Ha=so(),SA=tn(),Ii=ir();function wA(t){return JSON.parse(JSON.stringify(t))}function gg(t,e,r){if(e.ruleCalls.length>0){for(let n of e.ruleCalls)r.add(n);return}for(let n of e.parents)t.name===void 0?gg(n,n,r):n.name!==void 0&&n.name!==t.name?r.add(n.name):gg(t,n,r);e.parents.length===0&&e.name&&r.add(e.name)}var yg=class{constructor(e,r){this.context=e,this.root=r}getTypes(){let e={name:this.root.name,properties:this.root.properties,ruleCalls:this.root.ruleCalls,super:[]};return this.root.children.length===0?[e]:this.applyNext(this.root,{alt:e,next:this.root.children}).map(r=>r.alt)}applyNext(e,r){let n=this.splitType(r.alt,r.next.length),i=[];for(let o=0;o<r.next.length;o++){let a=n[o],s=r.next[o];if(s.declaredType)continue;s.actionWithAssignment&&i.push({alt:wA(a),next:[]}),s.name!==void 0&&s.name!==a.name&&(s.actionWithAssignment?(a.properties=[],a.ruleCalls=[],a.super=[e.name],a.name=s.name):(a.super=[a.name],a.name=s.name)),a.properties.push(...s.properties),a.ruleCalls.push(...s.ruleCalls);let u={alt:a,next:s.children};u.next.length===0?(u.alt.super=u.alt.super.filter(l=>l!==u.alt.name),i.push(u)):i.push(...this.applyNext(e,u))}return i}splitType(e,r){let n=[];for(let i=0;i<r;i++)n.push(wA(e));return n}getSuperTypes(e){let r=new Set;return gg(e,e,r),Array.from(r).sort()}connect(e,r){return r.parents.push(e),e.children.push(r),r}merge(...e){if(e.length===1)return e[0];if(e.length===0)return;let r=au();r.parents=e;for(let n of e)n.children.push(r);return r}};function TF(t,e){var r;let n=[],i={fragments:new Map};for(let u of t)n.push(...kA(i,u));let o=DA(n);DF(o);let a=RF(o),s=IF(o,a);for(let u of e){let l=(0,Vt.isAlternatives)(u.definition)&&u.definition.elements.every(c=>(0,Vt.isKeyword)(c))?(0,_F.stream)(u.definition.elements).filter(Vt.isKeyword).map(c=>`'${c.value}'`).toArray().sort():[(r=(0,Ii.getExplicitRuleType)(u))!==null&&r!==void 0?r:"string"];s.unions.push(new Ha.UnionType(u.name,su(!1,!1,l)))}return s}Gc.collectInferredTypes=TF;function RF(t){let e=[],r=new SA.MultiMap;for(let n of t)for(let i of n.superTypes)r.add(i,n.name);for(let[n,i]of r.entriesGroupedByKey())t.some(o=>o.name===n)||e.push(new Ha.UnionType(n,su(!1,!1,i),{reflection:!0}));return e}function kA(t,e){let r=au(e),n=new yg(t,r);return vg(n,n.root,e.definition),n.getTypes()}function au(t){return{name:(0,Vt.isParserRule)(t)?(0,Ii.getTypeName)(t):t,properties:[],ruleCalls:[],children:[],parents:[],actionWithAssignment:!1}}function vg(t,e,r){let n=(0,Ii.isOptionalCardinality)(r.cardinality);if((0,Vt.isAlternatives)(r)){let i=[];n&&i.push(e);for(let o of r.elements){let a=t.connect(e,au());i.push(vg(t,a,o))}return t.merge(...i)}else if((0,Vt.isGroup)(r)||(0,Vt.isUnorderedGroup)(r)){let i=n?t.connect(e,au()):e;for(let o of r.elements)i=vg(t,i,o);return n?t.merge(e,i):i}else{if((0,Vt.isAction)(r))return bF(t,e,r);(0,Vt.isAssignment)(r)?AF(e,r):(0,Vt.isRuleCall)(r)&&CF(t,e,r)}return e}function bF(t,e,r){var n,i;let o=t.connect(e,au((n=r.inferredType)===null||n===void 0?void 0:n.name));if(r.type){o.declaredType=!0;let a=(i=r.type)===null||i===void 0?void 0:i.ref;a&&(0,vF.isNamed)(a)&&(o.name=a.name)}return r.feature&&r.operator&&(o.actionWithAssignment=!0,o.properties.push({name:r.feature,optional:!1,typeAlternatives:su(r.operator==="+=",!1,t.root.ruleCalls.length!==0?t.root.ruleCalls:t.getSuperTypes(o))})),o}function AF(t,e){let r={types:new Set,reference:!1};PA(e.terminal,r);let n=su(e.operator==="+=",r.reference,e.operator==="?="?["boolean"]:Array.from(r.types));t.properties.push({name:e.feature,optional:(0,Ii.isOptionalCardinality)(e.cardinality),typeAlternatives:n})}function PA(t,e){(0,Vt.isAlternatives)(t)||(0,Vt.isUnorderedGroup)(t)||(0,Vt.isGroup)(t)?EF(t,e):(0,Vt.isKeyword)(t)?e.types.add(`'${t.value}'`):(0,Vt.isRuleCall)(t)&&t.rule.ref?e.types.add((0,Ii.getRuleType)(t.rule.ref)):(0,Vt.isCrossReference)(t)&&t.type.ref&&(e.types.add((0,Ii.getTypeName)(t.type.ref)),e.reference=!0)}function EF(t,e){for(let r of t.elements)PA(r,e)}function CF(t,e,r){let n=r.rule.ref;if((0,Vt.isParserRule)(n)&&n.fragment){let i=xF(n,t.context);(0,Ii.isOptionalCardinality)(r.cardinality)?e.properties.push(...i.map(o=>Object.assign(Object.assign({},o),{optional:!0}))):e.properties.push(...i)}else(0,Vt.isParserRule)(n)&&e.ruleCalls.push((0,Ii.getRuleType)(n))}function xF(t,e){let r=e.fragments.get(t);if(r)return r;let n=[];e.fragments.set(t,n);let i=(0,Ii.getTypeName)(t),o=kA(e,t),s=DA(o).find(u=>u.name===i);return s&&n.push(...s.properties),n}function DA(t){let e=new Map,r=[],n=wF(t);for(let i of n){let o=new Ha.InterfaceType(i.name,i.super,i.properties);e.set(o.name,o),i.ruleCalls.length>0&&(r.push(i),i.ruleCalls.forEach(a=>{a!==o.name&&o.subTypes.add(a)}))}for(let i of r)for(let o of i.ruleCalls){let a=e.get(o);a&&a.name!==i.name&&a.superTypes.add(i.name)}return Array.from(e.values())}function wF(t){let e=t.reduce((n,i)=>n.add(i.name,i),new SA.MultiMap),r=[];for(let[n,i]of e.entriesGroupedByKey()){let o=[],a=new Set,s={name:n,properties:o,ruleCalls:[],super:[]};for(let u of i){s.super.push(...u.super);let l=u.properties,c=new Set;for(let f of l){c.add(f.name);let p=o.find(h=>h.name===f.name);p?f.typeAlternatives.filter(SF(p.typeAlternatives)).forEach(h=>p.typeAlternatives.push(h)):o.push(Object.assign({},f))}l.length===0&&u.ruleCalls.forEach(f=>a.add(f))}for(let u of i)if(u.ruleCalls.length===0)for(let l of o)u.properties.find(c=>c.name===l.name)||(l.optional=!0);s.ruleCalls=Array.from(a),r.push(s)}return r}function SF(t){return e=>!t.some(r=>kF(r,e))}function kF(t,e){return t.array===e.array&&t.reference===e.reference&&PF(t.types,e.types)}function PF(t,e,r=(n,i)=>n===i){let n=(0,Ha.distinctAndSorted)(t),i=(0,Ha.distinctAndSorted)(e);return n.length!==i.length?!1:i.every((o,a)=>r(o,n[a]))}function DF(t){var e,r;for(let i of t){for(let o of i.properties.flatMap(a=>a.typeAlternatives.filter(s=>!s.reference).flatMap(s=>s.types)))(e=t.find(a=>a.name===o))===null||e===void 0||e.containerTypes.add(i.name);for(let o of i.superTypes)(r=t.find(a=>a.name===o))===null||r===void 0||r.subTypes.add(i.name)}let n=[];NF(n,t),OF(n)}function NF(t,e){function r(i){let o=[i];n.add(i.name);let a=[...i.subTypes,...i.superTypes];for(let s of a)if(!n.has(s)){let u=e.find(l=>l.name===s);u&&o.push(...r(u))}return o}let n=new Set;for(let i of e)n.has(i.name)||t.push(r(i))}function OF(t){for(let e of t){let r=new Set;e.forEach(n=>n.containerTypes.forEach(i=>r.add(i))),e.forEach(n=>n.containerTypes=r)}}function IF(t,e){let r={interfaces:[],unions:e},n=new Set(e.map(i=>i.name));for(let i of t)if(i.properties.length===0&&i.subTypes.size>0){let o=su(!1,!1,Array.from(i.subTypes)),a=e.find(s=>s.name===i.name);if(a)a.union.push(...o);else{let s=new Ha.UnionType(i.name,o,{reflection:!0});s.superTypes=i.superTypes,r.unions.push(s),n.add(i.name)}}else r.interfaces.push(i);for(let i of r.interfaces)i.interfaceSuperTypes=[...i.superTypes].filter(o=>!n.has(o)).sort();return r}function su(t,e,r){return t||e?[{array:t,reference:e,types:r}]:r.map(n=>({array:t,reference:e,types:[n]}))}});var jA=b(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.collectAllInterfaces=ai.collectValidationResources=ai.applyErrorToAssignment=ai.validateTypesConsistency=void 0;var Tg=tn(),IA=hg(),$A=_g(),lu=so(),cu=Bt(),Rg=ir();function $F(t,e){function r(a,s){return u=>{a.forEach(l=>e("error",u+` in a rule that returns type '${s}'.`,{node:l?.inferredType?l.inferredType:l,property:"name"}))}}function n(a,s){return(u,l)=>{a.forEach(c=>{(0,Rg.extractAssignments)(c.definition).find(p=>p.feature===u)===void 0&&e("error",l+` in rule '${c.name}', but is required in type '${s}'.`,{node:c,property:"parameters"})})}}let i=LA(t),o=new Tg.MultiMap;for(let[a,s]of i.entries())"declared"in s&&uu(s.declared)&&o.addAll(a,Uc(s.declared,"declared",i).values());for(let[a,s]of i.entries()){if("declared"in s&&MF(s,o,e),!qF(s))continue;let u=r(s.nodes,a),l=n(s.nodes,a),c=MA(s.nodes,e);if(NA(s.inferred)&&NA(s.declared))GF(s.inferred.union,s.declared.union,u);else if(uu(s.inferred)&&uu(s.declared)){let f=Uc(s.inferred,"inferred",i),p=Uc(s.declared,"declared",i);UF(f,p,u,c,l)}else{let f=`Inferred and declared versions of type ${a} both have to be interfaces or unions.`;s.nodes.forEach(p=>e("error",f,{node:p?.inferredType?p.inferredType:p,property:"name"})),e("error",f,{node:s.node,property:"name"})}}}ai.validateTypesConsistency=$F;function MF(t,e,r){let n=t.declared;if(!uu(n))return;let i=n.interfaceSuperTypes;for(let a=0;a<i.length;a++)for(let s=a+1;s<i.length;s++){let u=i[a],l=i[s],c=e.get(u),f=e.get(l),p=LF(c,f);p.length>0&&r("error",`Cannot simultaneously inherit from '${u}' and '${l}'. Their ${p.map(h=>"'"+h+"'").join(", ")} properties are not identical.`,{node:t.node,property:"name"})}let o=new Set;for(let a of i){let s=e.get(a);for(let u of s)o.add(u.name)}for(let a of n.properties)if(o.has(a.name)){let u=t.node.attributes.find(l=>l.name===a.name);u&&r("error",`Cannot redeclare property '${a.name}'. It is already inherited from another interface.`,{node:u,property:"name"})}}function LF(t,e){let r=[];for(let n of t){let i=e.find(o=>o.name===n.name);i&&!FF(n,i)&&r.push(n.name)}return r}function FF(t,e){if(t.optional!==e.optional||t.typeAlternatives.length!==e.typeAlternatives.length)return!1;for(let r of t.typeAlternatives){let n=!1;for(let i of e.typeAlternatives)i.array===r.array&&i.reference===r.reference&&i.types.length===r.types.length&&i.types.every(o=>r.types.includes(o))&&(n=!0);if(!n)return!1}return!0}function Uc(t,e,r,n=new Tg.MultiMap,i=new Set){if(i.has(t.name))return n;i.add(t.name);let o=t.properties;for(let a of o)n.add(a.name,a);for(let a of t.interfaceSuperTypes){let s=r.get(a),u=s?.[e];uu(u)&&Uc(u,e,r,n,i)}return n}function MA(t,e){let r=t.flatMap(n=>(0,Rg.extractAssignments)(n.definition));return(n,i)=>{let o=r.find(a=>a.feature===n);o&&e("error",i,{node:o,property:"feature"})}}ai.applyErrorToAssignment=MA;function NA(t){return t&&"union"in t}function uu(t){return t&&"properties"in t}function qF(t){return t&&"inferred"in t&&"declared"in t}function LA(t){let e=(0,lu.collectAllAstResources)([t]),r=(0,$A.collectInferredTypes)(Array.from(e.parserRules),Array.from(e.datatypeRules)),n=(0,IA.collectDeclaredTypes)(Array.from(e.interfaces),Array.from(e.types),r),i=FA(e),o=OA(r).reduce((s,u)=>s.set(u.name,{inferred:u,nodes:i.get(u.name)}),new Map);return OA(n).reduce((s,u)=>{var l;let c=(l=(0,cu.stream)(e.types).find(f=>f.name===u.name))!==null&&l!==void 0?l:(0,cu.stream)(e.interfaces).find(f=>f.name===u.name);if(c){let f=o.get(u.name);s.set(u.name,f?Object.assign(Object.assign({},f),{declared:u,node:c}):{declared:u,node:c})}return s},new Map)}ai.collectValidationResources=LA;function FA(t){return(0,cu.stream)(t.parserRules).concat(t.datatypeRules).reduce((e,r)=>e.add((0,Rg.getRuleType)(r),r),new Tg.MultiMap)}function OA(t){return t.interfaces.concat(t.unions)}var jF=(t,e)=>t.array&&!e.array&&t.reference&&!e.reference?"can't be an array and a reference":!t.array&&e.array&&!t.reference&&e.reference?"has to be an array and a reference":t.array&&!e.array?"can't be an array":!t.array&&e.array?"has to be an array":t.reference&&!e.reference?"can't be a reference":!t.reference&&e.reference?"has to be a reference":"";function qA(t,e){let r=a=>a.reduce((s,u)=>s.set((0,lu.distinctAndSorted)(u.types).join(" | "),u),new Map),n=r(t),i=r(e),o=[];for(let[a,s]of(0,cu.stream)(n)){let u=i.get(a);u?(u.array!==s.array||u.reference!==s.reference)&&o.push({typeString:a,errorMessage:jF(s,u)}):o.push({typeString:a,errorMessage:"is not expected"})}return o}function GF(t,e,r){let n=qA(t,e);for(let i of n)r(`A type '${i.typeString}' ${i.errorMessage}`)}function UF(t,e,r,n,i){let o=(s,u,l)=>`The assigned type '${u}' is not compatible with the declared property '${s}' of type '${l}'.`,a=(s,u)=>!(s.typeAlternatives.length===1&&s.typeAlternatives[0].array||u.typeAlternatives.length===1&&u.typeAlternatives[0].array);for(let s of t.keys()){let l=t.get(s)[0],f=e.get(s)[0];if(f){let p=(0,lu.propertyTypeArrayToString)(l.typeAlternatives),h=(0,lu.propertyTypeArrayToString)(f.typeAlternatives);if(p!==h){let d=qA(l.typeAlternatives,f.typeAlternatives);if(d.length>0){let g=o(l.name,p,h);for(let C of d)g=g+` '${C.typeString}' ${C.errorMessage};`;g=g.replace(/;$/,"."),n(l.name,g)}}a(l,f)&&!f.optional&&l.optional&&i(l.name,`Property '${l.name}' is missing`)}else n(l.name,`A property '${l.name}' is not expected.`)}for(let[s,u]of e.entriesGroupedByKey())t.get(s).length===0&&!u.some(c=>c.optional)&&r(`A property '${s}' is expected`)}function HF(t){let e=(0,lu.collectAllAstResources)([t]),r=(0,$A.collectInferredTypes)(Array.from(e.parserRules),Array.from(e.datatypeRules)),n=(0,IA.collectDeclaredTypes)(Array.from(e.interfaces),Array.from(e.types),r),i=FA(e),o=r.interfaces.reduce((a,s)=>a.set(s.name,{type:s,node:i.get(s.name)}),new Map);return n.interfaces.reduce((a,s)=>{if(!a.has(s.name)){let u=(0,cu.stream)(e.interfaces).find(l=>l.name===s.name);u&&a.set(s.name,{type:s,node:u})}return a},o)}ai.collectAllInterfaces=HF});var Sg=b(Sr=>{"use strict";var BF=Sr&&Sr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WF=Sr&&Sr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KF=Sr&&Sr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&BF(e,t,r);return WF(e,t),e};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.LangiumGrammarValidator=Sr.IssueCodes=Sr.LangiumGrammarValidationRegistry=void 0;var bg=Ta(),zF=$n(),lo=Ie(),Hc=tn(),Ag=pt(),$i=Wt(),Eg=Bt(),VF=uo(),YF=qc(),at=KF(ot()),GA=ot(),or=ir(),Cg=jA(),xg=class extends YF.ValidationRegistry{constructor(e){super(e);let r=e.validation.LangiumGrammarValidator,n={Action:r.checkActionTypeUnions,AbstractRule:r.checkRuleName,Assignment:[r.checkAssignmentWithFeatureName,r.checkAssignmentToFragmentRule],ParserRule:[r.checkParserRuleDataType,r.checkRuleParametersUsed],TerminalRule:[r.checkTerminalRuleReturnType,r.checkHiddenTerminalRule,r.checkEmptyTerminalRule],Keyword:r.checkKeyword,UnorderedGroup:r.checkUnorderedGroup,Grammar:[r.checkGrammarName,r.checkEntryGrammarRule,r.checkUniqueRuleName,r.checkUniqueTypeName,r.checkUniqueImportedRules,r.checkDuplicateImportedGrammar,r.checkGrammarHiddenTokens,r.checkGrammarForUnusedRules,r.checkGrammarImports,r.checkGrammarTypeUnions,r.checkGrammarTypeInfer,r.checkTypesConsistency,r.checkPropertyNameDuplication],GrammarImport:r.checkPackageImport,CharacterRange:r.checkInvalidCharacterRange,RuleCall:[r.checkUsedHiddenTerminalRule,r.checkUsedFragmentTerminalRule,r.checkRuleCallParameters],TerminalRuleCall:r.checkUsedHiddenTerminalRule,CrossReference:[r.checkCrossReferenceSyntax,r.checkCrossRefNameAssignment,r.checkCrossRefTerminalType,r.checkCrossRefType],AtomType:[r.checkAtomTypeRefType,r.checkFragmentsInTypes]};this.register(n,r)}};Sr.LangiumGrammarValidationRegistry=xg;var mr;(function(t){t.GrammarNameUppercase="grammar-name-uppercase",t.RuleNameUppercase="rule-name-uppercase",t.HiddenGrammarTokens="hidden-grammar-tokens",t.UseRegexTokens="use-regex-tokens",t.EntryRuleTokenSyntax="entry-rule-token-syntax",t.CrossRefTokenSyntax="cross-ref-token-syntax",t.MissingImport="missing-import",t.UnnecessaryFileExtension="unnecessary-file-extension",t.InvalidReturns="invalid-returns",t.InvalidInfers="invalid-infers",t.MissingInfer="missing-infer",t.SuperfluousInfer="superfluous-infer",t.OptionalUnorderedGroup="optional-unordered-group"})(mr=Sr.IssueCodes||(Sr.IssueCodes={}));var wg=class{constructor(e){this.references=e.references.References,this.documents=e.shared.workspace.LangiumDocuments}checkGrammarName(e,r){if(e.name){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Grammar name should start with an upper case letter.",{node:e,property:"name",code:mr.GrammarNameUppercase})}}checkEntryGrammarRule(e,r){let n=e.rules.filter(i=>at.isParserRule(i)&&i.entry);if(e.isDeclared&&n.length===0){let i=e.rules.find(o=>at.isParserRule(o)&&!(0,or.isDataTypeRule)(o));i?r("error","The grammar is missing an entry parser rule. This rule can be an entry one.",{node:i,property:"name",code:mr.EntryRuleTokenSyntax}):r("error","This grammar is missing an entry parser rule.",{node:e,property:"name"})}else!e.isDeclared&&n.length>=1?n.forEach(i=>r("error","Cannot declare entry rules for unnamed grammars.",{node:i,property:"name"})):n.length>1?n.forEach(i=>r("error","The entry rule has to be unique.",{node:i,property:"name"})):n.length===1&&(0,or.isDataTypeRule)(n[0])&&r("error","The entry rule cannot be a data type rule.",{node:n[0],property:"name"})}checkUniqueRuleName(e,r){let n=i=>(0,Eg.stream)(i.rules).filter(o=>!fu(o));this.checkUniqueName(e,r,n,"rule")}checkUniqueTypeName(e,r){let n=i=>(0,Eg.stream)(i.types).concat(i.interfaces);this.checkUniqueName(e,r,n,"type")}checkUniqueName(e,r,n,i){let o=new Hc.MultiMap;n(e).forEach(u=>o.add(u.name,u));for(let[,u]of o.entriesGroupedByKey())u.length>1&&u.forEach(l=>{r("error",`A ${i}'s name has to be unique.`,{node:l,property:"name"})});let a=new Set,s=(0,or.resolveTransitiveImports)(this.documents,e);for(let u of s)n(u).forEach(l=>a.add(l.name));for(let u of o.keys())a.has(u)&&o.get(u).forEach(c=>{r("error",`A ${i} with the name '${c.name}' already exists in an imported grammar.`,{node:c,property:"name"})})}checkDuplicateImportedGrammar(e,r){let n=new Hc.MultiMap;for(let i of e.imports){let o=(0,or.resolveImport)(this.documents,i);o&&n.add(o,i)}for(let[,i]of n.entriesGroupedByKey())i.length>1&&i.forEach((o,a)=>{a>0&&r("warning","The grammar is already being directly imported.",{node:o,tags:[bg.DiagnosticTag.Unnecessary]})})}checkUniqueImportedRules(e,r){let n=new Map;for(let o of e.imports){let a=(0,or.resolveTransitiveImports)(this.documents,o);n.set(o,a)}let i=new Hc.MultiMap;for(let o of e.imports){let a=n.get(o);for(let s of e.imports){if(o===s)continue;let u=n.get(s),l=this.getDuplicateExportedRules(a,u);for(let c of l)i.add(o,c)}}for(let o of e.imports){let a=i.get(o);a.length>0&&r("error","Some rules exported by this grammar are also included in other imports: "+(0,Eg.stream)(a).distinct().join(", "),{node:o,property:"path"})}}getDuplicateExportedRules(e,r){let i=e.filter(s=>!r.includes(s)).flatMap(s=>s.rules),o=r.flatMap(s=>s.rules),a=new Set;for(let s of i){let u=s.name;for(let l of o){let c=l.name;u===c&&a.add(l.name)}}return a}checkGrammarTypeInfer(e,r){var n,i;let o=new Set;for(let s of e.types)o.add(s.name);for(let s of e.interfaces)o.add(s.name);(0,or.resolveTransitiveImports)(this.documents,e).forEach(s=>{s.types.forEach(u=>o.add(u.name)),s.interfaces.forEach(u=>o.add(u.name))});for(let s of e.rules.filter(at.isParserRule)){if(fu(s))continue;let u=(0,or.isDataTypeRule)(s),l=!s.returnType&&!s.dataType,c=(0,or.getTypeName)(s);if(!u&&c&&o.has(c)===l){let f=l?(0,$i.findNodeForKeyword)(s.$cstNode,"infer"):(0,$i.findNodeForKeyword)(s.$cstNode,"returns");r("error",a(c,l),{node:(n=s.inferredType)!==null&&n!==void 0?n:s,property:"name",code:l?mr.InvalidInfers:mr.InvalidReturns,data:f&&(0,Ag.toDocumentSegment)(f)})}else if(u&&l){let f=(0,$i.findNodeForKeyword)(s.$cstNode,"infer");r("error","Data type rules cannot infer a type.",{node:s,property:"inferredType",code:mr.InvalidInfers,data:f&&(0,Ag.toDocumentSegment)(f)})}}for(let s of(0,lo.streamAllContents)(e).filter(at.isAction)){let u=this.getActionType(s);if(u){let l=!!s.inferredType,c=(0,or.getTypeName)(s);if(s.type&&o.has(c)===l){let f=l?(0,$i.findNodeForKeyword)(s.$cstNode,"infer"):(0,$i.findNodeForKeyword)(s.$cstNode,"{");r("error",a(c,l),{node:s,property:"type",code:l?mr.SuperfluousInfer:mr.MissingInfer,data:f&&(0,Ag.toDocumentSegment)(f)})}else if(u&&o.has(c)&&l&&s.$cstNode){let f=(0,$i.findNodeForProperty)((i=s.inferredType)===null||i===void 0?void 0:i.$cstNode,"name"),p=(0,$i.findNodeForKeyword)(s.$cstNode,"{");f&&p&&r("error",`${c} is a declared type and cannot be redefined.`,{node:s,property:"type",code:mr.SuperfluousInfer,data:{start:p.range.end,end:f.range.start}})}}}function a(s,u){return u?`The type '${s}' is already explicitly declared and cannot be inferred.`:`The type '${s}' is not explicitly declared and must be inferred.`}}getActionType(e){var r;if(e.type)return(r=e.type)===null||r===void 0?void 0:r.ref;if(e.inferredType)return e.inferredType}checkGrammarHiddenTokens(e,r){e.definesHiddenTokens&&r("error","Hidden terminals are declared at the terminal definition.",{node:e,property:"definesHiddenTokens",code:mr.HiddenGrammarTokens})}checkHiddenTerminalRule(e,r){e.hidden&&e.fragment&&r("error","Cannot use terminal fragments as hidden tokens.",{node:e,property:"hidden"})}checkEmptyTerminalRule(e,r){try{let n=(0,or.terminalRegex)(e);new RegExp(n).test("")&&r("error","This terminal could match an empty string.",{node:e,property:"name"})}catch{}}checkUsedHiddenTerminalRule(e,r){let n=(0,lo.getContainerOfType)(e,i=>at.isTerminalRule(i)||at.isParserRule(i));if(n){if("hidden"in n&&n.hidden)return;let i=e.rule.ref;at.isTerminalRule(i)&&i.hidden&&r("error","Cannot use hidden terminal in non-hidden rule",{node:e,property:"rule"})}}checkUsedFragmentTerminalRule(e,r){let n=e.rule.ref;at.isTerminalRule(n)&&n.fragment&&(0,lo.getContainerOfType)(e,at.isParserRule)&&r("error","Cannot use terminal fragments as part of parser rules.",{node:e,property:"rule"})}checkCrossReferenceSyntax(e,r){e.deprecatedSyntax&&r("error","'|' is deprecated. Please, use ':' instead.",{node:e,property:"deprecatedSyntax",code:mr.CrossRefTokenSyntax})}checkPackageImport(e,r){(0,or.resolveImport)(this.documents,e)===void 0?r("error","Import cannot be resolved.",{node:e,property:"path"}):e.path.endsWith(".langium")&&r("warning","Imports do not need file extensions.",{node:e,property:"path",code:mr.UnnecessaryFileExtension})}checkGrammarImports(e,r){let n=new Set((0,or.resolveTransitiveImports)(this.documents,e).map(i=>(0,lo.getDocument)(i)));(0,lo.streamAllContents)(e).forEach(i=>{(at.isRuleCall(i)||at.isTerminalRuleCall(i))&&this.checkRuleCallImport(i,n,r)})}checkRuleCallImport(e,r,n){var i;let o=e.rule.ref;if(o){let a=(0,lo.getDocument)(o),s=(0,lo.getDocument)(e),u=s.parseResult.value;if(at.isGrammar(u)&&a!==s&&!r.has(a)){let l=(0,VF.relativeURI)(zF.Utils.dirname(s.uri),a.uri);l.endsWith(".langium")&&(l=l.substring(0,l.length-8)),l.startsWith(".")||(l="./"+l),n("error",`Referenced rule "${(i=e.rule.ref)===null||i===void 0?void 0:i.name}" is not imported.`,{node:e,property:"rule",code:mr.MissingImport,data:l})}}}checkGrammarTypeUnions(e,r){for(let n of e.rules)at.isParserRule(n)&&at.isType(n.returnType)&&r("error","Rules are not allowed to return union types.",{node:n,property:"returnType"});for(let n of e.interfaces)n.superTypes.forEach((i,o)=>{i.ref&&at.isType(i.ref)&&r("error","Interfaces cannot extend union types.",{node:n,property:"superTypes",index:o})})}checkActionTypeUnions(e,r){at.isType(e.type)&&r("error","Actions cannot create union types.",{node:e,property:"type"})}checkTypesConsistency(e,r){(0,Cg.validateTypesConsistency)(e,r)}checkPropertyNameDuplication(e,r){if(e.interfaces.length===0)return;let n=(0,Cg.collectAllInterfaces)(e);for(let i of e.interfaces.map(o=>o.name)){let o=new Hc.MultiMap;this.collectPropertyNamesForHierarchy(n,new Set,o,i);for(let[a,s]of o.entriesGroupedByKey())if(!(s.length<2))for(let u of s){let l=`A property '${a}' has to be unique for the whole hierarchy.`;if(at.isInterface(u)){let c=u.attributes.find(f=>f.name===a);c&&r("error",l,{node:c,property:"name"})}else(0,Cg.applyErrorToAssignment)(u,r)(a,l)}}}collectPropertyNamesForHierarchy(e,r,n,i){function o(a){if(r.has(a))return;r.add(a);let s=e.get(a);s&&(s.type.properties.forEach(u=>n.add(u.name,s.node)),s.type.interfaceSuperTypes.forEach(u=>o(u)))}o(i)}checkInvalidCharacterRange(e,r){if(e.right){let n="Character ranges cannot use more than one character",i=!1;e.left.value.length>1&&(i=!0,r("error",n,{node:e.left,property:"value"})),e.right.value.length>1&&(i=!0,r("error",n,{node:e.right,property:"value"})),i||r("hint","Consider using regex instead of character ranges",{node:e,code:mr.UseRegexTokens})}}checkGrammarForUnusedRules(e,r){let n=(0,$i.getAllReachableRules)(e,!0);for(let i of e.rules)at.isTerminalRule(i)&&i.hidden||fu(i)||n.has(i)||r("hint","This rule is declared but never referenced.",{node:i,property:"name",tags:[bg.DiagnosticTag.Unnecessary]})}checkRuleName(e,r){if(e.name&&!fu(e)){let n=e.name.substring(0,1);n.toUpperCase()!==n&&r("warning","Rule name should start with an upper case letter.",{node:e,property:"name",code:mr.RuleNameUppercase})}}checkKeyword(e,r){e.value.length===0?r("error","Keywords cannot be empty.",{node:e}):e.value.trim().length===0?r("error","Keywords cannot only consist of whitespace characters.",{node:e}):/\s/g.test(e.value)&&r("warning","Keywords should not contain whitespace characters.",{node:e})}checkUnorderedGroup(e,r){e.elements.forEach(n=>{(0,or.isOptionalCardinality)(n.cardinality)&&r("error","Optional elements in Unordered groups are currently not supported",{node:n,code:mr.OptionalUnorderedGroup})})}checkRuleParametersUsed(e,r){let n=e.parameters;if(n.length>0){let i=(0,lo.streamAllContents)(e).filter(at.isParameterReference);for(let o of n)i.some(a=>a.parameter.ref===o)||r("hint",`Parameter '${o.name}' is unused.`,{node:o,tags:[bg.DiagnosticTag.Unnecessary]})}}checkParserRuleDataType(e,r){if(fu(e))return;let n=e.dataType,i=(0,or.isDataTypeRule)(e);!n&&i?r("error","This parser rule does not create an object. Add a primitive return type or an action to the start of the rule to force object instantiation.",{node:e,property:"name"}):n&&!i&&r("error","Normal parser rules are not allowed to return a primitive value. Use a datatype rule for that.",{node:e,property:"dataType"})}checkAssignmentToFragmentRule(e,r){(0,GA.isRuleCall)(e.terminal)&&(0,GA.isParserRule)(e.terminal.rule.ref)&&e.terminal.rule.ref.fragment&&r("error",`Cannot use fragment rule '${e.terminal.rule.ref.name}' for assignment of property '${e.feature}'.`,{node:e,property:"terminal"})}checkTerminalRuleReturnType(e,r){var n;((n=e.type)===null||n===void 0?void 0:n.name)&&!ZF(e.type.name)&&r("error","Terminal rules can only return primitive types like 'string', 'boolean', 'number', 'Date' or 'bigint'.",{node:e.type,property:"name"})}checkRuleCallParameters(e,r){let n=e.rule.ref;if(at.isParserRule(n)){let i=n.parameters.length,o=e.arguments.length;i!==o&&r("error",`Rule '${n.name}' expects ${i} arguments, but got ${o}.`,{node:e})}else at.isTerminalRule(n)&&e.arguments.length>0&&r("error","Terminal rules do not accept any arguments",{node:e})}checkCrossRefNameAssignment(e,r){!e.terminal&&e.type.ref&&!(0,$i.findNameAssignment)(e.type.ref)&&r("error","Cannot infer terminal or data type rule for cross reference.",{node:e,property:"type"})}checkCrossRefTerminalType(e,r){at.isRuleCall(e.terminal)&&at.isParserRule(e.terminal.rule.ref)&&!(0,or.isDataTypeRule)(e.terminal.rule.ref)&&r("error","Parser rules cannot be used for cross references.",{node:e.terminal,property:"rule"})}checkCrossRefType(e,r){let n=this.checkReferenceToRuleButNotType(e?.type);n&&r("error",n,{node:e,property:"type"})}checkAtomTypeRefType(e,r){if(e?.refType){let n=this.checkReferenceToRuleButNotType(e?.refType);n&&r("error",n,{node:e,property:"refType"})}}checkFragmentsInTypes(e,r){var n,i;at.isParserRule((n=e.refType)===null||n===void 0?void 0:n.ref)&&((i=e.refType)===null||i===void 0?void 0:i.ref.fragment)&&r("error","Cannot use rule fragments in types.",{node:e,property:"refType"})}checkReferenceToRuleButNotType(e){if(e&&at.isParserRule(e.ref)&&!(0,or.isDataTypeRule)(e.ref)&&(e.ref.returnType||e.ref.inferredType)){let r=(0,or.getTypeName)(e.ref);if(r)return`Use the rule type '${r}' instead of the typed rule name '${e.ref.name}' for cross references.`}}checkAssignmentWithFeatureName(e,r){e.feature==="name"&&at.isCrossReference(e.terminal)&&r("warning",'The "name" property is not recommended for cross-references.',{node:e,property:"feature"})}};Sr.LangiumGrammarValidator=wg;var XF=["string","number","boolean","Date","bigint"];function ZF(t){return XF.includes(t)}function fu(t){return!t.definition||!t.definition.$cstNode||t.definition.$cstNode.length===0}});var Kc=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DocumentValidator=Mn.toDiagnosticSeverity=Mn.getDiagnosticRange=Mn.DefaultDocumentValidator=void 0;var nn=Xe(),UA=Wt(),JF=Ie(),QF=pt(),Bc=In(),kg=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r=nn.CancellationToken.None){let n=e.parseResult,i=[];await(0,Bc.interruptAndCheck)(r);for(let o of n.lexerErrors){let a={severity:nn.DiagnosticSeverity.Error,range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,code:Wc.LexingError,source:this.getSource()};i.push(a)}for(let o of n.parserErrors){let a;if(isNaN(o.token.startOffset)){if("previousToken"in o){let s=o.previousToken;if(isNaN(s.startOffset))a=nn.Range.create(0,0,0,0);else{let u=nn.Position.create(s.endLine-1,s.endColumn);a=nn.Range.create(u,u)}}}else a=(0,QF.tokenToRange)(o.token);if(a){let s={severity:nn.DiagnosticSeverity.Error,range:a,message:o.message,code:Wc.ParsingError,source:this.getSource()};i.push(s)}}for(let o of e.references){let a=o.error;if(a){let s={containerType:a.container.$type,property:a.property,refText:a.reference.$refText},u={node:a.container,property:a.property,index:a.index,code:Wc.LinkingError,data:s};i.push(this.toDiagnostic("error",a.message,u))}}try{i.push(...await this.validateAst(n.value,e,r))}catch(o){if((0,Bc.isOperationCancelled)(o))throw o;console.error("An error occurred during validation:",o)}return await(0,Bc.interruptAndCheck)(r),i}async validateAst(e,r,n=nn.CancellationToken.None){let i=[],o=(a,s,u)=>{i.push(this.toDiagnostic(a,s,u))};return await Promise.all((0,JF.streamAst)(e).map(async a=>{await(0,Bc.interruptAndCheck)(n);let s=this.validationRegistry.getChecks(a.$type);for(let u of s)await u(a,o,n)})),i}toDiagnostic(e,r,n){return{message:r,range:HA(n),severity:BA(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};Mn.DefaultDocumentValidator=kg;function HA(t){if(nn.Range.is(t.range))return t.range;let e;return typeof t.property=="string"?e=(0,UA.findNodeForProperty)(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=(0,UA.findNodeForKeyword)(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}}}Mn.getDiagnosticRange=HA;function BA(t){switch(t){case"error":return nn.DiagnosticSeverity.Error;case"warning":return nn.DiagnosticSeverity.Warning;case"info":return nn.DiagnosticSeverity.Information;case"hint":return nn.DiagnosticSeverity.Hint;default:throw new Error("Invalid diagnostic severity: "+t)}}Mn.toDiagnosticSeverity=BA;var Wc;(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Wc=Mn.DocumentValidator||(Mn.DocumentValidator={}))});var VA=b(si=>{"use strict";var eq=si&&si.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tq=si&&si.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rq=si&&si.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&eq(e,t,r);return tq(e,t),e};Object.defineProperty(si,"__esModule",{value:!0});si.LangiumGrammarCodeActionProvider=void 0;var Ln=Xe(),WA=Ie(),KA=pt(),nq=Wt(),zA=Fa(),iq=Kc(),Pg=rq(ot()),on=Sg(),Dg=class{getCodeActions(e,r){let n=[];for(let i of r.context.diagnostics){let o=this.createCodeAction(i,e);o&&n.push(o)}return n}createCodeAction(e,r){switch(e.code){case on.IssueCodes.GrammarNameUppercase:case on.IssueCodes.RuleNameUppercase:return this.makeUpperCase(e,r);case on.IssueCodes.HiddenGrammarTokens:return this.fixHiddenTerminals(e,r);case on.IssueCodes.UseRegexTokens:return this.fixRegexTokens(e,r);case on.IssueCodes.EntryRuleTokenSyntax:return this.addEntryKeyword(e,r);case on.IssueCodes.CrossRefTokenSyntax:return this.fixCrossRefSyntax(e,r);case on.IssueCodes.MissingImport:return this.fixMissingImport(e,r);case on.IssueCodes.UnnecessaryFileExtension:return this.fixUnnecessaryFileExtension(e,r);case on.IssueCodes.InvalidInfers:case on.IssueCodes.InvalidReturns:return this.fixInvalidReturnsInfers(e,r);case on.IssueCodes.MissingInfer:return this.fixMissingInfer(e,r);case on.IssueCodes.SuperfluousInfer:return this.fixSuperfluousInfer(e,r);case iq.DocumentValidator.LinkingError:{let n=e.data;if(n&&n.containerType==="RuleCall"&&n.property==="rule")return this.addNewRule(e,n,r);break}}}fixInvalidReturnsInfers(e,r){let n=e.data;if(n){let i=r.textDocument.getText(n.range);return{title:`Correct ${i} usage`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:n.range,newText:i==="infers"?"returns":"infers"}]}}}}}fixMissingInfer(e,r){let n=e.data;if(n)return{title:"Correct 'infer' usage",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:{start:n.range.end,end:n.range.end},newText:"infer "}]}}}}fixSuperfluousInfer(e,r){if(e.data)return{title:"Remove the 'infer' keyword",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],edit:{changes:{[r.textDocument.uri]:[{range:e.data,newText:""}]}}}}fixUnnecessaryFileExtension(e,r){let n=Object.assign({},e.range.end);n.character-=1;let i=Object.assign({},n);return i.character-=8,{title:"Remove file extension",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:i,end:n},newText:""}]}}}}fixMissingImport(e,r){let n,i=r.parseResult.value,o=i.imports,a=i.rules;if(o.length>0)n=o[0].$cstNode.range.start;else if(a.length>0)n=a[0].$cstNode.range.start;else return;let s=e.data;if(typeof s=="string")return{title:`Add import to '${s}'`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:n,end:n},newText:`import '${s}';
3599
+ `}]}}}}makeUpperCase(e,r){let n={start:e.range.start,end:{line:e.range.start.line,character:e.range.start.character+1}};return{title:"First letter to upper case",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:n,newText:r.textDocument.getText(n).toUpperCase()}]}}}}addEntryKeyword(e,r){return{title:"Add entry keyword",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:{start:e.range.start,end:e.range.start},newText:"entry "}]}}}}fixRegexTokens(e,r){let n=r.textDocument.offsetAt(e.range.start),i=r.parseResult.value.$cstNode;if(i){let o=(0,KA.findLeafNodeAtOffset)(i,n),a=(0,WA.getContainerOfType)(o?.element,Pg.isCharacterRange);if(a&&a.right&&a.$cstNode){let s=a.left.value,u=a.right.value;return{title:"Refactor into regular expression",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:a.$cstNode.range,newText:`/[${(0,zA.escapeRegExp)(s)}-${(0,zA.escapeRegExp)(u)}]/`}]}}}}}}fixCrossRefSyntax(e,r){return{title:"Replace '|' with ':'",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:[{range:e.range,newText:":"}]}}}}fixHiddenTerminals(e,r){let n=r.parseResult.value,i=n.hiddenTokens,o=[],a=(0,nq.findNodeForProperty)(n.$cstNode,"definesHiddenTokens");if(a){let s=a.range.start,u=a.offset,l=n.$cstNode.text.indexOf(")",u)+1;o.push({newText:"",range:{start:s,end:r.textDocument.positionAt(l)}})}for(let s of i){let u=s.ref;if(u&&Pg.isTerminalRule(u)&&!u.hidden&&u.$cstNode){let l=u.$cstNode.range.start;o.push({newText:"hidden ",range:{start:l,end:l}})}}return{title:"Fix hidden terminals",kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[r.textDocument.uri]:o}}}}addNewRule(e,r,n){let i=n.textDocument.offsetAt(e.range.start),o=n.parseResult.value.$cstNode;if(o){let a=(0,KA.findLeafNodeAtOffset)(o,i),s=(0,WA.getContainerOfType)(a?.element,Pg.isParserRule);if(s&&s.$cstNode)return{title:`Add new rule '${r.refText}'`,kind:Ln.CodeActionKind.QuickFix,diagnostics:[e],isPreferred:!0,edit:{changes:{[n.textDocument.uri]:[{range:{start:s.$cstNode.range.end,end:s.$cstNode.range.end},newText:`
3600
3600
 
3601
3601
  `+r.refText+`:
3602
- /* TODO implement rule */ {infer `+r.refText+"};"}]}}}}}};si.LangiumGrammarCodeActionProvider=Dg});var Vc=b(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.DefaultFoldingRangeProvider=void 0;var Ng=Xe(),aq=Ie(),sq=pt(),Og=class{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e){let r=[],n=i=>r.push(i);return this.collectFolding(e,n),r}collectFolding(e,r){var n;let i=(n=e.parseResult)===null||n===void 0?void 0:n.value;if(i){if(this.shouldProcessContent(i)){let o=(0,aq.streamAllContents)(i).iterator(),a;do if(a=o.next(),!a.done){let s=a.value;this.shouldProcess(s)&&this.collectObjectFolding(e,s,r),this.shouldProcessContent(s)||o.prune()}while(!a.done)}this.collectCommentFolding(e,i,r)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,r,n){let i=r.$cstNode;if(i){let o=this.toFoldingRange(e,i);o&&n(o)}}collectCommentFolding(e,r,n){let i=r.$cstNode;if(i){for(let o of(0,sq.flattenCst)(i))if(this.commentNames.includes(o.tokenType.name)){let a=this.toFoldingRange(e,o,Ng.FoldingRangeKind.Comment);a&&n(a)}}}toFoldingRange(e,r,n){let i=r.range,o=i.start,a=i.end;if(!(a.line-o.line<2))return this.includeLastFoldingLine(r,n)||(a=e.textDocument.positionAt(e.textDocument.offsetAt({line:a.line,character:0})-1)),Ng.FoldingRange.create(o.line,a.line,o.character,a.character,n)}includeLastFoldingLine(e,r){if(r===Ng.FoldingRangeKind.Comment)return!1;let n=e.text,i=n.charAt(n.length-1);return!(i==="}"||i===")"||i==="]")}};zc.DefaultFoldingRangeProvider=Og});var YA=b(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.LangiumGrammarFoldingRangeProvider=void 0;var uq=Vc(),lq=ot(),Ig=class extends uq.DefaultFoldingRangeProvider{shouldProcessContent(e){return!(0,lq.isParserRule)(e)}};Yc.LangiumGrammarFoldingRangeProvider=Ig});var Lg=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Formatting=Fn.FormattingRegion=Fn.DefaultNodeFormatter=Fn.AbstractFormatter=void 0;var Xc=Wt(),$g=Pa(),cq=Ie(),XA=pt(),du=Bt(),Mg=class{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new Zc(e,this.collector)}formatDocument(e,r){return this.doDocumentFormat(e,r.options)}formatDocumentRange(e,r){return this.doDocumentFormat(e,r.options,r.range)}formatDocumentOnType(e,r){return this.doDocumentFormat(e,r.options,{start:{character:0,line:r.position.line},end:r.position})}get formatOnTypeOptions(){}doDocumentFormat(e,r,n){let i=new Map,o=(s,u,l)=>{var c,f;let p=this.nodeModeToKey(s,u),h=i.get(p),d=(c=l.options.priority)!==null&&c!==void 0?c:0,g=(f=h?.options.priority)!==null&&f!==void 0?f:0;(!h||g<=d)&&i.set(p,l)};this.collector=o,this.iterateAstFormatting(e,n);let a=this.iterateCstFormatting(e,i,r,n);return this.avoidOverlappingEdits(e.textDocument,a)}avoidOverlappingEdits(e,r){let n=[];for(let i of r){let o=n[n.length-1];if(o){let a=e.offsetAt(i.range.start),s=e.offsetAt(o.range.end);a<s&&n.pop()}n.push(i)}return n}iterateAstFormatting(e,r){let n=e.parseResult.value;this.format(n);let i=(0,cq.streamAllContents)(n).iterator(),o;do if(o=i.next(),!o.done){let a=o.value;this.insideRange(a.$cstNode.range,r)?this.format(a):i.prune()}while(!o.done)}nodeModeToKey(e,r){return`${e.offset}:${e.end}:${r}`}insideRange(e,r){return!r||e.start.line<=r.start.line&&e.end.line>=r.end.line||e.start.line>=r.start.line&&e.end.line<=r.end.line||e.start.line<=r.end.line&&e.end.line>=r.end.line}isNecessary(e,r){return r.getText(e.range)!==e.newText}iterateCstFormatting(e,r,n,i){let o={indentation:0,options:n,document:e.textDocument},a=[],u=this.iterateCstTree(e,o).iterator(),l,c;do if(c=u.next(),!c.done){let f=c.value,p=(0,$g.isLeafCstNode)(f),h=this.nodeModeToKey(f,"prepend"),d=r.get(h);if(r.delete(h),d){let x=this.createTextEdit(l,f,d,o);for(let T of x)T&&this.insideRange(T.range,i)&&this.isNecessary(T,e.textDocument)&&a.push(T)}let g=this.nodeModeToKey(f,"append"),C=r.get(g);if(r.delete(g),C){let x=(0,XA.getNextNode)(f);if(x){let T=this.createTextEdit(f,x,C,o);for(let v of T)v&&this.insideRange(v.range,i)&&this.isNecessary(v,e.textDocument)&&a.push(v)}}if(!d&&f.hidden){let x=this.createHiddenTextEdits(l,f,void 0,o);for(let T of x)T&&this.insideRange(T.range,i)&&this.isNecessary(T,e.textDocument)&&a.push(T)}p&&(l=f)}while(!c.done);return a}createHiddenTextEdits(e,r,n,i){var o;let a=r.range.start.line;if(e&&e.range.end.line===a)return[];let s=[],u={start:{character:0,line:a},end:r.range.start},l=i.document.getText(u),c=this.findFittingMove(u,(o=n?.moves)!==null&&o!==void 0?o:[],i),f=this.getExistingIndentationCharacterCount(l,i),h=this.getIndentationCharacterCount(i,c)-f;if(h===0)return[];let d="";h>0&&(d=(i.options.insertSpaces?" ":" ").repeat(h));let g=r.text.split(`
3602
+ /* TODO implement rule */ {infer `+r.refText+"};"}]}}}}}};si.LangiumGrammarCodeActionProvider=Dg});var Vc=b(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.DefaultFoldingRangeProvider=void 0;var Ng=Xe(),oq=Ie(),aq=pt(),Og=class{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e){let r=[],n=i=>r.push(i);return this.collectFolding(e,n),r}collectFolding(e,r){var n;let i=(n=e.parseResult)===null||n===void 0?void 0:n.value;if(i){if(this.shouldProcessContent(i)){let o=(0,oq.streamAllContents)(i).iterator(),a;do if(a=o.next(),!a.done){let s=a.value;this.shouldProcess(s)&&this.collectObjectFolding(e,s,r),this.shouldProcessContent(s)||o.prune()}while(!a.done)}this.collectCommentFolding(e,i,r)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,r,n){let i=r.$cstNode;if(i){let o=this.toFoldingRange(e,i);o&&n(o)}}collectCommentFolding(e,r,n){let i=r.$cstNode;if(i){for(let o of(0,aq.flattenCst)(i))if(this.commentNames.includes(o.tokenType.name)){let a=this.toFoldingRange(e,o,Ng.FoldingRangeKind.Comment);a&&n(a)}}}toFoldingRange(e,r,n){let i=r.range,o=i.start,a=i.end;if(!(a.line-o.line<2))return this.includeLastFoldingLine(r,n)||(a=e.textDocument.positionAt(e.textDocument.offsetAt({line:a.line,character:0})-1)),Ng.FoldingRange.create(o.line,a.line,o.character,a.character,n)}includeLastFoldingLine(e,r){if(r===Ng.FoldingRangeKind.Comment)return!1;let n=e.text,i=n.charAt(n.length-1);return!(i==="}"||i===")"||i==="]")}};zc.DefaultFoldingRangeProvider=Og});var YA=b(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.LangiumGrammarFoldingRangeProvider=void 0;var sq=Vc(),uq=ot(),Ig=class extends sq.DefaultFoldingRangeProvider{shouldProcessContent(e){return!(0,uq.isParserRule)(e)}};Yc.LangiumGrammarFoldingRangeProvider=Ig});var Lg=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Formatting=Fn.FormattingRegion=Fn.DefaultNodeFormatter=Fn.AbstractFormatter=void 0;var Xc=Wt(),$g=Pa(),lq=Ie(),XA=pt(),du=Bt(),Mg=class{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new Zc(e,this.collector)}formatDocument(e,r){return this.doDocumentFormat(e,r.options)}formatDocumentRange(e,r){return this.doDocumentFormat(e,r.options,r.range)}formatDocumentOnType(e,r){return this.doDocumentFormat(e,r.options,{start:{character:0,line:r.position.line},end:r.position})}get formatOnTypeOptions(){}doDocumentFormat(e,r,n){let i=new Map,o=(s,u,l)=>{var c,f;let p=this.nodeModeToKey(s,u),h=i.get(p),d=(c=l.options.priority)!==null&&c!==void 0?c:0,g=(f=h?.options.priority)!==null&&f!==void 0?f:0;(!h||g<=d)&&i.set(p,l)};this.collector=o,this.iterateAstFormatting(e,n);let a=this.iterateCstFormatting(e,i,r,n);return this.avoidOverlappingEdits(e.textDocument,a)}avoidOverlappingEdits(e,r){let n=[];for(let i of r){let o=n[n.length-1];if(o){let a=e.offsetAt(i.range.start),s=e.offsetAt(o.range.end);a<s&&n.pop()}n.push(i)}return n}iterateAstFormatting(e,r){let n=e.parseResult.value;this.format(n);let i=(0,lq.streamAllContents)(n).iterator(),o;do if(o=i.next(),!o.done){let a=o.value;this.insideRange(a.$cstNode.range,r)?this.format(a):i.prune()}while(!o.done)}nodeModeToKey(e,r){return`${e.offset}:${e.end}:${r}`}insideRange(e,r){return!r||e.start.line<=r.start.line&&e.end.line>=r.end.line||e.start.line>=r.start.line&&e.end.line<=r.end.line||e.start.line<=r.end.line&&e.end.line>=r.end.line}isNecessary(e,r){return r.getText(e.range)!==e.newText}iterateCstFormatting(e,r,n,i){let o={indentation:0,options:n,document:e.textDocument},a=[],u=this.iterateCstTree(e,o).iterator(),l,c;do if(c=u.next(),!c.done){let f=c.value,p=(0,$g.isLeafCstNode)(f),h=this.nodeModeToKey(f,"prepend"),d=r.get(h);if(r.delete(h),d){let x=this.createTextEdit(l,f,d,o);for(let T of x)T&&this.insideRange(T.range,i)&&this.isNecessary(T,e.textDocument)&&a.push(T)}let g=this.nodeModeToKey(f,"append"),C=r.get(g);if(r.delete(g),C){let x=(0,XA.getNextNode)(f);if(x){let T=this.createTextEdit(f,x,C,o);for(let v of T)v&&this.insideRange(v.range,i)&&this.isNecessary(v,e.textDocument)&&a.push(v)}}if(!d&&f.hidden){let x=this.createHiddenTextEdits(l,f,void 0,o);for(let T of x)T&&this.insideRange(T.range,i)&&this.isNecessary(T,e.textDocument)&&a.push(T)}p&&(l=f)}while(!c.done);return a}createHiddenTextEdits(e,r,n,i){var o;let a=r.range.start.line;if(e&&e.range.end.line===a)return[];let s=[],u={start:{character:0,line:a},end:r.range.start},l=i.document.getText(u),c=this.findFittingMove(u,(o=n?.moves)!==null&&o!==void 0?o:[],i),f=this.getExistingIndentationCharacterCount(l,i),h=this.getIndentationCharacterCount(i,c)-f;if(h===0)return[];let d="";h>0&&(d=(i.options.insertSpaces?" ":" ").repeat(h));let g=r.text.split(`
3603
3603
  `);g[0]=l+g[0];for(let C=0;C<g.length;C++){let x=a+C,T={character:0,line:x};if(h>0)s.push({newText:d,range:{start:T,end:T}});else{let v=g[C],k=0;for(;k<v.length;k++){let j=v.charAt(k);if(j!==" "&&j!==" ")break}s.push({newText:"",range:{start:T,end:{line:x,character:Math.min(k,Math.abs(h))}}})}}return s}getExistingIndentationCharacterCount(e,r){let n=" ".repeat(r.options.tabSize);return(r.options.insertSpaces?e.replaceAll(" ",n):e.replaceAll(n," ")).length}getIndentationCharacterCount(e,r){let n=e.indentation;return r&&r.tabs&&(n+=r.tabs),(e.options.insertSpaces?e.options.tabSize:1)*n}createTextEdit(e,r,n,i){var o;if(r.hidden)return this.createHiddenTextEdits(e,r,n,i);let a={start:(o=e?.range.end)!==null&&o!==void 0?o:{character:0,line:0},end:r.range.start},s=this.findFittingMove(a,n.moves,i);if(!s)return[];let u=s.characters,l=s.lines,c=s.tabs,f=i.indentation;i.indentation+=c??0;let p=[];return u!==void 0?p.push(this.createSpaceTextEdit(a,u,n.options)):l!==void 0?p.push(this.createLineTextEdit(a,l,i,n.options)):c!==void 0&&p.push(this.createTabTextEdit(a,!!e,i)),(0,$g.isLeafCstNode)(r)&&(i.indentation=f),p}createSpaceTextEdit(e,r,n){if(e.start.line===e.end.line){let o=e.end.character-e.start.character;r=this.fitIntoOptions(r,o,n)}return{newText:" ".repeat(r),range:e}}createLineTextEdit(e,r,n,i){let o=e.end.line-e.start.line;r=this.fitIntoOptions(r,o,i);let s=(n.options.insertSpaces?" ".repeat(n.options.tabSize):" ").repeat(n.indentation);return{newText:`${`
3604
3604
  `.repeat(r)}${s}`,range:e}}createTabTextEdit(e,r,n){let o=(n.options.insertSpaces?" ".repeat(n.options.tabSize):" ").repeat(n.indentation),a=r?1:0,s=Math.max(e.end.line-e.start.line,a);return{newText:`${`
3605
- `.repeat(s)}${o}`,range:e}}fitIntoOptions(e,r,n){return n.allowMore?e=Math.max(r,e):n.allowLess&&(e=Math.min(r,e)),e}findFittingMove(e,r,n){if(r.length===0)return;if(r.length===1)return r[0];let i=e.end.line-e.start.line;for(let o of r){if(o.lines!==void 0&&i<=o.lines)return o;if(o.lines===void 0&&i===0)return o}return r[r.length-1]}iterateCstTree(e,r){let i=e.parseResult.value.$cstNode;return i?new du.TreeStreamImpl(i,o=>this.iterateCst(o,r)):du.EMPTY_STREAM}iterateCst(e,r){if(!(0,$g.isCompositeCstNode)(e))return du.EMPTY_STREAM;let n=r.indentation;return new du.StreamImpl(()=>({index:0}),i=>i.index<e.children.length?{done:!1,value:e.children[i.index++]}:(r.indentation=n,du.DONE_RESULT))}};Fn.AbstractFormatter=Mg;var Zc=class{constructor(e,r){this.astNode=e,this.collector=r}node(e){return new Ir(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){let r=[];for(let n of e)n.$cstNode&&r.push(n.$cstNode);return new Ir(r,this.collector)}property(e,r){let n=(0,Xc.findNodeForProperty)(this.astNode.$cstNode,e,r);return new Ir(n?[n]:[],this.collector)}properties(...e){let r=[];for(let n of e){let i=(0,Xc.findNodesForProperty)(this.astNode.$cstNode,n);r.push(...i)}return new Ir(r,this.collector)}keyword(e,r){let n=(0,Xc.findNodeForKeyword)(this.astNode.$cstNode,e,r);return new Ir(n?[n]:[],this.collector)}keywords(...e){let r=[];for(let n of e){let i=(0,Xc.findNodesForKeyword)(this.astNode.$cstNode,n);r.push(...i)}return new Ir(r,this.collector)}cst(e){return new Ir([...e],this.collector)}interior(e,r){let n=e.nodes,i=r.nodes;if(n.length!==1||i.length!==1)return new Ir([],this.collector);let o=n[0],a=i[0];if(o.offset>a.offset){let s=o;o=a,a=s}return new Ir((0,XA.getInteriorNodes)(o,a),this.collector)}};Fn.DefaultNodeFormatter=Zc;var Ir=class{constructor(e,r){this.nodes=e,this.collector=r}prepend(e){for(let r of this.nodes)this.collector(r,"prepend",e);return this}append(e){for(let r of this.nodes)this.collector(r,"append",e);return this}surround(e){for(let r of this.nodes)this.collector(r,"prepend",e),this.collector(r,"append",e);return this}slice(e,r){return new Ir(this.nodes.slice(e,r),this.collector)}};Fn.FormattingRegion=Ir;var fq;(function(t){function e(...c){return{options:{},moves:c.flatMap(f=>f.moves).sort(l)}}t.fit=e;function r(c){return i(0,c)}t.noSpace=r;function n(c){return i(1,c)}t.oneSpace=n;function i(c,f){return{options:f??{},moves:[{characters:c}]}}t.spaces=i;function o(c){return a(1,c)}t.newLine=o;function a(c,f){return{options:f??{},moves:[{lines:c}]}}t.newLines=a;function s(c){return{options:c??{},moves:[{tabs:1,lines:1}]}}t.indent=s;function u(c){return{options:c??{},moves:[{tabs:0}]}}t.noIndent=u;function l(c,f){var p,h,d,g,C,x;let T=(p=c.lines)!==null&&p!==void 0?p:0,v=(h=f.lines)!==null&&h!==void 0?h:0,k=(d=c.tabs)!==null&&d!==void 0?d:0,j=(g=f.tabs)!==null&&g!==void 0?g:0,O=(C=c.characters)!==null&&C!==void 0?C:0,$=(x=f.characters)!==null&&x!==void 0?x:0;return T<v?-1:T>v?1:k<j?-1:k>j?1:O<$?-1:O>$?1:0}})(fq=Fn.Formatting||(Fn.Formatting={}))});var ZA=b(ui=>{"use strict";var dq=ui&&ui.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),pq=ui&&ui.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hq=ui&&ui.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dq(e,t,r);return pq(e,t),e};Object.defineProperty(ui,"__esModule",{value:!0});ui.LangiumGrammarFormatter=void 0;var Fe=Lg(),co=hq(ot()),Fg=class extends Fe.AbstractFormatter{format(e){if(co.isCrossReference(e))this.getNodeFormatter(e).properties("type","terminal").surround(Fe.Formatting.noSpace());else if(co.isParserRule(e)){let r=this.getNodeFormatter(e);r.keywords("entry","fragment","returns").append(Fe.Formatting.oneSpace()),(e.inferredType||e.returnType||e.dataType)&&e.parameters.length===0?r.property("name").append(Fe.Formatting.oneSpace()):r.property("name").append(Fe.Formatting.noSpace()),r.properties("parameters").append(Fe.Formatting.noSpace()),r.keywords(",").append(Fe.Formatting.oneSpace()),r.keywords("<").append(Fe.Formatting.noSpace());let n=r.keyword(";"),i=r.keyword(":");i.prepend(Fe.Formatting.noSpace()),r.interior(i,n).prepend(Fe.Formatting.indent()),n.prepend(Fe.Formatting.fit(Fe.Formatting.noSpace(),Fe.Formatting.newLine())),r.node(e).prepend(Fe.Formatting.noIndent())}else if(co.isTerminalRule(e)){let r=this.getNodeFormatter(e);e.type&&(r.property("name").append(Fe.Formatting.oneSpace()),r.keyword("returns").append(Fe.Formatting.oneSpace())),r.keywords("hidden","terminal","fragment").append(Fe.Formatting.oneSpace()),r.keyword(":").prepend(Fe.Formatting.noSpace()),r.keyword(";").prepend(Fe.Formatting.fit(Fe.Formatting.noSpace(),Fe.Formatting.newLine())),r.node(e).prepend(Fe.Formatting.noIndent())}else if(co.isAction(e)){let r=this.getNodeFormatter(e);r.keyword("{").append(Fe.Formatting.noSpace()),r.keywords(".","+=","=").surround(Fe.Formatting.noSpace()),r.keyword("}").prepend(Fe.Formatting.noSpace())}else if(co.isInferredType(e))this.getNodeFormatter(e).keywords("infer","infers").append(Fe.Formatting.oneSpace());else if(co.isAssignment(e))this.getNodeFormatter(e).keywords("=","+=","?=").surround(Fe.Formatting.noSpace());else if(co.isRuleCall(e)){let r=this.getNodeFormatter(e);r.keyword("<").surround(Fe.Formatting.noSpace()),r.keyword(",").append(Fe.Formatting.oneSpace()),r.properties("arguments").append(Fe.Formatting.noSpace())}co.isAbstractElement(e)&&this.getNodeFormatter(e).property("cardinality").prepend(Fe.Formatting.noSpace())}};ui.LangiumGrammarFormatter=Fg});var ef=b(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.SemanticTokensDecoder=qt.AbstractSemanticTokenProvider=qt.SemanticTokensBuilder=qt.DefaultSemanticTokenOptions=qt.AllSemanticTokenModifiers=qt.AllSemanticTokenTypes=void 0;var be=Xe(),Jc=Wt(),mq=Ie();qt.AllSemanticTokenTypes={[be.SemanticTokenTypes.class]:0,[be.SemanticTokenTypes.comment]:1,[be.SemanticTokenTypes.enum]:2,[be.SemanticTokenTypes.enumMember]:3,[be.SemanticTokenTypes.event]:4,[be.SemanticTokenTypes.function]:5,[be.SemanticTokenTypes.interface]:6,[be.SemanticTokenTypes.keyword]:7,[be.SemanticTokenTypes.macro]:8,[be.SemanticTokenTypes.method]:9,[be.SemanticTokenTypes.modifier]:10,[be.SemanticTokenTypes.namespace]:11,[be.SemanticTokenTypes.number]:12,[be.SemanticTokenTypes.operator]:13,[be.SemanticTokenTypes.parameter]:14,[be.SemanticTokenTypes.property]:15,[be.SemanticTokenTypes.regexp]:16,[be.SemanticTokenTypes.string]:17,[be.SemanticTokenTypes.struct]:18,[be.SemanticTokenTypes.type]:19,[be.SemanticTokenTypes.typeParameter]:20,[be.SemanticTokenTypes.variable]:21};qt.AllSemanticTokenModifiers={[be.SemanticTokenModifiers.abstract]:1<<0,[be.SemanticTokenModifiers.async]:1<<1,[be.SemanticTokenModifiers.declaration]:1<<2,[be.SemanticTokenModifiers.defaultLibrary]:1<<3,[be.SemanticTokenModifiers.definition]:1<<4,[be.SemanticTokenModifiers.deprecated]:1<<5,[be.SemanticTokenModifiers.documentation]:1<<6,[be.SemanticTokenModifiers.modification]:1<<7,[be.SemanticTokenModifiers.readonly]:1<<8,[be.SemanticTokenModifiers.static]:1<<9};qt.DefaultSemanticTokenOptions={legend:{tokenTypes:Object.keys(qt.AllSemanticTokenTypes),tokenModifiers:Object.keys(qt.AllSemanticTokenModifiers)},full:{delta:!0},range:!0};var Qc=class extends be.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,r,n,i,o){this._tokens.push({line:e,char:r,length:n,tokenType:i,tokenModifiers:o})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}applyTokens(){for(let e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,r){return e.line===r.line?e.char-r.char:e.line-r.line}};qt.SemanticTokensBuilder=Qc;var qg=class{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(r=>{this.tokensBuilders.delete(r.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(r=>{var n;this.initialize((n=r.capabilities.textDocument)===null||n===void 0?void 0:n.semanticTokens)})}initialize(e){this.clientCapabilities=e}semanticHighlight(e,r,n=be.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}semanticHighlightRange(e,r,n=be.CancellationToken.None){return this.currentRange=r.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}semanticHighlightDelta(e,r,n=be.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(r.previousResultId),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.buildEdits()}createAcceptor(){return r=>{"line"in r?this.highlightToken({range:{start:{line:r.line,character:r.char},end:{line:r.line,character:r.char+r.length}},type:r.type,modifier:r.modifier}):"range"in r?this.highlightToken(r):"keyword"in r?this.highlightKeyword(r):"property"in r?this.highlightProperty(r):this.highlightNode({node:r.cst,type:r.type,modifier:r.modifier})}}getDocumentTokensBuilder(e){let r=this.tokensBuilders.get(e.uri.toString());if(r)return r;let n=new Qc;return this.tokensBuilders.set(e.uri.toString(),n),n}computeHighlighting(e,r,n){let i=e.parseResult.value;if(this.highlightElement(i,r)==="prune")return;let o=(0,mq.streamAllContents)(i).iterator(),a;do if(a=o.next(),!a.done){if(n.isCancellationRequested)break;let s=a.value,u=s.$cstNode.range,l=this.compareRange(u);if(l===1)break;if(l===-1)continue;this.highlightElement(s,r)==="prune"&&o.prune()}while(!a.done)}compareRange(e){if(!this.currentRange)return 0;let r=typeof e=="number"?e:e.start.line;return(typeof e=="number"?e:e.end.line)<this.currentRange.start.line?-1:r>this.currentRange.end.line?1:0}highlightToken(e){var r;let{range:n,type:i}=e,o=e.modifier;if(this.compareRange(n)!==0||!this.currentDocument||!this.currentTokensBuilder)return;let a=qt.AllSemanticTokenTypes[i],s=0;if(o!==void 0){typeof o=="string"&&(o=[o]);for(let c of o){let f=qt.AllSemanticTokenModifiers[c];s|=f}}let u=n.start.line,l=n.end.line;if(u===l){let c=n.start.character,f=n.end.character-c;this.currentTokensBuilder.push(u,c,f,a,s)}else if(!((r=this.clientCapabilities)===null||r===void 0)&&r.multilineTokenSupport){let c=n.start.character,f=this.currentDocument.textDocument.offsetAt(n.start),p=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(u,c,p-f,a,s)}else{let c=n.start,f=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(c.line,c.character,f-c.character-1,a,s);for(let p=u+1;p<l;p++){let h=f;f=this.currentDocument.textDocument.offsetAt({line:p+1,character:0}),this.currentTokensBuilder.push(p,0,f-h-1,a,s)}this.currentTokensBuilder.push(l,0,n.end.character,a,s)}}highlightProperty(e){let r=[];if(typeof e.index=="number"){let o=(0,Jc.findNodeForProperty)(e.node.$cstNode,e.property,e.index);o&&r.push(o)}else r.push(...(0,Jc.findNodesForProperty)(e.node.$cstNode,e.property));let{type:n,modifier:i}=e;for(let o of r)this.highlightNode({node:o,type:n,modifier:i})}highlightKeyword(e){let{node:r,keyword:n,type:i,index:o,modifier:a}=e,s=[];if(typeof o=="number"){let u=(0,Jc.findNodeForKeyword)(r.$cstNode,n,o);u&&s.push(u)}else s.push(...(0,Jc.findNodesForKeyword)(r.$cstNode,n));for(let u of s)this.highlightNode({node:u,type:i,modifier:a})}highlightNode(e){let{node:r,type:n,modifier:i}=e,o=r.range;this.highlightToken({range:o,type:n,modifier:i})}};qt.AbstractSemanticTokenProvider=qg;var gq;(function(t){function e(n,i){let o=new Map;Object.entries(qt.AllSemanticTokenTypes).forEach(([u,l])=>o.set(l,u));let a=0,s=0;return r(n.data,5).map(u=>{a+=u[0],u[0]!==0&&(s=0),s+=u[1];let l=u[2];return{offset:i.textDocument.offsetAt({line:a,character:s}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:i.textDocument.getText({start:{line:a,character:s},end:{line:a,character:s+l}})}})}t.decode=e;function r(n,i){let o=[];for(let a=0;a<n.length;a+=i){let s=n.slice(a,a+i);o.push(s)}return o}})(gq=qt.SemanticTokensDecoder||(qt.SemanticTokensDecoder={}))});var JA=b(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.LangiumGrammarSemanticTokenProvider=void 0;var Go=Xe(),yq=ef(),Uo=ot(),jg=class extends yq.AbstractSemanticTokenProvider{highlightElement(e,r){var n;(0,Uo.isAssignment)(e)?r({node:e,property:"feature",type:Go.SemanticTokenTypes.property}):(0,Uo.isAction)(e)?e.feature&&r({node:e,property:"feature",type:Go.SemanticTokenTypes.property}):(0,Uo.isReturnType)(e)?r({node:e,property:"name",type:Go.SemanticTokenTypes.type}):(0,Uo.isAtomType)(e)?(e.primitiveType||e.refType)&&r({node:e,property:e.primitiveType?"primitiveType":"refType",type:Go.SemanticTokenTypes.type}):(0,Uo.isParameter)(e)?r({node:e,property:"name",type:Go.SemanticTokenTypes.parameter}):(0,Uo.isParameterReference)(e)?r({node:e,property:"parameter",type:Go.SemanticTokenTypes.parameter}):(0,Uo.isRuleCall)(e)&&!((n=e.rule.ref)===null||n===void 0)&&n.fragment&&r({node:e,property:"rule",type:Go.SemanticTokenTypes.type})}};tf.LangiumGrammarSemanticTokenProvider=jg});var eE=b(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.LangiumGrammarNameProvider=void 0;var vq=Ua(),_q=Wt(),QA=ot(),Gg=class extends vq.DefaultNameProvider{getName(e){return(0,QA.isAssignment)(e)?e.feature:super.getName(e)}getNameNode(e){return(0,QA.isAssignment)(e)?(0,_q.findNodeForProperty)(e.$cstNode,"feature"):super.getNameNode(e)}};rf.LangiumGrammarNameProvider=Gg});var Hg=b(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.DefaultReferences=void 0;var Tq=Wt(),li=Ie(),tE=pt(),rE=Bt(),Rq=uo(),Ug=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let r=(0,Tq.findAssignment)(e),n=e.element;if(r&&n){let i=n[r.feature];if((0,li.isReference)(i))return i.ref;if(Array.isArray(i)){for(let o of i)if((0,li.isReference)(o)&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return o.ref}else return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r?.$cstNode){let n=this.nameProvider.getNameNode(r);return n||r.$cstNode}}findReferences(e,r){return r.onlyLocal?this.findLocalReferences(e,r.includeDeclaration):this.findGlobalReferences(e,r.includeDeclaration)}findGlobalReferences(e,r=!1){let n=[];if(r){let i=this.getReferenceToSelf(e);i&&n.push(i)}return n.push(...this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e))),(0,rE.stream)(n)}findLocalReferences(e,r=!1){let i=(0,li.getDocument)(e).parseResult.value,o=[];if(r){let s=this.getReferenceToSelf(e);s&&o.push(s)}let a=[];return(0,li.streamAst)(i).forEach(s=>{(0,li.streamReferences)(s).forEach(u=>{u.reference.ref===e&&a.push(u.reference)})}),a.forEach(s=>{o.push({sourceUri:(0,li.getDocument)(s.$refNode.element).uri,sourcePath:this.nodeLocator.getAstNodePath(s.$refNode.element),targetUri:(0,li.getDocument)(e).uri,targetPath:this.nodeLocator.getAstNodePath(e),segment:(0,tE.toDocumentSegment)(s.$refNode),local:(0,Rq.equalURI)((0,li.getDocument)(s.$refNode.element).uri,(0,li.getDocument)(e).uri)})}),(0,rE.stream)(o)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=(0,li.getDocument)(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:(0,tE.toDocumentSegment)(r),local:!0}}}};nf.DefaultReferences=Ug});var sE=b(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.LangiumGrammarReferences=void 0;var bq=Hg(),gr=Ie(),nE=pt(),iE=Wt(),oE=Bt(),Bg=uo(),ar=ot(),aE=ir(),of=so(),Wg=class extends bq.DefaultReferences{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}findDeclaration(e){let r=e.element,n=(0,iE.findAssignment)(e);if(n&&n.feature==="feature"){if((0,ar.isAssignment)(r))return this.findAssignmentDeclaration(r);if((0,ar.isAction)(r))return this.findActionDeclaration(r)}return super.findDeclaration(e)}findLocalReferences(e,r=!1){if((0,ar.isTypeAttribute)(e)){let i=(0,gr.getDocument)(e).parseResult.value;return this.findLocalReferencesToTypeAttribute(e,i,r)}else return super.findLocalReferences(e,r)}findGlobalReferences(e,r=!1){return(0,ar.isTypeAttribute)(e)?this.findReferencesToTypeAttribute(e,r):super.findGlobalReferences(e,r)}findLocalReferencesToTypeAttribute(e,r,n){let i=[],o=(0,gr.getContainerOfType)(e,ar.isInterface);if(o){let a=(0,of.collectChildrenTypes)(o,this,this.documents,this.nodeLocator),s=[];if(a.forEach(u=>{let l=this.findLocalRulesWithReturnType(u,r);s.push(...l)}),(0,Bg.equalURI)((0,gr.getDocument)(e).uri,(0,gr.getDocument)(r).uri)&&n){let u=this.getReferenceToSelf(e);u&&i.push(u)}s.forEach(u=>{let l=this.createReferencesToAttribute(u,e);i.push(...l)})}return(0,oE.stream)(i)}findReferencesToTypeAttribute(e,r){let n=[],i=(0,gr.getContainerOfType)(e,ar.isInterface);if(i){if(r){let s=this.getReferenceToSelf(e);s&&n.push(s)}let o=(0,of.collectChildrenTypes)(i,this,this.documents,this.nodeLocator),a=[];o.forEach(s=>{let u=this.findRulesWithReturnType(s);a.push(...u)}),a.forEach(s=>{let u=this.createReferencesToAttribute(s,e);n.push(...u)})}return(0,oE.stream)(n)}createReferencesToAttribute(e,r){let n=[];if((0,ar.isParserRule)(e)){let i=(0,aE.extractAssignments)(e.definition).find(o=>o.feature===r.name);if(i?.$cstNode){let o=this.nameProvider.getNameNode(i);o&&n.push({sourceUri:(0,gr.getDocument)(i).uri,sourcePath:this.nodeLocator.getAstNodePath(i),targetUri:(0,gr.getDocument)(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:(0,nE.toDocumentSegment)(o),local:(0,Bg.equalURI)((0,gr.getDocument)(i).uri,(0,gr.getDocument)(r).uri)})}}else{if(e.feature===r.name){let o=(0,iE.findNodeForProperty)(e.$cstNode,"feature");o&&n.push({sourceUri:(0,gr.getDocument)(e).uri,sourcePath:this.nodeLocator.getAstNodePath(e),targetUri:(0,gr.getDocument)(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:(0,nE.toDocumentSegment)(o),local:(0,Bg.equalURI)((0,gr.getDocument)(e).uri,(0,gr.getDocument)(r).uri)})}let i=(0,gr.getContainerOfType)(e,ar.isParserRule);n.push(...this.createReferencesToAttribute(i,r))}return n}findAssignmentDeclaration(e){var r;let n=(0,gr.getContainerOfType)(e,ar.isParserRule),i=(0,aE.getActionAtElement)(e);if(i){let o=this.findActionDeclaration(i,e.feature);if(o)return o}if(!((r=n?.returnType)===null||r===void 0)&&r.ref&&((0,ar.isInterface)(n.returnType.ref)||(0,ar.isType)(n.returnType.ref))){let o=(0,of.collectSuperTypes)(n.returnType.ref);for(let a of o){let s=a.attributes.find(u=>u.name===e.feature);if(s)return s}}return e}findActionDeclaration(e,r){var n;if(!((n=e.type)===null||n===void 0)&&n.ref){let i=r??e.feature,o=(0,of.collectSuperTypes)(e.type.ref);for(let a of o){let s=a.attributes.find(u=>u.name===i);if(s)return s}}}findRulesWithReturnType(e){let r=[];return this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)).forEach(i=>{let o=this.documents.getOrCreateDocument(i.sourceUri),a=this.nodeLocator.getAstNode(o,i.sourcePath);((0,ar.isParserRule)(a)||(0,ar.isAction)(a))&&r.push(a)}),r}findLocalRulesWithReturnType(e,r){let n=[];return(0,gr.streamAst)(r).filter(o=>{var a,s;return(0,ar.isParserRule)(o)&&((a=o.returnType)===null||a===void 0?void 0:a.ref)===e||(0,ar.isAction)(o)&&((s=o.type)===null||s===void 0?void 0:s.ref)===e}).forEach(o=>{((0,ar.isParserRule)(o)||(0,ar.isAction)(o))&&n.push(o)}),n}};af.LangiumGrammarReferences=Wg});var Vg=b(an=>{"use strict";var Aq=an&&an.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Eq=an&&an.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cq=an&&an.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Aq(e,t,r);return Eq(e,t),e};Object.defineProperty(an,"__esModule",{value:!0});an.findFirstFeatures=an.findNextFeatures=void 0;var yr=Cq(ot()),Mi=ir(),uE=Ie(),xq=Wt();function wq(t,e){let r={stacks:t,tokens:e};return Sq(r),r.stacks.flat().forEach(i=>{i.property=void 0}),fE(r.stacks).map(i=>i[i.length-1])}an.findNextFeatures=wq;function Kg(t){let{next:e,cardinalities:r,visited:n,plus:i}=t,o=[],a=e.feature;if(n.has(a))return[];n.add(a);let s,u=a;for(;u.$container;)if(yr.isGroup(u.$container)){s=u.$container;break}else if(yr.isAbstractElement(u.$container))u=u.$container;else break;if((0,Mi.isArrayCardinality)(u.cardinality)){let l=Ba({next:{feature:u,type:e.type,new:!1},cardinalities:r,visited:n,plus:i});for(let c of l)i.add(c.feature);o.push(...l)}if(s){let l=s.elements.indexOf(u);l!==void 0&&l<s.elements.length-1&&o.push(...cE({feature:s,type:e.type,new:!1},l+1,r,n,i)),o.every(c=>(0,Mi.isOptionalCardinality)(c.feature.cardinality)||(0,Mi.isOptionalCardinality)(r.get(c.feature))||i.has(c.feature))&&o.push(...Kg({next:{feature:s,type:e.type,new:!1},cardinalities:r,visited:n,plus:i}))}return o}function lE(t){return(0,uE.isAstNode)(t)&&(t={feature:t}),Ba({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}an.findFirstFeatures=lE;function Ba(t){var e,r,n;let{next:i,cardinalities:o,visited:a,plus:s}=t;if(i===void 0)return[];let{feature:u,type:l}=i;if(yr.isGroup(u)){if(a.has(u))return[];a.add(u)}if(yr.isGroup(u))return cE(i,0,o,a,s).map(c=>sf(c,u.cardinality,o));if(yr.isAlternatives(u)||yr.isUnorderedGroup(u))return u.elements.flatMap(c=>Ba({next:{feature:c,new:!1,type:l},cardinalities:o,visited:a,plus:s})).map(c=>sf(c,u.cardinality,o));if(yr.isAssignment(u)){let c={feature:u.terminal,new:!1,type:l,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return Ba({next:c,cardinalities:o,visited:a,plus:s}).map(f=>sf(f,u.cardinality,o))}else{if(yr.isAction(u))return Kg({next:{feature:u,new:!0,type:(0,Mi.getTypeName)(u),property:(r=i.property)!==null&&r!==void 0?r:u.feature},cardinalities:o,visited:a,plus:s});if(yr.isRuleCall(u)&&yr.isParserRule(u.rule.ref)){let c=u.rule.ref,f={feature:c.definition,new:!0,type:c.fragment?void 0:(n=(0,Mi.getExplicitRuleType)(c))!==null&&n!==void 0?n:c.name,property:i.property};return Ba({next:f,cardinalities:o,visited:a,plus:s}).map(p=>sf(p,u.cardinality,o))}else return[i]}}function sf(t,e,r){return r.set(t.feature,e),t}function cE(t,e,r,n,i){var o;let a=[],s;for(;e<t.feature.elements.length&&(s={feature:t.feature.elements[e++],new:!1,type:t.type},a.push(...Ba({next:s,cardinalities:r,visited:n,plus:i})),!!(0,Mi.isOptionalCardinality)((o=s.feature.cardinality)!==null&&o!==void 0?o:r.get(s.feature))););return a}function Sq(t){for(let e of t.tokens){let r=fE(t.stacks,e);t.stacks=r}}function fE(t,e){let r=[];for(let n of t)r.push(...kq(n,e));return r}function kq(t,e){let r=new Map,n=new Set(t.map(o=>o.feature).filter(Pq)),i=[];for(;t.length>0;){let o=t.pop(),a=Kg({next:o,cardinalities:r,plus:n,visited:new Set}).filter(s=>e?zg(s.feature,e):!0);for(let s of a)i.push([...t,s]);if(!a.every(s=>(0,Mi.isOptionalCardinality)(s.feature.cardinality)||(0,Mi.isOptionalCardinality)(r.get(s.feature))))break}return i}function Pq(t){if(t.cardinality==="+")return!0;let e=(0,uE.getContainerOfType)(t,yr.isAssignment);return!!(e&&e.cardinality==="+")}function zg(t,e){if(yr.isKeyword(t))return t.value===e.image;if(yr.isRuleCall(t))return Dq(t.rule.ref,e);if(yr.isCrossReference(t)){let r=(0,xq.getCrossReferenceTerminal)(t);if(r)return zg(r,e)}return!1}function Dq(t,e){return yr.isParserRule(t)?lE(t.definition).some(n=>zg(n.feature,e)):yr.isTerminalRule(t)?new RegExp((0,Mi.terminalRegex)(t)).test(e.image):!1}});var Zg=b(ci=>{"use strict";var Nq=ci&&ci.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Oq=ci&&ci.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Iq=ci&&ci.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Nq(e,t,r);return Oq(e,t),e};Object.defineProperty(ci,"__esModule",{value:!0});ci.DefaultCompletionProvider=void 0;var pu=Xe(),hu=Iq(ot()),$q=ir(),Yg=Ie(),Mq=pt(),dE=Wt(),pE=Bt(),uf=Vg(),Xg=class{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async getCompletion(e,r){let i=e.parseResult.value.$cstNode;if(!i)return;let o=[],a=e.textDocument,s=a.getText(),u=a.offsetAt(r.position),l=(C,x)=>{let T=this.fillCompletionItem(a,u,C,x);T&&o.push(T)},c=(0,Mq.findLeafNodeAtOffset)(i,this.backtrackToAnyToken(s,u));if(!c){let C=(0,dE.getEntryRule)(this.grammar);return await this.completionForRule(void 0,C,l),pu.CompletionList.create(o,!0)}let f=this.backtrackToTokenStart(s,u),p=this.findFeaturesAt(a,f),h=[],d=u!==f;d&&(h=this.findFeaturesAt(a,u));let g=C=>hu.isKeyword(C.feature)?C.feature.value:C.feature;if(await Promise.all((0,pE.stream)(p).distinct(g).map(C=>this.completionFor(c.element,C,l))),d){let C=a.getText({start:a.positionAt(f),end:r.position}).toLowerCase();o=o.filter(x=>x.label.toLowerCase().startsWith(C)),await Promise.all((0,pE.stream)(h).exclude(p,g).distinct(g).map(x=>this.completionFor(c.element,x,l)))}return pu.CompletionList.create(o,!0)}findFeaturesAt(e,r){let n=e.getText({start:pu.Position.create(0,0),end:e.positionAt(r)}),i=this.completionParser.parse(n),o=i.tokens;if(i.tokenIndex===0){let u=(0,dE.getEntryRule)(this.grammar),l=(0,uf.findFirstFeatures)({feature:u.definition,new:!0,type:(0,$q.getExplicitRuleType)(u)});return o.length>0?(o.shift(),(0,uf.findNextFeatures)(l.map(c=>[c]),o)):l}let a=[...o].splice(i.tokenIndex);return(0,uf.findNextFeatures)([i.elementStack.map(u=>({feature:u}))],a)}backtrackToAnyToken(e,r){for(r>=e.length&&(r=e.length-1);r>0&&/\s/.test(e.charAt(r));)r--;return r}backtrackToTokenStart(e,r){if(r<1)return r;let n=this.grammarConfig.nameRegexp,i=e.charAt(r-1);for(;r>0&&n.test(i);)r--,i=e.charAt(r-1);return r}async completionForRule(e,r,n){if(hu.isParserRule(r)){let i=(0,uf.findFirstFeatures)(r.definition);await Promise.all(i.map(o=>this.completionFor(e,o,n)))}}completionFor(e,r,n){if(hu.isKeyword(r.feature))return this.completionForKeyword(r.feature,e,n);if(hu.isCrossReference(r.feature)&&e)return this.completionForCrossReference(r,e,n)}completionForCrossReference(e,r,n){let i=(0,Yg.getContainerOfType)(e.feature,hu.isAssignment);if(i){if(e.type&&(e.new||r?.$type!==e.type)&&(r={$type:e.type,$container:r,$containerProperty:e.property}),!r)return;let o={reference:{},container:r,property:i.feature};try{let a=this.scopeProvider.getScope(o),s=new Set;a.getAllElements().forEach(u=>{!s.has(u.name)&&this.filterCrossReference(u)&&(n(u,this.createReferenceCompletionItem(u)),s.add(u.name))})}catch(a){console.error(a)}}}createReferenceCompletionItem(e){return{kind:pu.CompletionItemKind.Reference,detail:e.type,sortText:"0"}}filterCrossReference(e){return!0}completionForKeyword(e,r,n){!e.value.match(/[\w]+/)||n(e.value,{kind:pu.CompletionItemKind.Keyword,detail:"Keyword",sortText:/\w/.test(e.value)?"1":"2"})}fillCompletionItem(e,r,n,i){let o;if(typeof n=="string")o=n;else if((0,Yg.isAstNode)(n)){let u=this.nameProvider.getName(n);if(!u)return;o=u}else if(!(0,Yg.isAstNode)(n))o=n.name;else return;let a=this.buildCompletionTextEdit(e,r,o);return a?Object.assign({label:o,textEdit:a},i):void 0}buildCompletionTextEdit(e,r,n){let i=0,o=e.getText(),a=o.toLowerCase(),s=n.toLowerCase();for(let u=s.length;u>0;u--){let l=a.substring(r-u,r);if(s.startsWith(l)&&(u===0||!this.isWordCharacterAt(a,r-u-1))){i=u;break}}if(i>0||r===0||!this.isWordCharacterAt(n,0)||!this.isWordCharacterAt(o,r-1)){let u=e.positionAt(r-i),l=e.positionAt(r);return{newText:n,range:{start:u,end:l}}}else return}isWordCharacterAt(e,r){return this.grammarConfig.nameRegexp.test(e.charAt(r))}};ci.DefaultCompletionProvider=Xg});var mE=b(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0})});var Qg=b(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.DefaultDocumentHighlightProvider=void 0;var Lq=Xe(),Fq=Ie(),qq=pt(),jq=uo(),Jg=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,r){let n=e.parseResult.value.$cstNode;if(!n)return;let i=(0,qq.findDeclarationNodeAtOffset)(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclaration(i);if(o){let a=[],u={onlyLocal:!0,includeDeclaration:(0,jq.equalURI)((0,Fq.getDocument)(o).uri,e.uri)};return this.references.findReferences(o,u).forEach(l=>{a.push(this.createDocumentHighlight(l))}),a}}createDocumentHighlight(e){return Lq.DocumentHighlight.create(e.segment.range)}};lf.DefaultDocumentHighlightProvider=Jg});var yE=b(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0})});var ty=b(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.DefaultDocumentSymbolProvider=void 0;var Gq=Xe(),Uq=Ie(),ey=class{constructor(e){this.nameProvider=e.references.NameProvider}getSymbols(e){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,r){let n=r.$cstNode,i=this.nameProvider.getNameNode(r);if(i&&n){let o=this.nameProvider.getName(r);return[{kind:this.getSymbolKind(r.$type),name:o??i.text,range:n.range,selectionRange:i.range,children:this.getChildSymbols(e,r)}]}else return this.getChildSymbols(e,r)||[]}getChildSymbols(e,r){let n=[];for(let i of(0,Uq.streamContents)(r)){let o=this.getSymbol(e,i);n.push(...o)}if(n.length>0)return n}getSymbolKind(e){return Gq.SymbolKind.Field}};cf.DefaultDocumentSymbolProvider=ey});var vE=b(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.AbstractExecuteCommandHandler=void 0;var Hq=Xe(),ry=class{constructor(){this.registeredCommands=new Map,this.registerCommands(this.createCommandAcceptor())}get commands(){return Array.from(this.registeredCommands.keys())}async executeCommand(e,r,n=Hq.CancellationToken.None){let i=this.registeredCommands.get(e);if(i)return i(r,n)}createCommandAcceptor(){return(e,r)=>this.registeredCommands.set(e,r)}};ff.AbstractExecuteCommandHandler=ry});var iy=b(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.DefaultDefinitionProvider=void 0;var Bq=Xe(),Wq=Ie(),Kq=pt(),ny=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,r){let n=e.parseResult.value;if(n.$cstNode){let i=n.$cstNode,o=(0,Kq.findDeclarationNodeAtOffset)(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,r)}}collectLocationLinks(e,r){var n;let i=this.findLink(e);if(i)return[Bq.LocationLink.create(i.targetDocument.textDocument.uri,((n=i.target.element.$cstNode)!==null&&n!==void 0?n:i.target).range,i.target.range,i.source.range)]}findLink(e){let r=this.references.findDeclarationNode(e);if(r?.element){let n=(0,Wq.getDocument)(r.element);if(r&&n)return{source:e,target:r,targetDocument:n}}}};df.DefaultDefinitionProvider=ny});var ay=b(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.MultilineCommentHoverProvider=Wa.AstNodeHoverProvider=void 0;var _E=pt(),pf=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,r){var n,i;let o=(i=(n=e.parseResult)===null||n===void 0?void 0:n.value)===null||i===void 0?void 0:i.$cstNode;if(o){let a=e.textDocument.offsetAt(r.position),s=(0,_E.findDeclarationNodeAtOffset)(o,a,this.grammarConfig.nameRegexp);if(s&&s.offset+s.length>a){let u=this.references.findDeclaration(s);if(u)return this.getAstNodeHoverContent(u)}}}};Wa.AstNodeHoverProvider=pf;var oy=class extends pf{constructor(){super(...arguments),this.commentContentRegex=/\/\*([\s\S]*?)\*\//}getAstNodeHoverContent(e){let r=(0,_E.findCommentNode)(e.$cstNode,this.grammarConfig.multilineCommentRules),n;if(r){let i=this.commentContentRegex.exec(r.text);i&&i[1]&&(n=this.getCommentContent(i[1]))}if(n)return{contents:{kind:"markdown",value:n}}}getCommentContent(e){return e.split(`
3606
- `).map(n=>(n=n.trim(),n.startsWith("*")&&(n=n.substring(1).trim()),n)).join(" ").trim()}};Wa.MultilineCommentHoverProvider=oy});var TE=b(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.AbstractGoToImplementationProvider=void 0;var zq=Xe(),Vq=pt(),sy=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getImplementation(e,r,n=zq.CancellationToken.None){let i=e.parseResult.value;if(i.$cstNode){let o=(0,Vq.findDeclarationNodeAtOffset)(i.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o){let a=this.references.findDeclaration(o);if(a)return this.collectGoToImplementationLocationLinks(a,n)}}}};hf.AbstractGoToImplementationProvider=sy});var Ho=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.DefaultLangiumDocuments=qn.DefaultLangiumDocumentFactory=qn.DefaultTextDocumentFactory=qn.DocumentState=void 0;var RE=_c(),Yq=$n(),Xq=Bt(),fy;(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"})(fy=qn.DocumentState||(qn.DocumentState={}));var uy=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.fileSystemProvider=e.workspace.FileSystemProvider}fromUri(e){let r=this.getContent(e),n=this.serviceRegistry.getServices(e);return RE.TextDocument.create(e.toString(),n.LanguageMetaData.languageId,0,r)}getContent(e){return this.fileSystemProvider.readFileSync(e)}};qn.DefaultTextDocumentFactory=uy;var ly=class{constructor(e){this.serviceRegistry=e.ServiceRegistry}fromTextDocument(e,r){return this.create(e,void 0,void 0,r)}fromString(e,r){return this.create(void 0,e,void 0,r)}fromModel(e,r){return this.create(void 0,void 0,e,r)}create(e,r,n,i){i===void 0&&(i=Yq.URI.parse(e.uri));let o=this.serviceRegistry.getServices(i),a;return n===void 0?a=o.parser.LangiumParser.parse(r??e.getText()):a={value:n,parserErrors:[],lexerErrors:[]},this.createLangiumDocument(a,i,e??{$template:!0,languageId:o.LanguageMetaData.languageId,uri:i,text:r})}createLangiumDocument(e,r,n){let i,o=this,a={parseResult:e,uri:r,state:fy.Parsed,references:[],get textDocument(){return i||(i=n.$template?o.createTextDocument(n):n),i}};return e.value.$document=a,a}createTextDocument(e){var r;return RE.TextDocument.create(e.uri.toString(),e.languageId,0,(r=e.text)!==null&&r!==void 0?r:"")}};qn.DefaultLangiumDocumentFactory=ly;var cy=class{constructor(e){this.documentMap=new Map,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return(0,Xq.stream)(this.documentMap.values())}addDocument(e){let r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getOrCreateDocument(e){let r=e.toString(),n=this.documentMap.get(r);if(n)return n;let i=this.textDocuments.get(r);return i?n=this.langiumDocumentFactory.fromTextDocument(i,e):n=this.langiumDocumentFactory.fromString(this.getContent(e),e),this.documentMap.set(r,n),n}getContent(e){return this.fileSystemProvider.readFileSync(e)}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);n&&(n.state=fy.Changed,this.documentMap.delete(r))}};qn.DefaultLangiumDocuments=cy});var py=b(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.mergeSignatureHelpOptions=Ka.AbstractSignatureHelpProvider=void 0;var Zq=Xe(),Jq=pt(),dy=class{provideSignatureHelp(e,r,n=Zq.CancellationToken.None){let o=e.parseResult.value.$cstNode;if(o){let a=(0,Jq.findLeafNodeAtOffset)(o,e.textDocument.offsetAt(r.position));if(a)return this.getSignatureFromElement(a.element,n)}}get signatureHelpOptions(){return{triggerCharacters:["("],retriggerCharacters:[","]}}};Ka.AbstractSignatureHelpProvider=dy;function Qq(t){let e=[],r=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&r.push(...i.retriggerCharacters)});let n={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:r.length>0?Array.from(new Set(r)).sort():void 0};return n.triggerCharacters?n:void 0}Ka.mergeSignatureHelpOptions=Qq});var gy=b(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.createRequestHandler=oe.createServerRequestHandler=oe.createCallHierarchyRequestHandler=oe.addCallHierarchyHandler=oe.addSignatureHelpHandler=oe.addDocumentLinkHandler=oe.addExecuteCommandHandler=oe.addConfigurationChangeHandler=oe.addSemanticTokenHandler=oe.addRenameHandler=oe.addFormattingHandler=oe.addFoldingRangeHandler=oe.addHoverHandler=oe.addDocumentHighlightsHandler=oe.addGoToImplementationHandler=oe.addGoToTypeDefinitionHandler=oe.addGotoDefinitionHandler=oe.addDocumentSymbolHandler=oe.addCodeActionHandler=oe.addFindReferencesHandler=oe.addCompletionHandler=oe.addDiagnosticsHandler=oe.addDocumentsHandler=oe.startLanguageServer=oe.DefaultLanguageServer=void 0;var $r=Xe(),za=$n(),bE=eu(),ej=In(),tj=Ho(),rj=ef(),nj=py(),hy=class{constructor(e){this.onInitializeEmitter=new $r.Emitter,this.onInitializedEmitter=new $r.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){(0,bE.eagerLoad)(this.services),this.services.ServiceRegistry.all.forEach(e=>(0,bE.eagerLoad)(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var r;let n=this.services.ServiceRegistry.all,i=this.hasService($=>$.lsp.Formatter),o=n.map($=>{var X;return(X=$.lsp.Formatter)===null||X===void 0?void 0:X.formatOnTypeOptions}).find($=>!!$),a=this.hasService($=>$.lsp.CodeActionProvider),s=this.hasService($=>$.lsp.SemanticTokenProvider),u=(r=this.services.lsp.ExecuteCommandHandler)===null||r===void 0?void 0:r.commands,l=this.services.lsp.DocumentLinkProvider,c=(0,nj.mergeSignatureHelpOptions)(n.map($=>{var X;return(X=$.lsp.SignatureHelp)===null||X===void 0?void 0:X.signatureHelpOptions})),f=this.hasService($=>$.lsp.TypeProvider),p=this.hasService($=>$.lsp.ImplementationProvider),h=this.hasService($=>$.lsp.CompletionProvider),d=this.hasService($=>$.lsp.ReferencesProvider),g=this.hasService($=>$.lsp.DocumentSymbolProvider),C=this.hasService($=>$.lsp.DefinitionProvider),x=this.hasService($=>$.lsp.DocumentHighlightProvider),T=this.hasService($=>$.lsp.FoldingRangeProvider),v=this.hasService($=>$.lsp.HoverProvider),k=this.hasService($=>$.lsp.RenameProvider),j=this.hasService($=>$.lsp.CallHierarchyProvider);return{capabilities:{workspace:{workspaceFolders:{supported:!0}},executeCommandProvider:u&&{commands:u},textDocumentSync:$r.TextDocumentSyncKind.Incremental,completionProvider:h?{}:void 0,referencesProvider:d,documentSymbolProvider:g,definitionProvider:C,typeDefinitionProvider:f,documentHighlightProvider:x,codeActionProvider:a,documentFormattingProvider:i,documentRangeFormattingProvider:i,documentOnTypeFormattingProvider:o,foldingRangeProvider:T,hoverProvider:v,renameProvider:k?{prepareProvider:!0}:void 0,semanticTokensProvider:s?rj.DefaultSemanticTokenOptions:void 0,signatureHelpProvider:c,implementationProvider:p,callHierarchyProvider:j?{}:void 0,documentLinkProvider:l?{resolveProvider:!!l.resolveDocumentLink}:void 0}}}async initialized(e){this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}};oe.DefaultLanguageServer=hy;function ij(t){let e=t.lsp.Connection;if(!e)throw new Error("Starting a language server requires the languageServer.Connection service to be set.");AE(e,t),EE(e,t),CE(e,t),xE(e,t),SE(e,t),kE(e,t),PE(e,t),DE(e,t),NE(e,t),IE(e,t),$E(e,t),wE(e,t),ME(e,t),OE(e,t),LE(e,t),qE(e,t),GE(e,t),UE(e,t),jE(e,t),FE(e,t),e.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),e.onInitialized(n=>t.lsp.LanguageServer.initialized(n)),t.workspace.TextDocuments.listen(e),e.listen()}oe.startLanguageServer=ij;function AE(t,e){let r=e.workspace.DocumentBuilder,n=e.workspace.MutexLock;function i(a,s){n.lock(u=>r.update(a,s,u))}e.workspace.TextDocuments.onDidChangeContent(a=>{i([za.URI.parse(a.document.uri)],[])}),t.onDidChangeWatchedFiles(a=>{let s=a.changes.filter(l=>l.type!==$r.FileChangeType.Deleted).map(l=>za.URI.parse(l.uri)),u=a.changes.filter(l=>l.type===$r.FileChangeType.Deleted).map(l=>za.URI.parse(l.uri));i(s,u)})}oe.addDocumentsHandler=AE;function EE(t,e){e.workspace.DocumentBuilder.onBuildPhase(tj.DocumentState.Validated,async(n,i)=>{for(let o of n)if(o.diagnostics&&t.sendDiagnostics({uri:o.uri.toString(),diagnostics:o.diagnostics}),i.isCancellationRequested)return})}oe.addDiagnosticsHandler=EE;function CE(t,e){t.onCompletion(vr((r,n,i,o)=>{var a;return(a=r.lsp.CompletionProvider)===null||a===void 0?void 0:a.getCompletion(n,i,o)},e))}oe.addCompletionHandler=CE;function xE(t,e){t.onReferences(vr((r,n,i,o)=>{var a;return(a=r.lsp.ReferencesProvider)===null||a===void 0?void 0:a.findReferences(n,i,o)},e))}oe.addFindReferencesHandler=xE;function wE(t,e){t.onCodeAction(vr((r,n,i,o)=>{var a;return(a=r.lsp.CodeActionProvider)===null||a===void 0?void 0:a.getCodeActions(n,i,o)},e))}oe.addCodeActionHandler=wE;function SE(t,e){t.onDocumentSymbol(vr((r,n,i,o)=>{var a;return(a=r.lsp.DocumentSymbolProvider)===null||a===void 0?void 0:a.getSymbols(n,i,o)},e))}oe.addDocumentSymbolHandler=SE;function kE(t,e){t.onDefinition(vr((r,n,i,o)=>{var a;return(a=r.lsp.DefinitionProvider)===null||a===void 0?void 0:a.getDefinition(n,i,o)},e))}oe.addGotoDefinitionHandler=kE;function PE(t,e){t.onTypeDefinition(vr((r,n,i,o)=>{var a;return(a=r.lsp.TypeProvider)===null||a===void 0?void 0:a.getTypeDefinition(n,i,o)},e))}oe.addGoToTypeDefinitionHandler=PE;function DE(t,e){t.onImplementation(vr((r,n,i,o)=>{var a;return(a=r.lsp.ImplementationProvider)===null||a===void 0?void 0:a.getImplementation(n,i,o)},e))}oe.addGoToImplementationHandler=DE;function NE(t,e){t.onDocumentHighlight(vr((r,n,i,o)=>{var a;return(a=r.lsp.DocumentHighlightProvider)===null||a===void 0?void 0:a.getDocumentHighlight(n,i,o)},e))}oe.addDocumentHighlightsHandler=NE;function OE(t,e){t.onHover(vr((r,n,i,o)=>{var a;return(a=r.lsp.HoverProvider)===null||a===void 0?void 0:a.getHoverContent(n,i,o)},e))}oe.addHoverHandler=OE;function IE(t,e){t.onFoldingRanges(vr((r,n,i,o)=>{var a;return(a=r.lsp.FoldingRangeProvider)===null||a===void 0?void 0:a.getFoldingRanges(n,i,o)},e))}oe.addFoldingRangeHandler=IE;function $E(t,e){t.onDocumentFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocument(n,i,o)},e)),t.onDocumentRangeFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocumentRange(n,i,o)},e)),t.onDocumentOnTypeFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocumentOnType(n,i,o)},e))}oe.addFormattingHandler=$E;function ME(t,e){t.onRenameRequest(vr((r,n,i,o)=>{var a;return(a=r.lsp.RenameProvider)===null||a===void 0?void 0:a.rename(n,i,o)},e)),t.onPrepareRename(vr((r,n,i,o)=>{var a;return(a=r.lsp.RenameProvider)===null||a===void 0?void 0:a.prepareRename(n,i,o)},e))}oe.addRenameHandler=ME;function LE(t,e){let r="No semantic token provider registered";t.languages.semanticTokens.on(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlight(i,o,a):new $r.ResponseError(0,r),e)),t.languages.semanticTokens.onDelta(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightDelta(i,o,a):new $r.ResponseError(0,r),e)),t.languages.semanticTokens.onRange(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightRange(i,o,a):new $r.ResponseError(0,r),e))}oe.addSemanticTokenHandler=LE;function FE(t,e){t.onDidChangeConfiguration(r=>{r.settings&&e.workspace.ConfigurationProvider.updateConfiguration(r)})}oe.addConfigurationChangeHandler=FE;function qE(t,e){let r=e.lsp.ExecuteCommandHandler;r&&t.onExecuteCommand(async(n,i)=>{var o;try{return await r.executeCommand(n.command,(o=n.arguments)!==null&&o!==void 0?o:[],i)}catch(a){return mu(a)}})}oe.addExecuteCommandHandler=qE;function jE(t,e){var r;let n=e.lsp.DocumentLinkProvider;if(n){t.onDocumentLinks(Bo((o,a,s,u)=>n.getDocumentLinks(a,s,u),e));let i=(r=n.resolveDocumentLink)===null||r===void 0?void 0:r.bind(n);i&&t.onDocumentLinkResolve(async(o,a)=>{try{return await i(o,a)}catch(s){return mu(s)}})}}oe.addDocumentLinkHandler=jE;function GE(t,e){t.onSignatureHelp(Bo((r,n,i,o)=>{var a;return(a=r.lsp.SignatureHelp)===null||a===void 0?void 0:a.provideSignatureHelp(n,i,o)},e))}oe.addSignatureHelpHandler=GE;function UE(t,e){let r="No call hierarchy provider registered";t.languages.callHierarchy.onPrepare(Bo((n,i,o,a)=>{var s;return n.lsp.CallHierarchyProvider?(s=n.lsp.CallHierarchyProvider.prepareCallHierarchy(i,o,a))!==null&&s!==void 0?s:null:new $r.ResponseError(0,r)},e)),t.languages.callHierarchy.onIncomingCalls(my((n,i,o)=>{var a;return n.lsp.CallHierarchyProvider?(a=n.lsp.CallHierarchyProvider.incomingCalls(i,o))!==null&&a!==void 0?a:null:new $r.ResponseError(0,r)},e)),t.languages.callHierarchy.onOutgoingCalls(my((n,i,o)=>{var a;return n.lsp.CallHierarchyProvider?(a=n.lsp.CallHierarchyProvider.outgoingCalls(i,o))!==null&&a!==void 0?a:null:new $r.ResponseError(0,r)},e))}oe.addCallHierarchyHandler=UE;function my(t,e){let r=e.ServiceRegistry;return async(n,i)=>{let o=za.URI.parse(n.item.uri),a=r.getServices(o);if(!a)throw console.error(`Could not find service instance for uri: '${o.toString()}'`),new Error;try{return await t(a,n,i)}catch(s){return mu(s)}}}oe.createCallHierarchyRequestHandler=my;function Bo(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let a=za.URI.parse(i.textDocument.uri),s=n.getServices(a);if(!s)throw console.error(`Could not find service instance for uri: '${a.toString()}'`),new Error;let u=r.getOrCreateDocument(a);if(!u)throw new Error;try{return await t(s,u,i,o)}catch(l){return mu(l)}}}oe.createServerRequestHandler=Bo;function vr(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let a=za.URI.parse(i.textDocument.uri),s=n.getServices(a);if(!s)return console.error(`Could not find service instance for uri: '${a.toString()}'`),null;let u=r.getOrCreateDocument(a);if(!u)return null;try{return await t(s,u,i,o)}catch(l){return mu(l)}}}oe.createRequestHandler=vr;function mu(t){if((0,ej.isOperationCancelled)(t))return new $r.ResponseError($r.LSPErrorCodes.RequestCancelled,"The request has been cancelled.");if(t instanceof $r.ResponseError)return t;throw t}});var vy=b(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.DefaultReferencesProvider=void 0;var HE=Xe(),oj=Ie(),aj=pt(),yy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,r){let n=e.parseResult.value.$cstNode;if(!n)return[];let i=(0,aj.findDeclarationNodeAtOffset)(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);return i?this.getReferences(i,r,e):[]}getReferences(e,r,n){let i=[],o=this.references.findDeclaration(e);if(o){let a={includeDeclaration:r.context.includeDeclaration};this.references.findReferences(o,a).forEach(s=>{(0,oj.isReference)(s)?i.push(HE.Location.create(n.uri.toString(),s.$refNode.range)):i.push(HE.Location.create(s.sourceUri.toString(),s.segment.range))})}return i}};mf.DefaultReferencesProvider=yy});var Ty=b(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.DefaultRenameProvider=void 0;var sj=Xe(),uj=Ua(),BE=pt(),_y=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,r){let n={},i=e.parseResult.value.$cstNode;if(!i)return;let o=e.textDocument.offsetAt(r.position),a=(0,BE.findDeclarationNodeAtOffset)(i,o,this.grammarConfig.nameRegexp);if(!a)return;let s=this.references.findDeclaration(a);if(!s)return;let u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(s,u).forEach(c=>{let f=sj.TextEdit.replace(c.segment.range,r.newName),p=c.sourceUri.toString();n[p]?n[p].push(f):n[p]=[f]}),{changes:n}}prepareRename(e,r){return this.renameNodeRange(e,r.position)}renameNodeRange(e,r){let n=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(r);if(n&&i){let o=(0,BE.findDeclarationNodeAtOffset)(n,i,this.grammarConfig.nameRegexp);if(!o)return;if(this.references.findDeclaration(o)||this.isNameNode(o))return o.range}}isNameNode(e){return e?.element&&(0,uj.isNamed)(e.element)&&e===this.nameProvider.getNameNode(e.element)}};gf.DefaultRenameProvider=_y});var WE=b(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.AbstractTypeDefinitionProvider=void 0;var lj=Xe(),cj=pt(),Ry=class{constructor(e){this.references=e.references.References}getTypeDefinition(e,r,n=lj.CancellationToken.None){let i=e.parseResult.value;if(i.$cstNode){let o=(0,cj.findDeclarationNodeAtOffset)(i.$cstNode,e.textDocument.offsetAt(r.position));if(o){let a=this.references.findDeclaration(o);if(a)return this.collectGoToTypeLocationLinks(a,n)}}}};yf.AbstractTypeDefinitionProvider=Ry});var by=b(ht=>{"use strict";var fj=ht&&ht.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Yt=ht&&ht.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fj(e,t,r)};Object.defineProperty(ht,"__esModule",{value:!0});Yt(Zg(),ht);Yt(Vg(),ht);Yt(mE(),ht);Yt(Qg(),ht);Yt(yE(),ht);Yt(ty(),ht);Yt(vE(),ht);Yt(Vc(),ht);Yt(iy(),ht);Yt(ay(),ht);Yt(Lg(),ht);Yt(TE(),ht);Yt(gy(),ht);Yt(vy(),ht);Yt(Ty(),ht);Yt(ef(),ht);Yt(py(),ht);Yt(WE(),ht)});var KE=b(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.LangiumGrammarDefinitionProvider=void 0;var Ay=Xe(),dj=by(),pj=Ie(),hj=Wt(),mj=ot(),gj=ir(),Ey=class extends dj.DefaultDefinitionProvider{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}collectLocationLinks(e,r){var n,i,o,a,s,u;let l="path";if((0,mj.isGrammarImport)(e.element)&&((n=(0,hj.findAssignment)(e))===null||n===void 0?void 0:n.feature)===l){let c=(0,gj.resolveImport)(this.documents,e.element);if(c?.$document){let f=(i=this.findTargetObject(c))!==null&&i!==void 0?i:c,p=(a=(o=this.nameProvider.getNameNode(f))===null||o===void 0?void 0:o.range)!==null&&a!==void 0?a:Ay.Range.create(0,0,0,0),h=(u=(s=f.$cstNode)===null||s===void 0?void 0:s.range)!==null&&u!==void 0?u:Ay.Range.create(0,0,0,0);return[Ay.LocationLink.create(c.$document.uri.toString(),h,p,e.range)]}return}return super.collectLocationLinks(e,r)}findTargetObject(e){return e.isDeclared?e:(0,pj.streamContents)(e).head()}};vf.LangiumGrammarDefinitionProvider=Ey});var VE=b(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.AbstractCallHierarchyProvider=void 0;var yj=Xe(),zE=$n(),Cy=pt(),xy=class{constructor(e){this.grammarConfig=e.parser.GrammarConfig,this.nameProvider=e.references.NameProvider,this.documents=e.shared.workspace.LangiumDocuments,this.references=e.references.References}prepareCallHierarchy(e,r){let n=e.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclarationNode(i);if(!!o)return this.getCallHierarchyItems(o.element,e)}getCallHierarchyItems(e,r){let n=this.nameProvider.getNameNode(e),i=this.nameProvider.getName(e);if(!(!n||!e.$cstNode||i===void 0))return[Object.assign({kind:yj.SymbolKind.Method,name:i,range:e.$cstNode.range,selectionRange:n.range,uri:r.uri.toString()},this.getCallHierarchyItem(e))]}getCallHierarchyItem(e){}incomingCalls(e){let r=this.documents.getOrCreateDocument(zE.URI.parse(e.item.uri)),n=r.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findReferences(i.element,{includeDeclaration:!1,onlyLocal:!1});return this.getIncomingCalls(i.element,o)}outgoingCalls(e){let r=this.documents.getOrCreateDocument(zE.URI.parse(e.item.uri)),n=r.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!!i)return this.getOutgoingCalls(i.element)}};_f.AbstractCallHierarchyProvider=xy});var XE=b(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.LangiumGrammarCallHierarchyProvider=void 0;var YE=Xe(),vj=VE(),wy=Ie(),_j=pt(),Tf=ot(),Sy=class extends vj.AbstractCallHierarchyProvider{getIncomingCalls(e,r){if(!(0,Tf.isParserRule)(e))return;let n=new Map;if(r.forEach(i=>{let a=this.documents.getOrCreateDocument(i.sourceUri).parseResult.value;if(!a.$cstNode)return;let s=(0,_j.findLeafNodeAtOffset)(a.$cstNode,i.segment.offset);if(!s)return;let u=(0,wy.getContainerOfType)(s.element,Tf.isParserRule);if(!u||!u.$cstNode)return;let l=this.nameProvider.getNameNode(u);if(!l)return;let c=i.sourceUri.toString(),f=c+"@"+l.text;n.has(f)?n.set(f,{parserRule:u.$cstNode,nameNode:l,targetNodes:[...n.get(f).targetNodes,s],docUri:c}):n.set(f,{parserRule:u.$cstNode,nameNode:l,targetNodes:[s],docUri:c})}),n.size!==0)return Array.from(n.values()).map(i=>({from:{kind:YE.SymbolKind.Method,name:i.nameNode.text,range:i.parserRule.range,selectionRange:i.nameNode.range,uri:i.docUri},fromRanges:i.targetNodes.map(o=>o.range)}))}getOutgoingCalls(e){if(!(0,Tf.isParserRule)(e))return;let r=(0,wy.streamAllContents)(e).filter(Tf.isRuleCall).toArray(),n=new Map;if(r.forEach(i=>{var o;let a=i.$cstNode;if(!a)return;let s=(o=i.rule.ref)===null||o===void 0?void 0:o.$cstNode;if(!s)return;let u=this.nameProvider.getNameNode(s.element);if(!u)return;let l=(0,wy.getDocument)(s.element).uri.toString(),c=l+"@"+u.text;n.has(c)?n.set(c,{refCstNode:s,to:u,from:[...n.get(c).from,a.range],docUri:l}):n.set(c,{refCstNode:s,to:u,from:[a.range],docUri:l})}),n.size!==0)return Array.from(n.values()).map(i=>({to:{kind:YE.SymbolKind.Method,name:i.to.text,range:i.refCstNode.range,selectionRange:i.to.range,uri:i.docUri},fromRanges:i.from}))}};Rf.LangiumGrammarCallHierarchyProvider=Sy});var bf=b(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.createLangiumGrammarServices=Wo.LangiumGrammarModule=void 0;var ZE=Af(),JE=eu(),QE=Kb(),eC=AA(),tC=Sg(),Tj=VA(),Rj=YA(),bj=ZA(),Aj=JA(),Ej=eE(),Cj=sE(),xj=KE(),wj=XE();Wo.LangiumGrammarModule={validation:{ValidationRegistry:t=>new tC.LangiumGrammarValidationRegistry(t),LangiumGrammarValidator:t=>new tC.LangiumGrammarValidator(t)},lsp:{FoldingRangeProvider:t=>new Rj.LangiumGrammarFoldingRangeProvider(t),CodeActionProvider:()=>new Tj.LangiumGrammarCodeActionProvider,SemanticTokenProvider:t=>new Aj.LangiumGrammarSemanticTokenProvider(t),Formatter:()=>new bj.LangiumGrammarFormatter,DefinitionProvider:t=>new xj.LangiumGrammarDefinitionProvider(t),CallHierarchyProvider:t=>new wj.LangiumGrammarCallHierarchyProvider(t)},references:{ScopeComputation:t=>new eC.LangiumGrammarScopeComputation(t),ScopeProvider:t=>new eC.LangiumGrammarScopeProvider(t),References:t=>new Cj.LangiumGrammarReferences(t),NameProvider:()=>new Ej.LangiumGrammarNameProvider}};function Sj(t,e){let r=(0,JE.inject)((0,ZE.createDefaultSharedModule)(t),QE.LangiumGrammarGeneratedSharedModule,e),n=(0,JE.inject)((0,ZE.createDefaultModule)({shared:r}),QE.LangiumGrammarGeneratedModule,Wo.LangiumGrammarModule);return r.ServiceRegistry.register(n),{shared:r,grammar:n}}Wo.createLangiumGrammarServices=Sj});var nC=b(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.collectAst=void 0;var rC=Bt(),kj=_g(),Pj=hg(),Dj=so();function Nj(t,e){let r=(0,Dj.collectAllAstResources)(e,t),n=(0,kj.collectInferredTypes)(Array.from(r.parserRules),Array.from(r.datatypeRules)),i=(0,Pj.collectDeclaredTypes)(Array.from(r.interfaces),Array.from(r.types),n),o=n.interfaces.concat(i.interfaces),a=n.unions.concat(i.unions);return Oj(o),a.sort((s,u)=>s.name.localeCompare(u.name)),{interfaces:(0,rC.stream)(o).distinct(s=>s.name).toArray(),unions:(0,rC.stream)(a).distinct(s=>s.name).toArray()}}Ef.collectAst=Nj;function Oj(t){let e=t.sort((i,o)=>i.name.localeCompare(o.name)).map(i=>({value:i,nodes:[]}));for(let i of e)i.nodes=e.filter(o=>i.value.superTypes.has(o.value.name));let r=[],n=e.filter(i=>i.nodes.length===0);for(;n.length>0;){let i=n.shift();r.includes(i)||(r.push(i),e.filter(o=>o.nodes.includes(i)).forEach(o=>n.push(o)))}return r.map(i=>i.value)}});var Py=b(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.interpretAstReflection=void 0;var Ij=Ie(),$j=tn(),Mj=Ec(),Lj=ot(),Fj=bf(),qj=nC(),jj=so(),ky;function Gj(t,e){let r;(0,Lj.isGrammar)(t)?(!ky&&!e&&(ky=(0,Fj.createLangiumGrammarServices)(Mj.EmptyFileSystem).shared.workspace.LangiumDocuments),r=(0,qj.collectAst)(e??ky,[t])):r=t;let n=r.interfaces.map(s=>s.name).concat(r.unions.map(s=>s.name)),i=Uj(r),o=Hj(r),a=Wj(r);return{getAllTypes(){return n},getReferenceType(s){let u=`${s.container.$type}:${s.property}`,l=i.get(u);if(l)return l;throw new Error("Could not find reference type for "+u)},getTypeMetaData(s){var u;return(u=o.get(s))!==null&&u!==void 0?u:{name:s,mandatory:[]}},isInstance(s,u){return(0,Ij.isAstNode)(s)&&this.isSubtype(s.$type,u)},isSubtype(s,u){if(s===u)return!0;let l=a.get(s);for(let c of l)if(this.isSubtype(c,u))return!0;return!1}}}Cf.interpretAstReflection=Gj;function Uj(t){let e=new Map;for(let r of t.interfaces)for(let n of r.properties)for(let i of n.typeAlternatives)i.reference&&e.set(`${r.name}:${n.name}`,i.types[0]);return e}function Hj(t){let e=new Map,r=(0,jj.collectAllProperties)(t.interfaces);for(let n of t.interfaces){let i=r.get(n.name),o=i.filter(s=>s.typeAlternatives.some(u=>u.array)),a=i.filter(s=>s.typeAlternatives.every(u=>!u.array&&u.types.includes("boolean")));(o.length>0||a.length>0)&&e.set(n.name,{name:n.name,mandatory:Bj(o,a)})}return e}function Bj(t,e){let r=[],n=t.concat(e).sort((i,o)=>i.name.localeCompare(o.name));for(let i of n){let o=t.includes(i)?"array":"boolean";r.push({name:i.name,type:o})}return r}function Wj(t){let e=new $j.MultiMap;for(let r of t.interfaces)e.addAll(r.name,r.superTypes);for(let r of t.unions)e.addAll(r.name,r.superTypes);return e}});var Wt=b(Se=>{"use strict";var Kj=Se&&Se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zj=Se&&Se.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vj=Se&&Se.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Kj(e,t,r);return zj(e,t),e};Object.defineProperty(Se,"__esModule",{value:!0});Se.createServicesForGrammar=Se.loadGrammarFromJson=Se.findNameAssignment=Se.findAssignment=Se.findNodesForKeywordInternal=Se.findNodeForKeyword=Se.findNodesForKeyword=Se.findNodeForProperty=Se.findNodesForProperty=Se.isCommentTerminal=Se.getCrossReferenceTerminal=Se.getAllReachableRules=Se.getEntryRule=void 0;var iC=Af(),oC=eu(),Yj=Py(),kr=Vj(ot()),Ny=ir(),aC=bf(),Xj=Pa(),gu=Ie(),Zj=pt(),Dy=Ec();function sC(t){return t.rules.find(e=>kr.isParserRule(e)&&e.entry)}Se.getEntryRule=sC;function Jj(t,e){let r=new Set,n=sC(t);if(!n)return new Set(t.rules);uC(n,r,e);let i=new Set;for(let o of t.rules)(r.has(o.name)||kr.isTerminalRule(o)&&o.hidden)&&i.add(o);return i}Se.getAllReachableRules=Jj;function uC(t,e,r){e.add(t.name),(0,gu.streamAllContents)(t).forEach(n=>{if(kr.isRuleCall(n)||r&&kr.isTerminalRuleCall(n)){let i=n.rule.ref;i&&!e.has(i.name)&&uC(i,e,r)}})}function Qj(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=lC(t.type.ref);return e?.terminal}}Se.getCrossReferenceTerminal=Qj;function eG(t){return t.hidden&&!" ".match((0,Ny.terminalRegex)(t))}Se.isCommentTerminal=eG;function tG(t,e){return!t||!e?[]:Oy(t,e,t.element,!0)}Se.findNodesForProperty=tG;function rG(t,e,r){if(!t||!e)return;let n=Oy(t,e,t.element,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}Se.findNodeForProperty=rG;function Oy(t,e,r,n){if(!n){let i=(0,gu.getContainerOfType)(t.feature,kr.isAssignment);if(i&&i.feature===e)return[t]}return(0,Xj.isCompositeCstNode)(t)&&t.element===r?t.children.flatMap(i=>Oy(i,e,r,!1)):[]}function nG(t,e){return t?Iy(t,e,t?.element):[]}Se.findNodesForKeyword=nG;function iG(t,e,r){if(!t)return;let n=Iy(t,e,t?.element);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}Se.findNodeForKeyword=iG;function Iy(t,e,r){if(t.element!==r)return[];if(kr.isKeyword(t.feature)&&t.feature.value===e)return[t];let n=(0,Zj.streamCst)(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let a=i.value;a.element===r?kr.isKeyword(a.feature)&&a.feature.value===e&&o.push(a):n.prune()}while(!i.done);return o}Se.findNodesForKeywordInternal=Iy;function oG(t){let e=t;do{let r=(0,gu.getContainerOfType)(e.feature,kr.isAssignment);if(r)return r;e=e.parent}while(e)}Se.findAssignment=oG;function lC(t){return kr.isInferredType(t)&&(t=t.$container),cC(t,new Map)}Se.findNameAssignment=lC;function cC(t,e){var r;function n(i,o){let a;return(0,gu.getContainerOfType)(i,kr.isAssignment)||(a=cC(o,e)),e.set(t,a),a}if(e.has(t))return e.get(t);e.set(t,void 0);for(let i of(0,gu.streamAllContents)(t)){if(kr.isAssignment(i)&&i.feature.toLowerCase()==="name")return e.set(t,i),i;if(kr.isRuleCall(i)&&kr.isParserRule(i.rule.ref))return n(i,i.rule.ref);if(kr.isAtomType(i)&&((r=i?.refType)===null||r===void 0?void 0:r.ref))return n(i,i.refType.ref)}}function aG(t){let e=(0,aC.createLangiumGrammarServices)(Dy.EmptyFileSystem).grammar,r=e.serializer.JsonSerializer.deserialize(t);if(!kr.isGrammar(r))throw new Error("Could not load grammar from specified json input.");return(0,Ny.prepareGrammar)(e,r)}Se.loadGrammarFromJson=aG;function sG(t){var e,r,n,i,o,a;let s=(e=t.grammarServices)!==null&&e!==void 0?e:(0,aC.createLangiumGrammarServices)(Dy.EmptyFileSystem).grammar,u=typeof t.grammar=="string"?s.parser.LangiumParser.parse(t.grammar).value:t.grammar;(0,Ny.prepareGrammar)(s,u);let l=(r=t.parserConfig)!==null&&r!==void 0?r:{skipValidations:!1},c=(n=t.languageMetaData)!==null&&n!==void 0?n:{caseInsensitive:!1,fileExtensions:[`.${(o=(i=u.name)===null||i===void 0?void 0:i.toLowerCase())!==null&&o!==void 0?o:"unknown"}`],languageId:(a=u.name)!==null&&a!==void 0?a:"UNKNOWN"},f={AstReflection:()=>(0,Yj.interpretAstReflection)(u)},p={Grammar:()=>u,LanguageMetaData:()=>c,parser:{ParserConfig:()=>l}},h=(0,oC.inject)((0,iC.createDefaultSharedModule)(Dy.EmptyFileSystem),f,t.sharedModule),d=(0,oC.inject)((0,iC.createDefaultModule)({shared:h}),p,t.module);return h.ServiceRegistry.register(d),d}Se.createServicesForGrammar=sG});var fC=b(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.createGrammarConfig=void 0;var uG=pt(),lG=Wt(),cG=Fa(),fG=ot(),dG=ir();function pG(t){let e=[],r=t.Grammar;for(let n of r.rules)(0,fG.isTerminalRule)(n)&&(0,lG.isCommentTerminal)(n)&&(0,cG.isMultilineComment)((0,dG.terminalRegex)(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:uG.DefaultNameRegexp}}xf.createGrammarConfig=pG});var $y=b(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.VERSION=void 0;wf.VERSION="9.1.0"});var $e=b((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0});exports.toFastProperties=exports.timer=exports.peek=exports.isES2015MapSupported=exports.PRINT_WARNING=exports.PRINT_ERROR=exports.packArray=exports.IDENTITY=exports.NOOP=exports.merge=exports.groupBy=exports.defaults=exports.assignNoOverwrite=exports.assign=exports.zipObject=exports.sortBy=exports.indexOf=exports.some=exports.difference=exports.every=exports.isObject=exports.isRegExp=exports.isArray=exports.partial=exports.uniq=exports.compact=exports.reduce=exports.findAll=exports.find=exports.cloneObj=exports.cloneArr=exports.contains=exports.has=exports.pick=exports.reject=exports.filter=exports.dropRight=exports.drop=exports.isFunction=exports.isUndefined=exports.isString=exports.forEach=exports.last=exports.first=exports.flatten=exports.map=exports.mapValues=exports.values=exports.keys=exports.isEmpty=void 0;exports.upperFirst=void 0;function isEmpty(t){return t&&t.length===0}exports.isEmpty=isEmpty;function keys(t){return t==null?[]:Object.keys(t)}exports.keys=keys;function values(t){for(var e=[],r=Object.keys(t),n=0;n<r.length;n++)e.push(t[r[n]]);return e}exports.values=values;function mapValues(t,e){for(var r=[],n=keys(t),i=0;i<n.length;i++){var o=n[i];r.push(e.call(null,t[o],o))}return r}exports.mapValues=mapValues;function map(t,e){for(var r=[],n=0;n<t.length;n++)r.push(e.call(null,t[n],n));return r}exports.map=map;function flatten(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];Array.isArray(n)?e=e.concat(flatten(n)):e.push(n)}return e}exports.flatten=flatten;function first(t){return isEmpty(t)?void 0:t[0]}exports.first=first;function last(t){var e=t&&t.length;return e?t[e-1]:void 0}exports.last=last;function forEach(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)e.call(null,t[r],r);else if(isObject(t))for(var n=keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i];e.call(null,o,i)}else throw Error("non exhaustive match")}exports.forEach=forEach;function isString(t){return typeof t=="string"}exports.isString=isString;function isUndefined(t){return t===void 0}exports.isUndefined=isUndefined;function isFunction(t){return t instanceof Function}exports.isFunction=isFunction;function drop(t,e){return e===void 0&&(e=1),t.slice(e,t.length)}exports.drop=drop;function dropRight(t,e){return e===void 0&&(e=1),t.slice(0,t.length-e)}exports.dropRight=dropRight;function filter(t,e){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}exports.filter=filter;function reject(t,e){return filter(t,function(r){return!e(r)})}exports.reject=reject;function pick(t,e){for(var r=Object.keys(t),n={},i=0;i<r.length;i++){var o=r[i],a=t[o];e(a)&&(n[o]=a)}return n}exports.pick=pick;function has(t,e){return isObject(t)?t.hasOwnProperty(e):!1}exports.has=has;function contains(t,e){return find(t,function(r){return r===e})!==void 0}exports.contains=contains;function cloneArr(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r]);return e}exports.cloneArr=cloneArr;function cloneObj(t){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}exports.cloneObj=cloneObj;function find(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(e.call(null,n))return n}}exports.find=find;function findAll(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}exports.findAll=findAll;function reduce(t,e,r){for(var n=Array.isArray(t),i=n?t:values(t),o=n?[]:keys(t),a=r,s=0;s<i.length;s++)a=e.call(null,a,i[s],n?s:o[s]);return a}exports.reduce=reduce;function compact(t){return reject(t,function(e){return e==null})}exports.compact=compact;function uniq(t,e){e===void 0&&(e=function(n){return n});var r=[];return reduce(t,function(n,i){var o=e(i);return contains(r,o)?n:(r.push(o),n.concat(i))},[])}exports.uniq=uniq;function partial(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=[null],i=n.concat(e);return Function.bind.apply(t,i)}exports.partial=partial;function isArray(t){return Array.isArray(t)}exports.isArray=isArray;function isRegExp(t){return t instanceof RegExp}exports.isRegExp=isRegExp;function isObject(t){return t instanceof Object}exports.isObject=isObject;function every(t,e){for(var r=0;r<t.length;r++)if(!e(t[r],r))return!1;return!0}exports.every=every;function difference(t,e){return reject(t,function(r){return contains(e,r)})}exports.difference=difference;function some(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return!0;return!1}exports.some=some;function indexOf(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1}exports.indexOf=indexOf;function sortBy(t,e){var r=cloneArr(t);return r.sort(function(n,i){return e(n)-e(i)}),r}exports.sortBy=sortBy;function zipObject(t,e){if(t.length!==e.length)throw Error("can't zipObject with different number of keys and values!");for(var r={},n=0;n<t.length;n++)r[t[n]]=e[n];return r}exports.zipObject=zipObject;function assign(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=keys(i),a=0;a<o.length;a++){var s=o[a];t[s]=i[s]}return t}exports.assign=assign;function assignNoOverwrite(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=keys(i),a=0;a<o.length;a++){var s=o[a];has(t,s)||(t[s]=i[s])}return t}exports.assignNoOverwrite=assignNoOverwrite;function defaults(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return assignNoOverwrite.apply(void 0,__spreadArray([{}],t,!1))}exports.defaults=defaults;function groupBy(t,e){var r={};return forEach(t,function(n){var i=e(n),o=r[i];o?o.push(n):r[i]=[n]}),r}exports.groupBy=groupBy;function merge(t,e){for(var r=cloneObj(t),n=keys(e),i=0;i<n.length;i++){var o=n[i],a=e[o];r[o]=a}return r}exports.merge=merge;function NOOP(){}exports.NOOP=NOOP;function IDENTITY(t){return t}exports.IDENTITY=IDENTITY;function packArray(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(n!==void 0?n:void 0)}return e}exports.packArray=packArray;function PRINT_ERROR(t){console&&console.error&&console.error("Error: "+t)}exports.PRINT_ERROR=PRINT_ERROR;function PRINT_WARNING(t){console&&console.warn&&console.warn("Warning: "+t)}exports.PRINT_WARNING=PRINT_WARNING;function isES2015MapSupported(){return typeof Map=="function"}exports.isES2015MapSupported=isES2015MapSupported;function peek(t){return t[t.length-1]}exports.peek=peek;function timer(t){var e=new Date().getTime(),r=t(),n=new Date().getTime(),i=n-e;return{time:i,value:r}}exports.timer=timer;function toFastProperties(toBecomeFast){function FakeConstructor(){}FakeConstructor.prototype=toBecomeFast;var fakeInstance=new FakeConstructor;function fakeAccess(){return typeof fakeInstance.bar}return fakeAccess(),fakeAccess(),toBecomeFast;eval(toBecomeFast)}exports.toFastProperties=toFastProperties;function upperFirst(t){if(!t)return t;var e=getCharacterFromCodePointAt(t,0);return e.toUpperCase()+t.substring(e.length)}exports.upperFirst=upperFirst;var surrogatePairPattern=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function getCharacterFromCodePointAt(t,e){var r=t.substring(e,e+1);return surrogatePairPattern.test(r)?r:t[e]}});var kf=b(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.clearRegExpParserCache=Va.getRegExpAst=void 0;var hG=iu(),Sf={},mG=new hG.RegExpParser;function gG(t){var e=t.toString();if(Sf.hasOwnProperty(e))return Sf[e];var r=mG.pattern(e);return Sf[e]=r,r}Va.getRegExpAst=gG;function yG(){Sf={}}Va.clearRegExpParserCache=yG});var gC=b(Mr=>{"use strict";var vG=Mr&&Mr.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.canMatchCharCode=Mr.firstCharOptimizedIndices=Mr.getOptimizedStartCodesIndices=Mr.failedOptimizationPrefixMsg=void 0;var pC=iu(),sn=$e(),hC=kf(),Li=Ly(),mC="Complement Sets are not supported for first char optimization";Mr.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
3607
- `;function _G(t,e){e===void 0&&(e=!1);try{var r=(0,hC.getRegExpAst)(t),n=Df(r.value,{},r.flags.ignoreCase);return n}catch(o){if(o.message===mC)e&&(0,sn.PRINT_WARNING)(""+Mr.failedOptimizationPrefixMsg+(" Unable to optimize: < "+t.toString()+` >
3605
+ `.repeat(s)}${o}`,range:e}}fitIntoOptions(e,r,n){return n.allowMore?e=Math.max(r,e):n.allowLess&&(e=Math.min(r,e)),e}findFittingMove(e,r,n){if(r.length===0)return;if(r.length===1)return r[0];let i=e.end.line-e.start.line;for(let o of r){if(o.lines!==void 0&&i<=o.lines)return o;if(o.lines===void 0&&i===0)return o}return r[r.length-1]}iterateCstTree(e,r){let i=e.parseResult.value.$cstNode;return i?new du.TreeStreamImpl(i,o=>this.iterateCst(o,r)):du.EMPTY_STREAM}iterateCst(e,r){if(!(0,$g.isCompositeCstNode)(e))return du.EMPTY_STREAM;let n=r.indentation;return new du.StreamImpl(()=>({index:0}),i=>i.index<e.children.length?{done:!1,value:e.children[i.index++]}:(r.indentation=n,du.DONE_RESULT))}};Fn.AbstractFormatter=Mg;var Zc=class{constructor(e,r){this.astNode=e,this.collector=r}node(e){return new Ir(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){let r=[];for(let n of e)n.$cstNode&&r.push(n.$cstNode);return new Ir(r,this.collector)}property(e,r){let n=(0,Xc.findNodeForProperty)(this.astNode.$cstNode,e,r);return new Ir(n?[n]:[],this.collector)}properties(...e){let r=[];for(let n of e){let i=(0,Xc.findNodesForProperty)(this.astNode.$cstNode,n);r.push(...i)}return new Ir(r,this.collector)}keyword(e,r){let n=(0,Xc.findNodeForKeyword)(this.astNode.$cstNode,e,r);return new Ir(n?[n]:[],this.collector)}keywords(...e){let r=[];for(let n of e){let i=(0,Xc.findNodesForKeyword)(this.astNode.$cstNode,n);r.push(...i)}return new Ir(r,this.collector)}cst(e){return new Ir([...e],this.collector)}interior(e,r){let n=e.nodes,i=r.nodes;if(n.length!==1||i.length!==1)return new Ir([],this.collector);let o=n[0],a=i[0];if(o.offset>a.offset){let s=o;o=a,a=s}return new Ir((0,XA.getInteriorNodes)(o,a),this.collector)}};Fn.DefaultNodeFormatter=Zc;var Ir=class{constructor(e,r){this.nodes=e,this.collector=r}prepend(e){for(let r of this.nodes)this.collector(r,"prepend",e);return this}append(e){for(let r of this.nodes)this.collector(r,"append",e);return this}surround(e){for(let r of this.nodes)this.collector(r,"prepend",e),this.collector(r,"append",e);return this}slice(e,r){return new Ir(this.nodes.slice(e,r),this.collector)}};Fn.FormattingRegion=Ir;var cq;(function(t){function e(...c){return{options:{},moves:c.flatMap(f=>f.moves).sort(l)}}t.fit=e;function r(c){return i(0,c)}t.noSpace=r;function n(c){return i(1,c)}t.oneSpace=n;function i(c,f){return{options:f??{},moves:[{characters:c}]}}t.spaces=i;function o(c){return a(1,c)}t.newLine=o;function a(c,f){return{options:f??{},moves:[{lines:c}]}}t.newLines=a;function s(c){return{options:c??{},moves:[{tabs:1,lines:1}]}}t.indent=s;function u(c){return{options:c??{},moves:[{tabs:0}]}}t.noIndent=u;function l(c,f){var p,h,d,g,C,x;let T=(p=c.lines)!==null&&p!==void 0?p:0,v=(h=f.lines)!==null&&h!==void 0?h:0,k=(d=c.tabs)!==null&&d!==void 0?d:0,j=(g=f.tabs)!==null&&g!==void 0?g:0,O=(C=c.characters)!==null&&C!==void 0?C:0,$=(x=f.characters)!==null&&x!==void 0?x:0;return T<v?-1:T>v?1:k<j?-1:k>j?1:O<$?-1:O>$?1:0}})(cq=Fn.Formatting||(Fn.Formatting={}))});var ZA=b(ui=>{"use strict";var fq=ui&&ui.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dq=ui&&ui.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pq=ui&&ui.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&fq(e,t,r);return dq(e,t),e};Object.defineProperty(ui,"__esModule",{value:!0});ui.LangiumGrammarFormatter=void 0;var Fe=Lg(),co=pq(ot()),Fg=class extends Fe.AbstractFormatter{format(e){if(co.isCrossReference(e))this.getNodeFormatter(e).properties("type","terminal").surround(Fe.Formatting.noSpace());else if(co.isParserRule(e)){let r=this.getNodeFormatter(e);r.keywords("entry","fragment","returns").append(Fe.Formatting.oneSpace()),(e.inferredType||e.returnType||e.dataType)&&e.parameters.length===0?r.property("name").append(Fe.Formatting.oneSpace()):r.property("name").append(Fe.Formatting.noSpace()),r.properties("parameters").append(Fe.Formatting.noSpace()),r.keywords(",").append(Fe.Formatting.oneSpace()),r.keywords("<").append(Fe.Formatting.noSpace());let n=r.keyword(";"),i=r.keyword(":");i.prepend(Fe.Formatting.noSpace()),r.interior(i,n).prepend(Fe.Formatting.indent()),n.prepend(Fe.Formatting.fit(Fe.Formatting.noSpace(),Fe.Formatting.newLine())),r.node(e).prepend(Fe.Formatting.noIndent())}else if(co.isTerminalRule(e)){let r=this.getNodeFormatter(e);e.type&&(r.property("name").append(Fe.Formatting.oneSpace()),r.keyword("returns").append(Fe.Formatting.oneSpace())),r.keywords("hidden","terminal","fragment").append(Fe.Formatting.oneSpace()),r.keyword(":").prepend(Fe.Formatting.noSpace()),r.keyword(";").prepend(Fe.Formatting.fit(Fe.Formatting.noSpace(),Fe.Formatting.newLine())),r.node(e).prepend(Fe.Formatting.noIndent())}else if(co.isAction(e)){let r=this.getNodeFormatter(e);r.keyword("{").append(Fe.Formatting.noSpace()),r.keywords(".","+=","=").surround(Fe.Formatting.noSpace()),r.keyword("}").prepend(Fe.Formatting.noSpace())}else if(co.isInferredType(e))this.getNodeFormatter(e).keywords("infer","infers").append(Fe.Formatting.oneSpace());else if(co.isAssignment(e))this.getNodeFormatter(e).keywords("=","+=","?=").surround(Fe.Formatting.noSpace());else if(co.isRuleCall(e)){let r=this.getNodeFormatter(e);r.keyword("<").surround(Fe.Formatting.noSpace()),r.keyword(",").append(Fe.Formatting.oneSpace()),r.properties("arguments").append(Fe.Formatting.noSpace())}co.isAbstractElement(e)&&this.getNodeFormatter(e).property("cardinality").prepend(Fe.Formatting.noSpace())}};ui.LangiumGrammarFormatter=Fg});var ef=b(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.SemanticTokensDecoder=qt.AbstractSemanticTokenProvider=qt.SemanticTokensBuilder=qt.DefaultSemanticTokenOptions=qt.AllSemanticTokenModifiers=qt.AllSemanticTokenTypes=void 0;var be=Xe(),Jc=Wt(),hq=Ie();qt.AllSemanticTokenTypes={[be.SemanticTokenTypes.class]:0,[be.SemanticTokenTypes.comment]:1,[be.SemanticTokenTypes.enum]:2,[be.SemanticTokenTypes.enumMember]:3,[be.SemanticTokenTypes.event]:4,[be.SemanticTokenTypes.function]:5,[be.SemanticTokenTypes.interface]:6,[be.SemanticTokenTypes.keyword]:7,[be.SemanticTokenTypes.macro]:8,[be.SemanticTokenTypes.method]:9,[be.SemanticTokenTypes.modifier]:10,[be.SemanticTokenTypes.namespace]:11,[be.SemanticTokenTypes.number]:12,[be.SemanticTokenTypes.operator]:13,[be.SemanticTokenTypes.parameter]:14,[be.SemanticTokenTypes.property]:15,[be.SemanticTokenTypes.regexp]:16,[be.SemanticTokenTypes.string]:17,[be.SemanticTokenTypes.struct]:18,[be.SemanticTokenTypes.type]:19,[be.SemanticTokenTypes.typeParameter]:20,[be.SemanticTokenTypes.variable]:21};qt.AllSemanticTokenModifiers={[be.SemanticTokenModifiers.abstract]:1<<0,[be.SemanticTokenModifiers.async]:1<<1,[be.SemanticTokenModifiers.declaration]:1<<2,[be.SemanticTokenModifiers.defaultLibrary]:1<<3,[be.SemanticTokenModifiers.definition]:1<<4,[be.SemanticTokenModifiers.deprecated]:1<<5,[be.SemanticTokenModifiers.documentation]:1<<6,[be.SemanticTokenModifiers.modification]:1<<7,[be.SemanticTokenModifiers.readonly]:1<<8,[be.SemanticTokenModifiers.static]:1<<9};qt.DefaultSemanticTokenOptions={legend:{tokenTypes:Object.keys(qt.AllSemanticTokenTypes),tokenModifiers:Object.keys(qt.AllSemanticTokenModifiers)},full:{delta:!0},range:!0};var Qc=class extends be.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,r,n,i,o){this._tokens.push({line:e,char:r,length:n,tokenType:i,tokenModifiers:o})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}applyTokens(){for(let e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,r){return e.line===r.line?e.char-r.char:e.line-r.line}};qt.SemanticTokensBuilder=Qc;var qg=class{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(r=>{this.tokensBuilders.delete(r.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(r=>{var n;this.initialize((n=r.capabilities.textDocument)===null||n===void 0?void 0:n.semanticTokens)})}initialize(e){this.clientCapabilities=e}semanticHighlight(e,r,n=be.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}semanticHighlightRange(e,r,n=be.CancellationToken.None){return this.currentRange=r.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}semanticHighlightDelta(e,r,n=be.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(r.previousResultId),this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.buildEdits()}createAcceptor(){return r=>{"line"in r?this.highlightToken({range:{start:{line:r.line,character:r.char},end:{line:r.line,character:r.char+r.length}},type:r.type,modifier:r.modifier}):"range"in r?this.highlightToken(r):"keyword"in r?this.highlightKeyword(r):"property"in r?this.highlightProperty(r):this.highlightNode({node:r.cst,type:r.type,modifier:r.modifier})}}getDocumentTokensBuilder(e){let r=this.tokensBuilders.get(e.uri.toString());if(r)return r;let n=new Qc;return this.tokensBuilders.set(e.uri.toString(),n),n}computeHighlighting(e,r,n){let i=e.parseResult.value;if(this.highlightElement(i,r)==="prune")return;let o=(0,hq.streamAllContents)(i).iterator(),a;do if(a=o.next(),!a.done){if(n.isCancellationRequested)break;let s=a.value,u=s.$cstNode.range,l=this.compareRange(u);if(l===1)break;if(l===-1)continue;this.highlightElement(s,r)==="prune"&&o.prune()}while(!a.done)}compareRange(e){if(!this.currentRange)return 0;let r=typeof e=="number"?e:e.start.line;return(typeof e=="number"?e:e.end.line)<this.currentRange.start.line?-1:r>this.currentRange.end.line?1:0}highlightToken(e){var r;let{range:n,type:i}=e,o=e.modifier;if(this.compareRange(n)!==0||!this.currentDocument||!this.currentTokensBuilder)return;let a=qt.AllSemanticTokenTypes[i],s=0;if(o!==void 0){typeof o=="string"&&(o=[o]);for(let c of o){let f=qt.AllSemanticTokenModifiers[c];s|=f}}let u=n.start.line,l=n.end.line;if(u===l){let c=n.start.character,f=n.end.character-c;this.currentTokensBuilder.push(u,c,f,a,s)}else if(!((r=this.clientCapabilities)===null||r===void 0)&&r.multilineTokenSupport){let c=n.start.character,f=this.currentDocument.textDocument.offsetAt(n.start),p=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(u,c,p-f,a,s)}else{let c=n.start,f=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(c.line,c.character,f-c.character-1,a,s);for(let p=u+1;p<l;p++){let h=f;f=this.currentDocument.textDocument.offsetAt({line:p+1,character:0}),this.currentTokensBuilder.push(p,0,f-h-1,a,s)}this.currentTokensBuilder.push(l,0,n.end.character,a,s)}}highlightProperty(e){let r=[];if(typeof e.index=="number"){let o=(0,Jc.findNodeForProperty)(e.node.$cstNode,e.property,e.index);o&&r.push(o)}else r.push(...(0,Jc.findNodesForProperty)(e.node.$cstNode,e.property));let{type:n,modifier:i}=e;for(let o of r)this.highlightNode({node:o,type:n,modifier:i})}highlightKeyword(e){let{node:r,keyword:n,type:i,index:o,modifier:a}=e,s=[];if(typeof o=="number"){let u=(0,Jc.findNodeForKeyword)(r.$cstNode,n,o);u&&s.push(u)}else s.push(...(0,Jc.findNodesForKeyword)(r.$cstNode,n));for(let u of s)this.highlightNode({node:u,type:i,modifier:a})}highlightNode(e){let{node:r,type:n,modifier:i}=e,o=r.range;this.highlightToken({range:o,type:n,modifier:i})}};qt.AbstractSemanticTokenProvider=qg;var mq;(function(t){function e(n,i){let o=new Map;Object.entries(qt.AllSemanticTokenTypes).forEach(([u,l])=>o.set(l,u));let a=0,s=0;return r(n.data,5).map(u=>{a+=u[0],u[0]!==0&&(s=0),s+=u[1];let l=u[2];return{offset:i.textDocument.offsetAt({line:a,character:s}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:i.textDocument.getText({start:{line:a,character:s},end:{line:a,character:s+l}})}})}t.decode=e;function r(n,i){let o=[];for(let a=0;a<n.length;a+=i){let s=n.slice(a,a+i);o.push(s)}return o}})(mq=qt.SemanticTokensDecoder||(qt.SemanticTokensDecoder={}))});var JA=b(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.LangiumGrammarSemanticTokenProvider=void 0;var Go=Xe(),gq=ef(),Uo=ot(),jg=class extends gq.AbstractSemanticTokenProvider{highlightElement(e,r){var n;(0,Uo.isAssignment)(e)?r({node:e,property:"feature",type:Go.SemanticTokenTypes.property}):(0,Uo.isAction)(e)?e.feature&&r({node:e,property:"feature",type:Go.SemanticTokenTypes.property}):(0,Uo.isReturnType)(e)?r({node:e,property:"name",type:Go.SemanticTokenTypes.type}):(0,Uo.isAtomType)(e)?(e.primitiveType||e.refType)&&r({node:e,property:e.primitiveType?"primitiveType":"refType",type:Go.SemanticTokenTypes.type}):(0,Uo.isParameter)(e)?r({node:e,property:"name",type:Go.SemanticTokenTypes.parameter}):(0,Uo.isParameterReference)(e)?r({node:e,property:"parameter",type:Go.SemanticTokenTypes.parameter}):(0,Uo.isRuleCall)(e)&&!((n=e.rule.ref)===null||n===void 0)&&n.fragment&&r({node:e,property:"rule",type:Go.SemanticTokenTypes.type})}};tf.LangiumGrammarSemanticTokenProvider=jg});var eE=b(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.LangiumGrammarNameProvider=void 0;var yq=Ua(),vq=Wt(),QA=ot(),Gg=class extends yq.DefaultNameProvider{getName(e){return(0,QA.isAssignment)(e)?e.feature:super.getName(e)}getNameNode(e){return(0,QA.isAssignment)(e)?(0,vq.findNodeForProperty)(e.$cstNode,"feature"):super.getNameNode(e)}};rf.LangiumGrammarNameProvider=Gg});var Hg=b(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.DefaultReferences=void 0;var _q=Wt(),li=Ie(),tE=pt(),rE=Bt(),Tq=uo(),Ug=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let r=(0,_q.findAssignment)(e),n=e.element;if(r&&n){let i=n[r.feature];if((0,li.isReference)(i))return i.ref;if(Array.isArray(i)){for(let o of i)if((0,li.isReference)(o)&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return o.ref}else return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r?.$cstNode){let n=this.nameProvider.getNameNode(r);return n||r.$cstNode}}findReferences(e,r){return r.onlyLocal?this.findLocalReferences(e,r.includeDeclaration):this.findGlobalReferences(e,r.includeDeclaration)}findGlobalReferences(e,r=!1){let n=[];if(r){let i=this.getReferenceToSelf(e);i&&n.push(i)}return n.push(...this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e))),(0,rE.stream)(n)}findLocalReferences(e,r=!1){let i=(0,li.getDocument)(e).parseResult.value,o=[];if(r){let s=this.getReferenceToSelf(e);s&&o.push(s)}let a=[];return(0,li.streamAst)(i).forEach(s=>{(0,li.streamReferences)(s).forEach(u=>{u.reference.ref===e&&a.push(u.reference)})}),a.forEach(s=>{o.push({sourceUri:(0,li.getDocument)(s.$refNode.element).uri,sourcePath:this.nodeLocator.getAstNodePath(s.$refNode.element),targetUri:(0,li.getDocument)(e).uri,targetPath:this.nodeLocator.getAstNodePath(e),segment:(0,tE.toDocumentSegment)(s.$refNode),local:(0,Tq.equalURI)((0,li.getDocument)(s.$refNode.element).uri,(0,li.getDocument)(e).uri)})}),(0,rE.stream)(o)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=(0,li.getDocument)(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:(0,tE.toDocumentSegment)(r),local:!0}}}};nf.DefaultReferences=Ug});var sE=b(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.LangiumGrammarReferences=void 0;var Rq=Hg(),gr=Ie(),nE=pt(),iE=Wt(),oE=Bt(),Bg=uo(),ar=ot(),aE=ir(),of=so(),Wg=class extends Rq.DefaultReferences{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}findDeclaration(e){let r=e.element,n=(0,iE.findAssignment)(e);if(n&&n.feature==="feature"){if((0,ar.isAssignment)(r))return this.findAssignmentDeclaration(r);if((0,ar.isAction)(r))return this.findActionDeclaration(r)}return super.findDeclaration(e)}findLocalReferences(e,r=!1){if((0,ar.isTypeAttribute)(e)){let i=(0,gr.getDocument)(e).parseResult.value;return this.findLocalReferencesToTypeAttribute(e,i,r)}else return super.findLocalReferences(e,r)}findGlobalReferences(e,r=!1){return(0,ar.isTypeAttribute)(e)?this.findReferencesToTypeAttribute(e,r):super.findGlobalReferences(e,r)}findLocalReferencesToTypeAttribute(e,r,n){let i=[],o=(0,gr.getContainerOfType)(e,ar.isInterface);if(o){let a=(0,of.collectChildrenTypes)(o,this,this.documents,this.nodeLocator),s=[];if(a.forEach(u=>{let l=this.findLocalRulesWithReturnType(u,r);s.push(...l)}),(0,Bg.equalURI)((0,gr.getDocument)(e).uri,(0,gr.getDocument)(r).uri)&&n){let u=this.getReferenceToSelf(e);u&&i.push(u)}s.forEach(u=>{let l=this.createReferencesToAttribute(u,e);i.push(...l)})}return(0,oE.stream)(i)}findReferencesToTypeAttribute(e,r){let n=[],i=(0,gr.getContainerOfType)(e,ar.isInterface);if(i){if(r){let s=this.getReferenceToSelf(e);s&&n.push(s)}let o=(0,of.collectChildrenTypes)(i,this,this.documents,this.nodeLocator),a=[];o.forEach(s=>{let u=this.findRulesWithReturnType(s);a.push(...u)}),a.forEach(s=>{let u=this.createReferencesToAttribute(s,e);n.push(...u)})}return(0,oE.stream)(n)}createReferencesToAttribute(e,r){let n=[];if((0,ar.isParserRule)(e)){let i=(0,aE.extractAssignments)(e.definition).find(o=>o.feature===r.name);if(i?.$cstNode){let o=this.nameProvider.getNameNode(i);o&&n.push({sourceUri:(0,gr.getDocument)(i).uri,sourcePath:this.nodeLocator.getAstNodePath(i),targetUri:(0,gr.getDocument)(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:(0,nE.toDocumentSegment)(o),local:(0,Bg.equalURI)((0,gr.getDocument)(i).uri,(0,gr.getDocument)(r).uri)})}}else{if(e.feature===r.name){let o=(0,iE.findNodeForProperty)(e.$cstNode,"feature");o&&n.push({sourceUri:(0,gr.getDocument)(e).uri,sourcePath:this.nodeLocator.getAstNodePath(e),targetUri:(0,gr.getDocument)(r).uri,targetPath:this.nodeLocator.getAstNodePath(r),segment:(0,nE.toDocumentSegment)(o),local:(0,Bg.equalURI)((0,gr.getDocument)(e).uri,(0,gr.getDocument)(r).uri)})}let i=(0,gr.getContainerOfType)(e,ar.isParserRule);n.push(...this.createReferencesToAttribute(i,r))}return n}findAssignmentDeclaration(e){var r;let n=(0,gr.getContainerOfType)(e,ar.isParserRule),i=(0,aE.getActionAtElement)(e);if(i){let o=this.findActionDeclaration(i,e.feature);if(o)return o}if(!((r=n?.returnType)===null||r===void 0)&&r.ref&&((0,ar.isInterface)(n.returnType.ref)||(0,ar.isType)(n.returnType.ref))){let o=(0,of.collectSuperTypes)(n.returnType.ref);for(let a of o){let s=a.attributes.find(u=>u.name===e.feature);if(s)return s}}return e}findActionDeclaration(e,r){var n;if(!((n=e.type)===null||n===void 0)&&n.ref){let i=r??e.feature,o=(0,of.collectSuperTypes)(e.type.ref);for(let a of o){let s=a.attributes.find(u=>u.name===i);if(s)return s}}}findRulesWithReturnType(e){let r=[];return this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)).forEach(i=>{let o=this.documents.getOrCreateDocument(i.sourceUri),a=this.nodeLocator.getAstNode(o,i.sourcePath);((0,ar.isParserRule)(a)||(0,ar.isAction)(a))&&r.push(a)}),r}findLocalRulesWithReturnType(e,r){let n=[];return(0,gr.streamAst)(r).filter(o=>{var a,s;return(0,ar.isParserRule)(o)&&((a=o.returnType)===null||a===void 0?void 0:a.ref)===e||(0,ar.isAction)(o)&&((s=o.type)===null||s===void 0?void 0:s.ref)===e}).forEach(o=>{((0,ar.isParserRule)(o)||(0,ar.isAction)(o))&&n.push(o)}),n}};af.LangiumGrammarReferences=Wg});var Vg=b(an=>{"use strict";var bq=an&&an.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Aq=an&&an.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Eq=an&&an.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bq(e,t,r);return Aq(e,t),e};Object.defineProperty(an,"__esModule",{value:!0});an.findFirstFeatures=an.findNextFeatures=void 0;var yr=Eq(ot()),Mi=ir(),uE=Ie(),Cq=Wt();function xq(t,e){let r={stacks:t,tokens:e};return wq(r),r.stacks.flat().forEach(i=>{i.property=void 0}),fE(r.stacks).map(i=>i[i.length-1])}an.findNextFeatures=xq;function Kg(t){let{next:e,cardinalities:r,visited:n,plus:i}=t,o=[],a=e.feature;if(n.has(a))return[];n.add(a);let s,u=a;for(;u.$container;)if(yr.isGroup(u.$container)){s=u.$container;break}else if(yr.isAbstractElement(u.$container))u=u.$container;else break;if((0,Mi.isArrayCardinality)(u.cardinality)){let l=Ba({next:{feature:u,type:e.type,new:!1},cardinalities:r,visited:n,plus:i});for(let c of l)i.add(c.feature);o.push(...l)}if(s){let l=s.elements.indexOf(u);l!==void 0&&l<s.elements.length-1&&o.push(...cE({feature:s,type:e.type,new:!1},l+1,r,n,i)),o.every(c=>(0,Mi.isOptionalCardinality)(c.feature.cardinality)||(0,Mi.isOptionalCardinality)(r.get(c.feature))||i.has(c.feature))&&o.push(...Kg({next:{feature:s,type:e.type,new:!1},cardinalities:r,visited:n,plus:i}))}return o}function lE(t){return(0,uE.isAstNode)(t)&&(t={feature:t}),Ba({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}an.findFirstFeatures=lE;function Ba(t){var e,r,n;let{next:i,cardinalities:o,visited:a,plus:s}=t;if(i===void 0)return[];let{feature:u,type:l}=i;if(yr.isGroup(u)){if(a.has(u))return[];a.add(u)}if(yr.isGroup(u))return cE(i,0,o,a,s).map(c=>sf(c,u.cardinality,o));if(yr.isAlternatives(u)||yr.isUnorderedGroup(u))return u.elements.flatMap(c=>Ba({next:{feature:c,new:!1,type:l},cardinalities:o,visited:a,plus:s})).map(c=>sf(c,u.cardinality,o));if(yr.isAssignment(u)){let c={feature:u.terminal,new:!1,type:l,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return Ba({next:c,cardinalities:o,visited:a,plus:s}).map(f=>sf(f,u.cardinality,o))}else{if(yr.isAction(u))return Kg({next:{feature:u,new:!0,type:(0,Mi.getTypeName)(u),property:(r=i.property)!==null&&r!==void 0?r:u.feature},cardinalities:o,visited:a,plus:s});if(yr.isRuleCall(u)&&yr.isParserRule(u.rule.ref)){let c=u.rule.ref,f={feature:c.definition,new:!0,type:c.fragment?void 0:(n=(0,Mi.getExplicitRuleType)(c))!==null&&n!==void 0?n:c.name,property:i.property};return Ba({next:f,cardinalities:o,visited:a,plus:s}).map(p=>sf(p,u.cardinality,o))}else return[i]}}function sf(t,e,r){return r.set(t.feature,e),t}function cE(t,e,r,n,i){var o;let a=[],s;for(;e<t.feature.elements.length&&(s={feature:t.feature.elements[e++],new:!1,type:t.type},a.push(...Ba({next:s,cardinalities:r,visited:n,plus:i})),!!(0,Mi.isOptionalCardinality)((o=s.feature.cardinality)!==null&&o!==void 0?o:r.get(s.feature))););return a}function wq(t){for(let e of t.tokens){let r=fE(t.stacks,e);t.stacks=r}}function fE(t,e){let r=[];for(let n of t)r.push(...Sq(n,e));return r}function Sq(t,e){let r=new Map,n=new Set(t.map(o=>o.feature).filter(kq)),i=[];for(;t.length>0;){let o=t.pop(),a=Kg({next:o,cardinalities:r,plus:n,visited:new Set}).filter(s=>e?zg(s.feature,e):!0);for(let s of a)i.push([...t,s]);if(!a.every(s=>(0,Mi.isOptionalCardinality)(s.feature.cardinality)||(0,Mi.isOptionalCardinality)(r.get(s.feature))))break}return i}function kq(t){if(t.cardinality==="+")return!0;let e=(0,uE.getContainerOfType)(t,yr.isAssignment);return!!(e&&e.cardinality==="+")}function zg(t,e){if(yr.isKeyword(t))return t.value===e.image;if(yr.isRuleCall(t))return Pq(t.rule.ref,e);if(yr.isCrossReference(t)){let r=(0,Cq.getCrossReferenceTerminal)(t);if(r)return zg(r,e)}return!1}function Pq(t,e){return yr.isParserRule(t)?lE(t.definition).some(n=>zg(n.feature,e)):yr.isTerminalRule(t)?new RegExp((0,Mi.terminalRegex)(t)).test(e.image):!1}});var Zg=b(ci=>{"use strict";var Dq=ci&&ci.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Nq=ci&&ci.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Oq=ci&&ci.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Dq(e,t,r);return Nq(e,t),e};Object.defineProperty(ci,"__esModule",{value:!0});ci.DefaultCompletionProvider=void 0;var pu=Xe(),hu=Oq(ot()),Iq=ir(),Yg=Ie(),$q=pt(),dE=Wt(),pE=Bt(),uf=Vg(),Xg=class{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async getCompletion(e,r){let i=e.parseResult.value.$cstNode;if(!i)return;let o=[],a=e.textDocument,s=a.getText(),u=a.offsetAt(r.position),l=(C,x)=>{let T=this.fillCompletionItem(a,u,C,x);T&&o.push(T)},c=(0,$q.findLeafNodeAtOffset)(i,this.backtrackToAnyToken(s,u));if(!c){let C=(0,dE.getEntryRule)(this.grammar);return await this.completionForRule(void 0,C,l),pu.CompletionList.create(o,!0)}let f=this.backtrackToTokenStart(s,u),p=this.findFeaturesAt(a,f),h=[],d=u!==f;d&&(h=this.findFeaturesAt(a,u));let g=C=>hu.isKeyword(C.feature)?C.feature.value:C.feature;if(await Promise.all((0,pE.stream)(p).distinct(g).map(C=>this.completionFor(c.element,C,l))),d){let C=a.getText({start:a.positionAt(f),end:r.position}).toLowerCase();o=o.filter(x=>x.label.toLowerCase().startsWith(C)),await Promise.all((0,pE.stream)(h).exclude(p,g).distinct(g).map(x=>this.completionFor(c.element,x,l)))}return pu.CompletionList.create(o,!0)}findFeaturesAt(e,r){let n=e.getText({start:pu.Position.create(0,0),end:e.positionAt(r)}),i=this.completionParser.parse(n),o=i.tokens;if(i.tokenIndex===0){let u=(0,dE.getEntryRule)(this.grammar),l=(0,uf.findFirstFeatures)({feature:u.definition,new:!0,type:(0,Iq.getExplicitRuleType)(u)});return o.length>0?(o.shift(),(0,uf.findNextFeatures)(l.map(c=>[c]),o)):l}let a=[...o].splice(i.tokenIndex);return(0,uf.findNextFeatures)([i.elementStack.map(u=>({feature:u}))],a)}backtrackToAnyToken(e,r){for(r>=e.length&&(r=e.length-1);r>0&&/\s/.test(e.charAt(r));)r--;return r}backtrackToTokenStart(e,r){if(r<1)return r;let n=this.grammarConfig.nameRegexp,i=e.charAt(r-1);for(;r>0&&n.test(i);)r--,i=e.charAt(r-1);return r}async completionForRule(e,r,n){if(hu.isParserRule(r)){let i=(0,uf.findFirstFeatures)(r.definition);await Promise.all(i.map(o=>this.completionFor(e,o,n)))}}completionFor(e,r,n){if(hu.isKeyword(r.feature))return this.completionForKeyword(r.feature,e,n);if(hu.isCrossReference(r.feature)&&e)return this.completionForCrossReference(r,e,n)}completionForCrossReference(e,r,n){let i=(0,Yg.getContainerOfType)(e.feature,hu.isAssignment);if(i){if(e.type&&(e.new||r?.$type!==e.type)&&(r={$type:e.type,$container:r,$containerProperty:e.property}),!r)return;let o={reference:{},container:r,property:i.feature};try{let a=this.scopeProvider.getScope(o),s=new Set;a.getAllElements().forEach(u=>{!s.has(u.name)&&this.filterCrossReference(u)&&(n(u,this.createReferenceCompletionItem(u)),s.add(u.name))})}catch(a){console.error(a)}}}createReferenceCompletionItem(e){return{kind:pu.CompletionItemKind.Reference,detail:e.type,sortText:"0"}}filterCrossReference(e){return!0}completionForKeyword(e,r,n){!e.value.match(/[\w]+/)||n(e.value,{kind:pu.CompletionItemKind.Keyword,detail:"Keyword",sortText:/\w/.test(e.value)?"1":"2"})}fillCompletionItem(e,r,n,i){let o;if(typeof n=="string")o=n;else if((0,Yg.isAstNode)(n)){let u=this.nameProvider.getName(n);if(!u)return;o=u}else if(!(0,Yg.isAstNode)(n))o=n.name;else return;let a=this.buildCompletionTextEdit(e,r,o);return a?Object.assign({label:o,textEdit:a},i):void 0}buildCompletionTextEdit(e,r,n){let i=0,o=e.getText(),a=o.toLowerCase(),s=n.toLowerCase();for(let u=s.length;u>0;u--){let l=a.substring(r-u,r);if(s.startsWith(l)&&(u===0||!this.isWordCharacterAt(a,r-u-1))){i=u;break}}if(i>0||r===0||!this.isWordCharacterAt(n,0)||!this.isWordCharacterAt(o,r-1)){let u=e.positionAt(r-i),l=e.positionAt(r);return{newText:n,range:{start:u,end:l}}}else return}isWordCharacterAt(e,r){return this.grammarConfig.nameRegexp.test(e.charAt(r))}};ci.DefaultCompletionProvider=Xg});var mE=b(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0})});var Qg=b(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.DefaultDocumentHighlightProvider=void 0;var Mq=Xe(),Lq=Ie(),Fq=pt(),qq=uo(),Jg=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,r){let n=e.parseResult.value.$cstNode;if(!n)return;let i=(0,Fq.findDeclarationNodeAtOffset)(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclaration(i);if(o){let a=[],u={onlyLocal:!0,includeDeclaration:(0,qq.equalURI)((0,Lq.getDocument)(o).uri,e.uri)};return this.references.findReferences(o,u).forEach(l=>{a.push(this.createDocumentHighlight(l))}),a}}createDocumentHighlight(e){return Mq.DocumentHighlight.create(e.segment.range)}};lf.DefaultDocumentHighlightProvider=Jg});var yE=b(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0})});var ty=b(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.DefaultDocumentSymbolProvider=void 0;var jq=Xe(),Gq=Ie(),ey=class{constructor(e){this.nameProvider=e.references.NameProvider}getSymbols(e){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,r){let n=r.$cstNode,i=this.nameProvider.getNameNode(r);if(i&&n){let o=this.nameProvider.getName(r);return[{kind:this.getSymbolKind(r.$type),name:o??i.text,range:n.range,selectionRange:i.range,children:this.getChildSymbols(e,r)}]}else return this.getChildSymbols(e,r)||[]}getChildSymbols(e,r){let n=[];for(let i of(0,Gq.streamContents)(r)){let o=this.getSymbol(e,i);n.push(...o)}if(n.length>0)return n}getSymbolKind(e){return jq.SymbolKind.Field}};cf.DefaultDocumentSymbolProvider=ey});var vE=b(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.AbstractExecuteCommandHandler=void 0;var Uq=Xe(),ry=class{constructor(){this.registeredCommands=new Map,this.registerCommands(this.createCommandAcceptor())}get commands(){return Array.from(this.registeredCommands.keys())}async executeCommand(e,r,n=Uq.CancellationToken.None){let i=this.registeredCommands.get(e);if(i)return i(r,n)}createCommandAcceptor(){return(e,r)=>this.registeredCommands.set(e,r)}};ff.AbstractExecuteCommandHandler=ry});var iy=b(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.DefaultDefinitionProvider=void 0;var Hq=Xe(),Bq=Ie(),Wq=pt(),ny=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,r){let n=e.parseResult.value;if(n.$cstNode){let i=n.$cstNode,o=(0,Wq.findDeclarationNodeAtOffset)(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,r)}}collectLocationLinks(e,r){var n;let i=this.findLink(e);if(i)return[Hq.LocationLink.create(i.targetDocument.textDocument.uri,((n=i.target.element.$cstNode)!==null&&n!==void 0?n:i.target).range,i.target.range,i.source.range)]}findLink(e){let r=this.references.findDeclarationNode(e);if(r?.element){let n=(0,Bq.getDocument)(r.element);if(r&&n)return{source:e,target:r,targetDocument:n}}}};df.DefaultDefinitionProvider=ny});var ay=b(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.MultilineCommentHoverProvider=Wa.AstNodeHoverProvider=void 0;var _E=pt(),pf=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,r){var n,i;let o=(i=(n=e.parseResult)===null||n===void 0?void 0:n.value)===null||i===void 0?void 0:i.$cstNode;if(o){let a=e.textDocument.offsetAt(r.position),s=(0,_E.findDeclarationNodeAtOffset)(o,a,this.grammarConfig.nameRegexp);if(s&&s.offset+s.length>a){let u=this.references.findDeclaration(s);if(u)return this.getAstNodeHoverContent(u)}}}};Wa.AstNodeHoverProvider=pf;var oy=class extends pf{constructor(){super(...arguments),this.commentContentRegex=/\/\*([\s\S]*?)\*\//}getAstNodeHoverContent(e){let r=(0,_E.findCommentNode)(e.$cstNode,this.grammarConfig.multilineCommentRules),n;if(r){let i=this.commentContentRegex.exec(r.text);i&&i[1]&&(n=this.getCommentContent(i[1]))}if(n)return{contents:{kind:"markdown",value:n}}}getCommentContent(e){return e.split(`
3606
+ `).map(n=>(n=n.trim(),n.startsWith("*")&&(n=n.substring(1).trim()),n)).join(" ").trim()}};Wa.MultilineCommentHoverProvider=oy});var TE=b(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.AbstractGoToImplementationProvider=void 0;var Kq=Xe(),zq=pt(),sy=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getImplementation(e,r,n=Kq.CancellationToken.None){let i=e.parseResult.value;if(i.$cstNode){let o=(0,zq.findDeclarationNodeAtOffset)(i.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(o){let a=this.references.findDeclaration(o);if(a)return this.collectGoToImplementationLocationLinks(a,n)}}}};hf.AbstractGoToImplementationProvider=sy});var Ho=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.DefaultLangiumDocuments=qn.DefaultLangiumDocumentFactory=qn.DefaultTextDocumentFactory=qn.DocumentState=void 0;var RE=_c(),Vq=$n(),Yq=Bt(),fy;(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"})(fy=qn.DocumentState||(qn.DocumentState={}));var uy=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.fileSystemProvider=e.workspace.FileSystemProvider}fromUri(e){let r=this.getContent(e),n=this.serviceRegistry.getServices(e);return RE.TextDocument.create(e.toString(),n.LanguageMetaData.languageId,0,r)}getContent(e){return this.fileSystemProvider.readFileSync(e)}};qn.DefaultTextDocumentFactory=uy;var ly=class{constructor(e){this.serviceRegistry=e.ServiceRegistry}fromTextDocument(e,r){return this.create(e,void 0,void 0,r)}fromString(e,r){return this.create(void 0,e,void 0,r)}fromModel(e,r){return this.create(void 0,void 0,e,r)}create(e,r,n,i){i===void 0&&(i=Vq.URI.parse(e.uri));let o=this.serviceRegistry.getServices(i),a;return n===void 0?a=o.parser.LangiumParser.parse(r??e.getText()):a={value:n,parserErrors:[],lexerErrors:[]},this.createLangiumDocument(a,i,e??{$template:!0,languageId:o.LanguageMetaData.languageId,uri:i,text:r})}createLangiumDocument(e,r,n){let i,o=this,a={parseResult:e,uri:r,state:fy.Parsed,references:[],get textDocument(){return i||(i=n.$template?o.createTextDocument(n):n),i}};return e.value.$document=a,a}createTextDocument(e){var r;return RE.TextDocument.create(e.uri.toString(),e.languageId,0,(r=e.text)!==null&&r!==void 0?r:"")}};qn.DefaultLangiumDocumentFactory=ly;var cy=class{constructor(e){this.documentMap=new Map,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return(0,Yq.stream)(this.documentMap.values())}addDocument(e){let r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getOrCreateDocument(e){let r=e.toString(),n=this.documentMap.get(r);if(n)return n;let i=this.textDocuments.get(r);return i?n=this.langiumDocumentFactory.fromTextDocument(i,e):n=this.langiumDocumentFactory.fromString(this.getContent(e),e),this.documentMap.set(r,n),n}getContent(e){return this.fileSystemProvider.readFileSync(e)}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);n&&(n.state=fy.Changed,this.documentMap.delete(r))}};qn.DefaultLangiumDocuments=cy});var py=b(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.mergeSignatureHelpOptions=Ka.AbstractSignatureHelpProvider=void 0;var Xq=Xe(),Zq=pt(),dy=class{provideSignatureHelp(e,r,n=Xq.CancellationToken.None){let o=e.parseResult.value.$cstNode;if(o){let a=(0,Zq.findLeafNodeAtOffset)(o,e.textDocument.offsetAt(r.position));if(a)return this.getSignatureFromElement(a.element,n)}}get signatureHelpOptions(){return{triggerCharacters:["("],retriggerCharacters:[","]}}};Ka.AbstractSignatureHelpProvider=dy;function Jq(t){let e=[],r=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&r.push(...i.retriggerCharacters)});let n={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:r.length>0?Array.from(new Set(r)).sort():void 0};return n.triggerCharacters?n:void 0}Ka.mergeSignatureHelpOptions=Jq});var gy=b(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.createRequestHandler=oe.createServerRequestHandler=oe.createCallHierarchyRequestHandler=oe.addCallHierarchyHandler=oe.addSignatureHelpHandler=oe.addDocumentLinkHandler=oe.addExecuteCommandHandler=oe.addConfigurationChangeHandler=oe.addSemanticTokenHandler=oe.addRenameHandler=oe.addFormattingHandler=oe.addFoldingRangeHandler=oe.addHoverHandler=oe.addDocumentHighlightsHandler=oe.addGoToImplementationHandler=oe.addGoToTypeDefinitionHandler=oe.addGotoDefinitionHandler=oe.addDocumentSymbolHandler=oe.addCodeActionHandler=oe.addFindReferencesHandler=oe.addCompletionHandler=oe.addDiagnosticsHandler=oe.addDocumentsHandler=oe.startLanguageServer=oe.DefaultLanguageServer=void 0;var $r=Xe(),za=$n(),bE=eu(),Qq=In(),ej=Ho(),tj=ef(),rj=py(),hy=class{constructor(e){this.onInitializeEmitter=new $r.Emitter,this.onInitializedEmitter=new $r.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){(0,bE.eagerLoad)(this.services),this.services.ServiceRegistry.all.forEach(e=>(0,bE.eagerLoad)(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var r;let n=this.services.ServiceRegistry.all,i=this.hasService($=>$.lsp.Formatter),o=n.map($=>{var X;return(X=$.lsp.Formatter)===null||X===void 0?void 0:X.formatOnTypeOptions}).find($=>!!$),a=this.hasService($=>$.lsp.CodeActionProvider),s=this.hasService($=>$.lsp.SemanticTokenProvider),u=(r=this.services.lsp.ExecuteCommandHandler)===null||r===void 0?void 0:r.commands,l=this.services.lsp.DocumentLinkProvider,c=(0,rj.mergeSignatureHelpOptions)(n.map($=>{var X;return(X=$.lsp.SignatureHelp)===null||X===void 0?void 0:X.signatureHelpOptions})),f=this.hasService($=>$.lsp.TypeProvider),p=this.hasService($=>$.lsp.ImplementationProvider),h=this.hasService($=>$.lsp.CompletionProvider),d=this.hasService($=>$.lsp.ReferencesProvider),g=this.hasService($=>$.lsp.DocumentSymbolProvider),C=this.hasService($=>$.lsp.DefinitionProvider),x=this.hasService($=>$.lsp.DocumentHighlightProvider),T=this.hasService($=>$.lsp.FoldingRangeProvider),v=this.hasService($=>$.lsp.HoverProvider),k=this.hasService($=>$.lsp.RenameProvider),j=this.hasService($=>$.lsp.CallHierarchyProvider);return{capabilities:{workspace:{workspaceFolders:{supported:!0}},executeCommandProvider:u&&{commands:u},textDocumentSync:$r.TextDocumentSyncKind.Incremental,completionProvider:h?{}:void 0,referencesProvider:d,documentSymbolProvider:g,definitionProvider:C,typeDefinitionProvider:f,documentHighlightProvider:x,codeActionProvider:a,documentFormattingProvider:i,documentRangeFormattingProvider:i,documentOnTypeFormattingProvider:o,foldingRangeProvider:T,hoverProvider:v,renameProvider:k?{prepareProvider:!0}:void 0,semanticTokensProvider:s?tj.DefaultSemanticTokenOptions:void 0,signatureHelpProvider:c,implementationProvider:p,callHierarchyProvider:j?{}:void 0,documentLinkProvider:l?{resolveProvider:!!l.resolveDocumentLink}:void 0}}}async initialized(e){this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}};oe.DefaultLanguageServer=hy;function nj(t){let e=t.lsp.Connection;if(!e)throw new Error("Starting a language server requires the languageServer.Connection service to be set.");AE(e,t),EE(e,t),CE(e,t),xE(e,t),SE(e,t),kE(e,t),PE(e,t),DE(e,t),NE(e,t),IE(e,t),$E(e,t),wE(e,t),ME(e,t),OE(e,t),LE(e,t),qE(e,t),GE(e,t),UE(e,t),jE(e,t),FE(e,t),e.onInitialize(n=>t.lsp.LanguageServer.initialize(n)),e.onInitialized(n=>t.lsp.LanguageServer.initialized(n)),t.workspace.TextDocuments.listen(e),e.listen()}oe.startLanguageServer=nj;function AE(t,e){let r=e.workspace.DocumentBuilder,n=e.workspace.MutexLock;function i(a,s){n.lock(u=>r.update(a,s,u))}e.workspace.TextDocuments.onDidChangeContent(a=>{i([za.URI.parse(a.document.uri)],[])}),t.onDidChangeWatchedFiles(a=>{let s=a.changes.filter(l=>l.type!==$r.FileChangeType.Deleted).map(l=>za.URI.parse(l.uri)),u=a.changes.filter(l=>l.type===$r.FileChangeType.Deleted).map(l=>za.URI.parse(l.uri));i(s,u)})}oe.addDocumentsHandler=AE;function EE(t,e){e.workspace.DocumentBuilder.onBuildPhase(ej.DocumentState.Validated,async(n,i)=>{for(let o of n)if(o.diagnostics&&t.sendDiagnostics({uri:o.uri.toString(),diagnostics:o.diagnostics}),i.isCancellationRequested)return})}oe.addDiagnosticsHandler=EE;function CE(t,e){t.onCompletion(vr((r,n,i,o)=>{var a;return(a=r.lsp.CompletionProvider)===null||a===void 0?void 0:a.getCompletion(n,i,o)},e))}oe.addCompletionHandler=CE;function xE(t,e){t.onReferences(vr((r,n,i,o)=>{var a;return(a=r.lsp.ReferencesProvider)===null||a===void 0?void 0:a.findReferences(n,i,o)},e))}oe.addFindReferencesHandler=xE;function wE(t,e){t.onCodeAction(vr((r,n,i,o)=>{var a;return(a=r.lsp.CodeActionProvider)===null||a===void 0?void 0:a.getCodeActions(n,i,o)},e))}oe.addCodeActionHandler=wE;function SE(t,e){t.onDocumentSymbol(vr((r,n,i,o)=>{var a;return(a=r.lsp.DocumentSymbolProvider)===null||a===void 0?void 0:a.getSymbols(n,i,o)},e))}oe.addDocumentSymbolHandler=SE;function kE(t,e){t.onDefinition(vr((r,n,i,o)=>{var a;return(a=r.lsp.DefinitionProvider)===null||a===void 0?void 0:a.getDefinition(n,i,o)},e))}oe.addGotoDefinitionHandler=kE;function PE(t,e){t.onTypeDefinition(vr((r,n,i,o)=>{var a;return(a=r.lsp.TypeProvider)===null||a===void 0?void 0:a.getTypeDefinition(n,i,o)},e))}oe.addGoToTypeDefinitionHandler=PE;function DE(t,e){t.onImplementation(vr((r,n,i,o)=>{var a;return(a=r.lsp.ImplementationProvider)===null||a===void 0?void 0:a.getImplementation(n,i,o)},e))}oe.addGoToImplementationHandler=DE;function NE(t,e){t.onDocumentHighlight(vr((r,n,i,o)=>{var a;return(a=r.lsp.DocumentHighlightProvider)===null||a===void 0?void 0:a.getDocumentHighlight(n,i,o)},e))}oe.addDocumentHighlightsHandler=NE;function OE(t,e){t.onHover(vr((r,n,i,o)=>{var a;return(a=r.lsp.HoverProvider)===null||a===void 0?void 0:a.getHoverContent(n,i,o)},e))}oe.addHoverHandler=OE;function IE(t,e){t.onFoldingRanges(vr((r,n,i,o)=>{var a;return(a=r.lsp.FoldingRangeProvider)===null||a===void 0?void 0:a.getFoldingRanges(n,i,o)},e))}oe.addFoldingRangeHandler=IE;function $E(t,e){t.onDocumentFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocument(n,i,o)},e)),t.onDocumentRangeFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocumentRange(n,i,o)},e)),t.onDocumentOnTypeFormatting(vr((r,n,i,o)=>{var a;return(a=r.lsp.Formatter)===null||a===void 0?void 0:a.formatDocumentOnType(n,i,o)},e))}oe.addFormattingHandler=$E;function ME(t,e){t.onRenameRequest(vr((r,n,i,o)=>{var a;return(a=r.lsp.RenameProvider)===null||a===void 0?void 0:a.rename(n,i,o)},e)),t.onPrepareRename(vr((r,n,i,o)=>{var a;return(a=r.lsp.RenameProvider)===null||a===void 0?void 0:a.prepareRename(n,i,o)},e))}oe.addRenameHandler=ME;function LE(t,e){let r="No semantic token provider registered";t.languages.semanticTokens.on(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlight(i,o,a):new $r.ResponseError(0,r),e)),t.languages.semanticTokens.onDelta(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightDelta(i,o,a):new $r.ResponseError(0,r),e)),t.languages.semanticTokens.onRange(Bo((n,i,o,a)=>n.lsp.SemanticTokenProvider?n.lsp.SemanticTokenProvider.semanticHighlightRange(i,o,a):new $r.ResponseError(0,r),e))}oe.addSemanticTokenHandler=LE;function FE(t,e){t.onDidChangeConfiguration(r=>{r.settings&&e.workspace.ConfigurationProvider.updateConfiguration(r)})}oe.addConfigurationChangeHandler=FE;function qE(t,e){let r=e.lsp.ExecuteCommandHandler;r&&t.onExecuteCommand(async(n,i)=>{var o;try{return await r.executeCommand(n.command,(o=n.arguments)!==null&&o!==void 0?o:[],i)}catch(a){return mu(a)}})}oe.addExecuteCommandHandler=qE;function jE(t,e){var r;let n=e.lsp.DocumentLinkProvider;if(n){t.onDocumentLinks(Bo((o,a,s,u)=>n.getDocumentLinks(a,s,u),e));let i=(r=n.resolveDocumentLink)===null||r===void 0?void 0:r.bind(n);i&&t.onDocumentLinkResolve(async(o,a)=>{try{return await i(o,a)}catch(s){return mu(s)}})}}oe.addDocumentLinkHandler=jE;function GE(t,e){t.onSignatureHelp(Bo((r,n,i,o)=>{var a;return(a=r.lsp.SignatureHelp)===null||a===void 0?void 0:a.provideSignatureHelp(n,i,o)},e))}oe.addSignatureHelpHandler=GE;function UE(t,e){let r="No call hierarchy provider registered";t.languages.callHierarchy.onPrepare(Bo((n,i,o,a)=>{var s;return n.lsp.CallHierarchyProvider?(s=n.lsp.CallHierarchyProvider.prepareCallHierarchy(i,o,a))!==null&&s!==void 0?s:null:new $r.ResponseError(0,r)},e)),t.languages.callHierarchy.onIncomingCalls(my((n,i,o)=>{var a;return n.lsp.CallHierarchyProvider?(a=n.lsp.CallHierarchyProvider.incomingCalls(i,o))!==null&&a!==void 0?a:null:new $r.ResponseError(0,r)},e)),t.languages.callHierarchy.onOutgoingCalls(my((n,i,o)=>{var a;return n.lsp.CallHierarchyProvider?(a=n.lsp.CallHierarchyProvider.outgoingCalls(i,o))!==null&&a!==void 0?a:null:new $r.ResponseError(0,r)},e))}oe.addCallHierarchyHandler=UE;function my(t,e){let r=e.ServiceRegistry;return async(n,i)=>{let o=za.URI.parse(n.item.uri),a=r.getServices(o);if(!a)throw console.error(`Could not find service instance for uri: '${o.toString()}'`),new Error;try{return await t(a,n,i)}catch(s){return mu(s)}}}oe.createCallHierarchyRequestHandler=my;function Bo(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let a=za.URI.parse(i.textDocument.uri),s=n.getServices(a);if(!s)throw console.error(`Could not find service instance for uri: '${a.toString()}'`),new Error;let u=r.getOrCreateDocument(a);if(!u)throw new Error;try{return await t(s,u,i,o)}catch(l){return mu(l)}}}oe.createServerRequestHandler=Bo;function vr(t,e){let r=e.workspace.LangiumDocuments,n=e.ServiceRegistry;return async(i,o)=>{let a=za.URI.parse(i.textDocument.uri),s=n.getServices(a);if(!s)return console.error(`Could not find service instance for uri: '${a.toString()}'`),null;let u=r.getOrCreateDocument(a);if(!u)return null;try{return await t(s,u,i,o)}catch(l){return mu(l)}}}oe.createRequestHandler=vr;function mu(t){if((0,Qq.isOperationCancelled)(t))return new $r.ResponseError($r.LSPErrorCodes.RequestCancelled,"The request has been cancelled.");if(t instanceof $r.ResponseError)return t;throw t}});var vy=b(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.DefaultReferencesProvider=void 0;var HE=Xe(),ij=Ie(),oj=pt(),yy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,r){let n=e.parseResult.value.$cstNode;if(!n)return[];let i=(0,oj.findDeclarationNodeAtOffset)(n,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);return i?this.getReferences(i,r,e):[]}getReferences(e,r,n){let i=[],o=this.references.findDeclaration(e);if(o){let a={includeDeclaration:r.context.includeDeclaration};this.references.findReferences(o,a).forEach(s=>{(0,ij.isReference)(s)?i.push(HE.Location.create(n.uri.toString(),s.$refNode.range)):i.push(HE.Location.create(s.sourceUri.toString(),s.segment.range))})}return i}};mf.DefaultReferencesProvider=yy});var Ty=b(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.DefaultRenameProvider=void 0;var aj=Xe(),sj=Ua(),BE=pt(),_y=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,r){let n={},i=e.parseResult.value.$cstNode;if(!i)return;let o=e.textDocument.offsetAt(r.position),a=(0,BE.findDeclarationNodeAtOffset)(i,o,this.grammarConfig.nameRegexp);if(!a)return;let s=this.references.findDeclaration(a);if(!s)return;let u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(s,u).forEach(c=>{let f=aj.TextEdit.replace(c.segment.range,r.newName),p=c.sourceUri.toString();n[p]?n[p].push(f):n[p]=[f]}),{changes:n}}prepareRename(e,r){return this.renameNodeRange(e,r.position)}renameNodeRange(e,r){let n=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(r);if(n&&i){let o=(0,BE.findDeclarationNodeAtOffset)(n,i,this.grammarConfig.nameRegexp);if(!o)return;if(this.references.findDeclaration(o)||this.isNameNode(o))return o.range}}isNameNode(e){return e?.element&&(0,sj.isNamed)(e.element)&&e===this.nameProvider.getNameNode(e.element)}};gf.DefaultRenameProvider=_y});var WE=b(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.AbstractTypeDefinitionProvider=void 0;var uj=Xe(),lj=pt(),Ry=class{constructor(e){this.references=e.references.References}getTypeDefinition(e,r,n=uj.CancellationToken.None){let i=e.parseResult.value;if(i.$cstNode){let o=(0,lj.findDeclarationNodeAtOffset)(i.$cstNode,e.textDocument.offsetAt(r.position));if(o){let a=this.references.findDeclaration(o);if(a)return this.collectGoToTypeLocationLinks(a,n)}}}};yf.AbstractTypeDefinitionProvider=Ry});var by=b(ht=>{"use strict";var cj=ht&&ht.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Yt=ht&&ht.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cj(e,t,r)};Object.defineProperty(ht,"__esModule",{value:!0});Yt(Zg(),ht);Yt(Vg(),ht);Yt(mE(),ht);Yt(Qg(),ht);Yt(yE(),ht);Yt(ty(),ht);Yt(vE(),ht);Yt(Vc(),ht);Yt(iy(),ht);Yt(ay(),ht);Yt(Lg(),ht);Yt(TE(),ht);Yt(gy(),ht);Yt(vy(),ht);Yt(Ty(),ht);Yt(ef(),ht);Yt(py(),ht);Yt(WE(),ht)});var KE=b(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.LangiumGrammarDefinitionProvider=void 0;var Ay=Xe(),fj=by(),dj=Ie(),pj=Wt(),hj=ot(),mj=ir(),Ey=class extends fj.DefaultDefinitionProvider{constructor(e){super(e),this.documents=e.shared.workspace.LangiumDocuments}collectLocationLinks(e,r){var n,i,o,a,s,u;let l="path";if((0,hj.isGrammarImport)(e.element)&&((n=(0,pj.findAssignment)(e))===null||n===void 0?void 0:n.feature)===l){let c=(0,mj.resolveImport)(this.documents,e.element);if(c?.$document){let f=(i=this.findTargetObject(c))!==null&&i!==void 0?i:c,p=(a=(o=this.nameProvider.getNameNode(f))===null||o===void 0?void 0:o.range)!==null&&a!==void 0?a:Ay.Range.create(0,0,0,0),h=(u=(s=f.$cstNode)===null||s===void 0?void 0:s.range)!==null&&u!==void 0?u:Ay.Range.create(0,0,0,0);return[Ay.LocationLink.create(c.$document.uri.toString(),h,p,e.range)]}return}return super.collectLocationLinks(e,r)}findTargetObject(e){return e.isDeclared?e:(0,dj.streamContents)(e).head()}};vf.LangiumGrammarDefinitionProvider=Ey});var VE=b(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.AbstractCallHierarchyProvider=void 0;var gj=Xe(),zE=$n(),Cy=pt(),xy=class{constructor(e){this.grammarConfig=e.parser.GrammarConfig,this.nameProvider=e.references.NameProvider,this.documents=e.shared.workspace.LangiumDocuments,this.references=e.references.References}prepareCallHierarchy(e,r){let n=e.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findDeclarationNode(i);if(!!o)return this.getCallHierarchyItems(o.element,e)}getCallHierarchyItems(e,r){let n=this.nameProvider.getNameNode(e),i=this.nameProvider.getName(e);if(!(!n||!e.$cstNode||i===void 0))return[Object.assign({kind:gj.SymbolKind.Method,name:i,range:e.$cstNode.range,selectionRange:n.range,uri:r.uri.toString()},this.getCallHierarchyItem(e))]}getCallHierarchyItem(e){}incomingCalls(e){let r=this.documents.getOrCreateDocument(zE.URI.parse(e.item.uri)),n=r.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!i)return;let o=this.references.findReferences(i.element,{includeDeclaration:!1,onlyLocal:!1});return this.getIncomingCalls(i.element,o)}outgoingCalls(e){let r=this.documents.getOrCreateDocument(zE.URI.parse(e.item.uri)),n=r.parseResult.value,i=(0,Cy.findDeclarationNodeAtOffset)(n.$cstNode,r.textDocument.offsetAt(e.item.range.start),this.grammarConfig.nameRegexp);if(!!i)return this.getOutgoingCalls(i.element)}};_f.AbstractCallHierarchyProvider=xy});var XE=b(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.LangiumGrammarCallHierarchyProvider=void 0;var YE=Xe(),yj=VE(),wy=Ie(),vj=pt(),Tf=ot(),Sy=class extends yj.AbstractCallHierarchyProvider{getIncomingCalls(e,r){if(!(0,Tf.isParserRule)(e))return;let n=new Map;if(r.forEach(i=>{let a=this.documents.getOrCreateDocument(i.sourceUri).parseResult.value;if(!a.$cstNode)return;let s=(0,vj.findLeafNodeAtOffset)(a.$cstNode,i.segment.offset);if(!s)return;let u=(0,wy.getContainerOfType)(s.element,Tf.isParserRule);if(!u||!u.$cstNode)return;let l=this.nameProvider.getNameNode(u);if(!l)return;let c=i.sourceUri.toString(),f=c+"@"+l.text;n.has(f)?n.set(f,{parserRule:u.$cstNode,nameNode:l,targetNodes:[...n.get(f).targetNodes,s],docUri:c}):n.set(f,{parserRule:u.$cstNode,nameNode:l,targetNodes:[s],docUri:c})}),n.size!==0)return Array.from(n.values()).map(i=>({from:{kind:YE.SymbolKind.Method,name:i.nameNode.text,range:i.parserRule.range,selectionRange:i.nameNode.range,uri:i.docUri},fromRanges:i.targetNodes.map(o=>o.range)}))}getOutgoingCalls(e){if(!(0,Tf.isParserRule)(e))return;let r=(0,wy.streamAllContents)(e).filter(Tf.isRuleCall).toArray(),n=new Map;if(r.forEach(i=>{var o;let a=i.$cstNode;if(!a)return;let s=(o=i.rule.ref)===null||o===void 0?void 0:o.$cstNode;if(!s)return;let u=this.nameProvider.getNameNode(s.element);if(!u)return;let l=(0,wy.getDocument)(s.element).uri.toString(),c=l+"@"+u.text;n.has(c)?n.set(c,{refCstNode:s,to:u,from:[...n.get(c).from,a.range],docUri:l}):n.set(c,{refCstNode:s,to:u,from:[a.range],docUri:l})}),n.size!==0)return Array.from(n.values()).map(i=>({to:{kind:YE.SymbolKind.Method,name:i.to.text,range:i.refCstNode.range,selectionRange:i.to.range,uri:i.docUri},fromRanges:i.from}))}};Rf.LangiumGrammarCallHierarchyProvider=Sy});var bf=b(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.createLangiumGrammarServices=Wo.LangiumGrammarModule=void 0;var ZE=Af(),JE=eu(),QE=Kb(),eC=AA(),tC=Sg(),_j=VA(),Tj=YA(),Rj=ZA(),bj=JA(),Aj=eE(),Ej=sE(),Cj=KE(),xj=XE();Wo.LangiumGrammarModule={validation:{ValidationRegistry:t=>new tC.LangiumGrammarValidationRegistry(t),LangiumGrammarValidator:t=>new tC.LangiumGrammarValidator(t)},lsp:{FoldingRangeProvider:t=>new Tj.LangiumGrammarFoldingRangeProvider(t),CodeActionProvider:()=>new _j.LangiumGrammarCodeActionProvider,SemanticTokenProvider:t=>new bj.LangiumGrammarSemanticTokenProvider(t),Formatter:()=>new Rj.LangiumGrammarFormatter,DefinitionProvider:t=>new Cj.LangiumGrammarDefinitionProvider(t),CallHierarchyProvider:t=>new xj.LangiumGrammarCallHierarchyProvider(t)},references:{ScopeComputation:t=>new eC.LangiumGrammarScopeComputation(t),ScopeProvider:t=>new eC.LangiumGrammarScopeProvider(t),References:t=>new Ej.LangiumGrammarReferences(t),NameProvider:()=>new Aj.LangiumGrammarNameProvider}};function wj(t,e){let r=(0,JE.inject)((0,ZE.createDefaultSharedModule)(t),QE.LangiumGrammarGeneratedSharedModule,e),n=(0,JE.inject)((0,ZE.createDefaultModule)({shared:r}),QE.LangiumGrammarGeneratedModule,Wo.LangiumGrammarModule);return r.ServiceRegistry.register(n),{shared:r,grammar:n}}Wo.createLangiumGrammarServices=wj});var nC=b(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.collectAst=void 0;var rC=Bt(),Sj=_g(),kj=hg(),Pj=so();function Dj(t,e){let r=(0,Pj.collectAllAstResources)(e,t),n=(0,Sj.collectInferredTypes)(Array.from(r.parserRules),Array.from(r.datatypeRules)),i=(0,kj.collectDeclaredTypes)(Array.from(r.interfaces),Array.from(r.types),n),o=n.interfaces.concat(i.interfaces),a=n.unions.concat(i.unions);return Nj(o),a.sort((s,u)=>s.name.localeCompare(u.name)),{interfaces:(0,rC.stream)(o).distinct(s=>s.name).toArray(),unions:(0,rC.stream)(a).distinct(s=>s.name).toArray()}}Ef.collectAst=Dj;function Nj(t){let e=t.sort((i,o)=>i.name.localeCompare(o.name)).map(i=>({value:i,nodes:[]}));for(let i of e)i.nodes=e.filter(o=>i.value.superTypes.has(o.value.name));let r=[],n=e.filter(i=>i.nodes.length===0);for(;n.length>0;){let i=n.shift();r.includes(i)||(r.push(i),e.filter(o=>o.nodes.includes(i)).forEach(o=>n.push(o)))}return r.map(i=>i.value)}});var Py=b(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.interpretAstReflection=void 0;var Oj=Ie(),Ij=tn(),$j=Ec(),Mj=ot(),Lj=bf(),Fj=nC(),qj=so(),ky;function jj(t,e){let r;(0,Mj.isGrammar)(t)?(!ky&&!e&&(ky=(0,Lj.createLangiumGrammarServices)($j.EmptyFileSystem).shared.workspace.LangiumDocuments),r=(0,Fj.collectAst)(e??ky,[t])):r=t;let n=r.interfaces.map(s=>s.name).concat(r.unions.map(s=>s.name)),i=Gj(r),o=Uj(r),a=Bj(r);return{getAllTypes(){return n},getReferenceType(s){let u=`${s.container.$type}:${s.property}`,l=i.get(u);if(l)return l;throw new Error("Could not find reference type for "+u)},getTypeMetaData(s){var u;return(u=o.get(s))!==null&&u!==void 0?u:{name:s,mandatory:[]}},isInstance(s,u){return(0,Oj.isAstNode)(s)&&this.isSubtype(s.$type,u)},isSubtype(s,u){if(s===u)return!0;let l=a.get(s);for(let c of l)if(this.isSubtype(c,u))return!0;return!1}}}Cf.interpretAstReflection=jj;function Gj(t){let e=new Map;for(let r of t.interfaces)for(let n of r.properties)for(let i of n.typeAlternatives)i.reference&&e.set(`${r.name}:${n.name}`,i.types[0]);return e}function Uj(t){let e=new Map,r=(0,qj.collectAllProperties)(t.interfaces);for(let n of t.interfaces){let i=r.get(n.name),o=i.filter(s=>s.typeAlternatives.some(u=>u.array)),a=i.filter(s=>s.typeAlternatives.every(u=>!u.array&&u.types.includes("boolean")));(o.length>0||a.length>0)&&e.set(n.name,{name:n.name,mandatory:Hj(o,a)})}return e}function Hj(t,e){let r=[],n=t.concat(e).sort((i,o)=>i.name.localeCompare(o.name));for(let i of n){let o=t.includes(i)?"array":"boolean";r.push({name:i.name,type:o})}return r}function Bj(t){let e=new Ij.MultiMap;for(let r of t.interfaces)e.addAll(r.name,r.superTypes);for(let r of t.unions)e.addAll(r.name,r.superTypes);return e}});var Wt=b(Se=>{"use strict";var Wj=Se&&Se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Kj=Se&&Se.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zj=Se&&Se.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Wj(e,t,r);return Kj(e,t),e};Object.defineProperty(Se,"__esModule",{value:!0});Se.createServicesForGrammar=Se.loadGrammarFromJson=Se.findNameAssignment=Se.findAssignment=Se.findNodesForKeywordInternal=Se.findNodeForKeyword=Se.findNodesForKeyword=Se.findNodeForProperty=Se.findNodesForProperty=Se.isCommentTerminal=Se.getCrossReferenceTerminal=Se.getAllReachableRules=Se.getEntryRule=void 0;var iC=Af(),oC=eu(),Vj=Py(),kr=zj(ot()),Ny=ir(),aC=bf(),Yj=Pa(),gu=Ie(),Xj=pt(),Dy=Ec();function sC(t){return t.rules.find(e=>kr.isParserRule(e)&&e.entry)}Se.getEntryRule=sC;function Zj(t,e){let r=new Set,n=sC(t);if(!n)return new Set(t.rules);uC(n,r,e);let i=new Set;for(let o of t.rules)(r.has(o.name)||kr.isTerminalRule(o)&&o.hidden)&&i.add(o);return i}Se.getAllReachableRules=Zj;function uC(t,e,r){e.add(t.name),(0,gu.streamAllContents)(t).forEach(n=>{if(kr.isRuleCall(n)||r&&kr.isTerminalRuleCall(n)){let i=n.rule.ref;i&&!e.has(i.name)&&uC(i,e,r)}})}function Jj(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=lC(t.type.ref);return e?.terminal}}Se.getCrossReferenceTerminal=Jj;function Qj(t){return t.hidden&&!" ".match((0,Ny.terminalRegex)(t))}Se.isCommentTerminal=Qj;function eG(t,e){return!t||!e?[]:Oy(t,e,t.element,!0)}Se.findNodesForProperty=eG;function tG(t,e,r){if(!t||!e)return;let n=Oy(t,e,t.element,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}Se.findNodeForProperty=tG;function Oy(t,e,r,n){if(!n){let i=(0,gu.getContainerOfType)(t.feature,kr.isAssignment);if(i&&i.feature===e)return[t]}return(0,Yj.isCompositeCstNode)(t)&&t.element===r?t.children.flatMap(i=>Oy(i,e,r,!1)):[]}function rG(t,e){return t?Iy(t,e,t?.element):[]}Se.findNodesForKeyword=rG;function nG(t,e,r){if(!t)return;let n=Iy(t,e,t?.element);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}Se.findNodeForKeyword=nG;function Iy(t,e,r){if(t.element!==r)return[];if(kr.isKeyword(t.feature)&&t.feature.value===e)return[t];let n=(0,Xj.streamCst)(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let a=i.value;a.element===r?kr.isKeyword(a.feature)&&a.feature.value===e&&o.push(a):n.prune()}while(!i.done);return o}Se.findNodesForKeywordInternal=Iy;function iG(t){let e=t;do{let r=(0,gu.getContainerOfType)(e.feature,kr.isAssignment);if(r)return r;e=e.parent}while(e)}Se.findAssignment=iG;function lC(t){return kr.isInferredType(t)&&(t=t.$container),cC(t,new Map)}Se.findNameAssignment=lC;function cC(t,e){var r;function n(i,o){let a;return(0,gu.getContainerOfType)(i,kr.isAssignment)||(a=cC(o,e)),e.set(t,a),a}if(e.has(t))return e.get(t);e.set(t,void 0);for(let i of(0,gu.streamAllContents)(t)){if(kr.isAssignment(i)&&i.feature.toLowerCase()==="name")return e.set(t,i),i;if(kr.isRuleCall(i)&&kr.isParserRule(i.rule.ref))return n(i,i.rule.ref);if(kr.isAtomType(i)&&((r=i?.refType)===null||r===void 0?void 0:r.ref))return n(i,i.refType.ref)}}function oG(t){let e=(0,aC.createLangiumGrammarServices)(Dy.EmptyFileSystem).grammar,r=e.serializer.JsonSerializer.deserialize(t);if(!kr.isGrammar(r))throw new Error("Could not load grammar from specified json input.");return(0,Ny.prepareGrammar)(e,r)}Se.loadGrammarFromJson=oG;function aG(t){var e,r,n,i,o,a;let s=(e=t.grammarServices)!==null&&e!==void 0?e:(0,aC.createLangiumGrammarServices)(Dy.EmptyFileSystem).grammar,u=typeof t.grammar=="string"?s.parser.LangiumParser.parse(t.grammar).value:t.grammar;(0,Ny.prepareGrammar)(s,u);let l=(r=t.parserConfig)!==null&&r!==void 0?r:{skipValidations:!1},c=(n=t.languageMetaData)!==null&&n!==void 0?n:{caseInsensitive:!1,fileExtensions:[`.${(o=(i=u.name)===null||i===void 0?void 0:i.toLowerCase())!==null&&o!==void 0?o:"unknown"}`],languageId:(a=u.name)!==null&&a!==void 0?a:"UNKNOWN"},f={AstReflection:()=>(0,Vj.interpretAstReflection)(u)},p={Grammar:()=>u,LanguageMetaData:()=>c,parser:{ParserConfig:()=>l}},h=(0,oC.inject)((0,iC.createDefaultSharedModule)(Dy.EmptyFileSystem),f,t.sharedModule),d=(0,oC.inject)((0,iC.createDefaultModule)({shared:h}),p,t.module);return h.ServiceRegistry.register(d),d}Se.createServicesForGrammar=aG});var fC=b(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.createGrammarConfig=void 0;var sG=pt(),uG=Wt(),lG=Fa(),cG=ot(),fG=ir();function dG(t){let e=[],r=t.Grammar;for(let n of r.rules)(0,cG.isTerminalRule)(n)&&(0,uG.isCommentTerminal)(n)&&(0,lG.isMultilineComment)((0,fG.terminalRegex)(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:sG.DefaultNameRegexp}}xf.createGrammarConfig=dG});var $y=b(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.VERSION=void 0;wf.VERSION="9.1.0"});var $e=b((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0});exports.toFastProperties=exports.timer=exports.peek=exports.isES2015MapSupported=exports.PRINT_WARNING=exports.PRINT_ERROR=exports.packArray=exports.IDENTITY=exports.NOOP=exports.merge=exports.groupBy=exports.defaults=exports.assignNoOverwrite=exports.assign=exports.zipObject=exports.sortBy=exports.indexOf=exports.some=exports.difference=exports.every=exports.isObject=exports.isRegExp=exports.isArray=exports.partial=exports.uniq=exports.compact=exports.reduce=exports.findAll=exports.find=exports.cloneObj=exports.cloneArr=exports.contains=exports.has=exports.pick=exports.reject=exports.filter=exports.dropRight=exports.drop=exports.isFunction=exports.isUndefined=exports.isString=exports.forEach=exports.last=exports.first=exports.flatten=exports.map=exports.mapValues=exports.values=exports.keys=exports.isEmpty=void 0;exports.upperFirst=void 0;function isEmpty(t){return t&&t.length===0}exports.isEmpty=isEmpty;function keys(t){return t==null?[]:Object.keys(t)}exports.keys=keys;function values(t){for(var e=[],r=Object.keys(t),n=0;n<r.length;n++)e.push(t[r[n]]);return e}exports.values=values;function mapValues(t,e){for(var r=[],n=keys(t),i=0;i<n.length;i++){var o=n[i];r.push(e.call(null,t[o],o))}return r}exports.mapValues=mapValues;function map(t,e){for(var r=[],n=0;n<t.length;n++)r.push(e.call(null,t[n],n));return r}exports.map=map;function flatten(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];Array.isArray(n)?e=e.concat(flatten(n)):e.push(n)}return e}exports.flatten=flatten;function first(t){return isEmpty(t)?void 0:t[0]}exports.first=first;function last(t){var e=t&&t.length;return e?t[e-1]:void 0}exports.last=last;function forEach(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)e.call(null,t[r],r);else if(isObject(t))for(var n=keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i];e.call(null,o,i)}else throw Error("non exhaustive match")}exports.forEach=forEach;function isString(t){return typeof t=="string"}exports.isString=isString;function isUndefined(t){return t===void 0}exports.isUndefined=isUndefined;function isFunction(t){return t instanceof Function}exports.isFunction=isFunction;function drop(t,e){return e===void 0&&(e=1),t.slice(e,t.length)}exports.drop=drop;function dropRight(t,e){return e===void 0&&(e=1),t.slice(0,t.length-e)}exports.dropRight=dropRight;function filter(t,e){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}exports.filter=filter;function reject(t,e){return filter(t,function(r){return!e(r)})}exports.reject=reject;function pick(t,e){for(var r=Object.keys(t),n={},i=0;i<r.length;i++){var o=r[i],a=t[o];e(a)&&(n[o]=a)}return n}exports.pick=pick;function has(t,e){return isObject(t)?t.hasOwnProperty(e):!1}exports.has=has;function contains(t,e){return find(t,function(r){return r===e})!==void 0}exports.contains=contains;function cloneArr(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r]);return e}exports.cloneArr=cloneArr;function cloneObj(t){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}exports.cloneObj=cloneObj;function find(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(e.call(null,n))return n}}exports.find=find;function findAll(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}exports.findAll=findAll;function reduce(t,e,r){for(var n=Array.isArray(t),i=n?t:values(t),o=n?[]:keys(t),a=r,s=0;s<i.length;s++)a=e.call(null,a,i[s],n?s:o[s]);return a}exports.reduce=reduce;function compact(t){return reject(t,function(e){return e==null})}exports.compact=compact;function uniq(t,e){e===void 0&&(e=function(n){return n});var r=[];return reduce(t,function(n,i){var o=e(i);return contains(r,o)?n:(r.push(o),n.concat(i))},[])}exports.uniq=uniq;function partial(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=[null],i=n.concat(e);return Function.bind.apply(t,i)}exports.partial=partial;function isArray(t){return Array.isArray(t)}exports.isArray=isArray;function isRegExp(t){return t instanceof RegExp}exports.isRegExp=isRegExp;function isObject(t){return t instanceof Object}exports.isObject=isObject;function every(t,e){for(var r=0;r<t.length;r++)if(!e(t[r],r))return!1;return!0}exports.every=every;function difference(t,e){return reject(t,function(r){return contains(e,r)})}exports.difference=difference;function some(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return!0;return!1}exports.some=some;function indexOf(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1}exports.indexOf=indexOf;function sortBy(t,e){var r=cloneArr(t);return r.sort(function(n,i){return e(n)-e(i)}),r}exports.sortBy=sortBy;function zipObject(t,e){if(t.length!==e.length)throw Error("can't zipObject with different number of keys and values!");for(var r={},n=0;n<t.length;n++)r[t[n]]=e[n];return r}exports.zipObject=zipObject;function assign(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=keys(i),a=0;a<o.length;a++){var s=o[a];t[s]=i[s]}return t}exports.assign=assign;function assignNoOverwrite(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=keys(i),a=0;a<o.length;a++){var s=o[a];has(t,s)||(t[s]=i[s])}return t}exports.assignNoOverwrite=assignNoOverwrite;function defaults(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return assignNoOverwrite.apply(void 0,__spreadArray([{}],t,!1))}exports.defaults=defaults;function groupBy(t,e){var r={};return forEach(t,function(n){var i=e(n),o=r[i];o?o.push(n):r[i]=[n]}),r}exports.groupBy=groupBy;function merge(t,e){for(var r=cloneObj(t),n=keys(e),i=0;i<n.length;i++){var o=n[i],a=e[o];r[o]=a}return r}exports.merge=merge;function NOOP(){}exports.NOOP=NOOP;function IDENTITY(t){return t}exports.IDENTITY=IDENTITY;function packArray(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(n!==void 0?n:void 0)}return e}exports.packArray=packArray;function PRINT_ERROR(t){console&&console.error&&console.error("Error: "+t)}exports.PRINT_ERROR=PRINT_ERROR;function PRINT_WARNING(t){console&&console.warn&&console.warn("Warning: "+t)}exports.PRINT_WARNING=PRINT_WARNING;function isES2015MapSupported(){return typeof Map=="function"}exports.isES2015MapSupported=isES2015MapSupported;function peek(t){return t[t.length-1]}exports.peek=peek;function timer(t){var e=new Date().getTime(),r=t(),n=new Date().getTime(),i=n-e;return{time:i,value:r}}exports.timer=timer;function toFastProperties(toBecomeFast){function FakeConstructor(){}FakeConstructor.prototype=toBecomeFast;var fakeInstance=new FakeConstructor;function fakeAccess(){return typeof fakeInstance.bar}return fakeAccess(),fakeAccess(),toBecomeFast;eval(toBecomeFast)}exports.toFastProperties=toFastProperties;function upperFirst(t){if(!t)return t;var e=getCharacterFromCodePointAt(t,0);return e.toUpperCase()+t.substring(e.length)}exports.upperFirst=upperFirst;var surrogatePairPattern=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function getCharacterFromCodePointAt(t,e){var r=t.substring(e,e+1);return surrogatePairPattern.test(r)?r:t[e]}});var kf=b(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.clearRegExpParserCache=Va.getRegExpAst=void 0;var pG=iu(),Sf={},hG=new pG.RegExpParser;function mG(t){var e=t.toString();if(Sf.hasOwnProperty(e))return Sf[e];var r=hG.pattern(e);return Sf[e]=r,r}Va.getRegExpAst=mG;function gG(){Sf={}}Va.clearRegExpParserCache=gG});var gC=b(Mr=>{"use strict";var yG=Mr&&Mr.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.canMatchCharCode=Mr.firstCharOptimizedIndices=Mr.getOptimizedStartCodesIndices=Mr.failedOptimizationPrefixMsg=void 0;var pC=iu(),sn=$e(),hC=kf(),Li=Ly(),mC="Complement Sets are not supported for first char optimization";Mr.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
3607
+ `;function vG(t,e){e===void 0&&(e=!1);try{var r=(0,hC.getRegExpAst)(t),n=Df(r.value,{},r.flags.ignoreCase);return n}catch(o){if(o.message===mC)e&&(0,sn.PRINT_WARNING)(""+Mr.failedOptimizationPrefixMsg+(" Unable to optimize: < "+t.toString()+` >
3608
3608
  `)+` Complement Sets cannot be automatically optimized.
3609
3609
  This will disable the lexer's first char optimizations.
3610
3610
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";e&&(i=`
@@ -3612,42 +3612,42 @@ ${JSON.stringify(w,null,4)}`);let F=w;if(Ht.string(F.id)||Ht.number(F.id)){let W
3612
3612
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,sn.PRINT_ERROR)(Mr.failedOptimizationPrefixMsg+`
3613
3613
  `+(" Failed parsing: < "+t.toString()+` >
3614
3614
  `)+(" Using the regexp-to-ast library version: "+pC.VERSION+`
3615
- `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}Mr.getOptimizedStartCodesIndices=_G;function Df(t,e,r){switch(t.type){case"Disjunction":for(var n=0;n<t.value.length;n++)Df(t.value[n],e,r);break;case"Alternative":for(var i=t.value,n=0;n<i.length;n++){var o=i[n];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var a=o;switch(a.type){case"Character":Pf(a.value,e,r);break;case"Set":if(a.complement===!0)throw Error(mC);(0,sn.forEach)(a.value,function(l){if(typeof l=="number")Pf(l,e,r);else{var c=l;if(r===!0)for(var f=c.from;f<=c.to;f++)Pf(f,e,r);else{for(var f=c.from;f<=c.to&&f<Li.minOptimizationVal;f++)Pf(f,e,r);if(c.to>=Li.minOptimizationVal)for(var p=c.from>=Li.minOptimizationVal?c.from:Li.minOptimizationVal,h=c.to,d=(0,Li.charCodeToOptimizedIndex)(p),g=(0,Li.charCodeToOptimizedIndex)(h),C=d;C<=g;C++)e[C]=C}}});break;case"Group":Df(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}var s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&My(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return(0,sn.values)(e)}Mr.firstCharOptimizedIndices=Df;function Pf(t,e,r){var n=(0,Li.charCodeToOptimizedIndex)(t);e[n]=n,r===!0&&TG(t,e)}function TG(t,e){var r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){var i=(0,Li.charCodeToOptimizedIndex)(n.charCodeAt(0));e[i]=i}else{var o=r.toLowerCase();if(o!==r){var i=(0,Li.charCodeToOptimizedIndex)(o.charCodeAt(0));e[i]=i}}}function dC(t,e){return(0,sn.find)(t.value,function(r){if(typeof r=="number")return(0,sn.contains)(e,r);var n=r;return(0,sn.find)(e,function(i){return n.from<=i&&i<=n.to})!==void 0})}function My(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?(0,sn.isArray)(t.value)?(0,sn.every)(t.value,My):My(t.value):!1}var RG=function(t){vG(e,t);function e(r){var n=t.call(this)||this;return n.targetCharCodes=r,n.found=!1,n}return e.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}t.prototype.visitChildren.call(this,r)}},e.prototype.visitCharacter=function(r){(0,sn.contains)(this.targetCharCodes,r.value)&&(this.found=!0)},e.prototype.visitSet=function(r){r.complement?dC(r,this.targetCharCodes)===void 0&&(this.found=!0):dC(r,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(pC.BaseRegExpVisitor);function bG(t,e){if(e instanceof RegExp){var r=(0,hC.getRegExpAst)(e),n=new RG(t);return n.visit(r),n.found}else return(0,sn.find)(e,function(i){return(0,sn.contains)(t,i.charCodeAt(0))})!==void 0}Mr.canMatchCharCode=bG});var Ly=b(Z=>{"use strict";var yC=Z&&Z.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Z,"__esModule",{value:!0});Z.charCodeToOptimizedIndex=Z.minOptimizationVal=Z.buildLineBreakIssueMessage=Z.LineTerminatorOptimizedTester=Z.isShortPattern=Z.isCustomPattern=Z.cloneEmptyGroups=Z.performWarningRuntimeChecks=Z.performRuntimeChecks=Z.addStickyFlag=Z.addStartOfInput=Z.findUnreachablePatterns=Z.findModesThatDoNotExist=Z.findInvalidGroupType=Z.findDuplicatePatterns=Z.findUnsupportedFlags=Z.findStartOfInputAnchor=Z.findEmptyMatchRegExps=Z.findEndOfInputAnchor=Z.findInvalidPatterns=Z.findMissingPatterns=Z.validatePatterns=Z.analyzeTokenTypes=Z.enableSticky=Z.disableSticky=Z.SUPPORT_STICKY=Z.MODES=Z.DEFAULT_MODE=void 0;var vC=iu(),Ze=yu(),q=$e(),Ya=gC(),_C=kf(),fi="PATTERN";Z.DEFAULT_MODE="defaultMode";Z.MODES="modes";Z.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function AG(){Z.SUPPORT_STICKY=!1}Z.disableSticky=AG;function EG(){Z.SUPPORT_STICKY=!0}Z.enableSticky=EG;function CG(t,e){e=(0,q.defaults)(e,{useSticky:Z.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
3616
- `],tracer:function(T,v){return v()}});var r=e.tracer;r("initCharCodeToOptimizedIndexMap",function(){$G()});var n;r("Reject Lexer.NA",function(){n=(0,q.reject)(t,function(T){return T[fi]===Ze.Lexer.NA})});var i=!1,o;r("Transform Patterns",function(){i=!1,o=(0,q.map)(n,function(T){var v=T[fi];if((0,q.isRegExp)(v)){var k=v.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!v.ignoreCase?k:k.length===2&&k[0]==="\\"&&!(0,q.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?jy(v):qy(v)}else{if((0,q.isFunction)(v))return i=!0,{exec:v};if((0,q.has)(v,"exec"))return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;var j=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),O=new RegExp(j);return e.useSticky?jy(O):qy(O)}else throw Error("non exhaustive match")}})});var a,s,u,l,c;r("misc mapping",function(){a=(0,q.map)(n,function(T){return T.tokenTypeIdx}),s=(0,q.map)(n,function(T){var v=T.GROUP;if(v!==Ze.Lexer.SKIPPED){if((0,q.isString)(v))return v;if((0,q.isUndefined)(v))return!1;throw Error("non exhaustive match")}}),u=(0,q.map)(n,function(T){var v=T.LONGER_ALT;if(v){var k=(0,q.isArray)(v)?(0,q.map)(v,function(j){return(0,q.indexOf)(n,j)}):[(0,q.indexOf)(n,v)];return k}}),l=(0,q.map)(n,function(T){return T.PUSH_MODE}),c=(0,q.map)(n,function(T){return(0,q.has)(T,"POP_MODE")})});var f;r("Line Terminator Handling",function(){var T=OC(e.lineTerminatorCharacters);f=(0,q.map)(n,function(v){return!1}),e.positionTracking!=="onlyOffset"&&(f=(0,q.map)(n,function(v){if((0,q.has)(v,"LINE_BREAKS"))return v.LINE_BREAKS;if(DC(v,T)===!1)return(0,Ya.canMatchCharCode)(T,v.PATTERN)}))});var p,h,d,g;r("Misc Mapping #2",function(){p=(0,q.map)(n,Uy),h=(0,q.map)(o,PC),d=(0,q.reduce)(n,function(T,v){var k=v.GROUP;return(0,q.isString)(k)&&k!==Ze.Lexer.SKIPPED&&(T[k]=[]),T},{}),g=(0,q.map)(o,function(T,v){return{pattern:o[v],longerAlt:u[v],canLineTerminator:f[v],isCustom:p[v],short:h[v],group:s[v],push:l[v],pop:c[v],tokenTypeIdx:a[v],tokenType:n[v]}})});var C=!0,x=[];return e.safeMode||r("First Char Optimization",function(){x=(0,q.reduce)(n,function(T,v,k){if(typeof v.PATTERN=="string"){var j=v.PATTERN.charCodeAt(0),O=Gy(j);Fy(T,O,g[k])}else if((0,q.isArray)(v.START_CHARS_HINT)){var $;(0,q.forEach)(v.START_CHARS_HINT,function(J){var le=typeof J=="string"?J.charCodeAt(0):J,pe=Gy(le);$!==pe&&($=pe,Fy(T,pe,g[k]))})}else if((0,q.isRegExp)(v.PATTERN))if(v.PATTERN.unicode)C=!1,e.ensureOptimizations&&(0,q.PRINT_ERROR)(""+Ya.failedOptimizationPrefixMsg+(" Unable to analyze < "+v.PATTERN.toString()+` > pattern.
3615
+ `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}Mr.getOptimizedStartCodesIndices=vG;function Df(t,e,r){switch(t.type){case"Disjunction":for(var n=0;n<t.value.length;n++)Df(t.value[n],e,r);break;case"Alternative":for(var i=t.value,n=0;n<i.length;n++){var o=i[n];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var a=o;switch(a.type){case"Character":Pf(a.value,e,r);break;case"Set":if(a.complement===!0)throw Error(mC);(0,sn.forEach)(a.value,function(l){if(typeof l=="number")Pf(l,e,r);else{var c=l;if(r===!0)for(var f=c.from;f<=c.to;f++)Pf(f,e,r);else{for(var f=c.from;f<=c.to&&f<Li.minOptimizationVal;f++)Pf(f,e,r);if(c.to>=Li.minOptimizationVal)for(var p=c.from>=Li.minOptimizationVal?c.from:Li.minOptimizationVal,h=c.to,d=(0,Li.charCodeToOptimizedIndex)(p),g=(0,Li.charCodeToOptimizedIndex)(h),C=d;C<=g;C++)e[C]=C}}});break;case"Group":Df(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}var s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&My(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return(0,sn.values)(e)}Mr.firstCharOptimizedIndices=Df;function Pf(t,e,r){var n=(0,Li.charCodeToOptimizedIndex)(t);e[n]=n,r===!0&&_G(t,e)}function _G(t,e){var r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){var i=(0,Li.charCodeToOptimizedIndex)(n.charCodeAt(0));e[i]=i}else{var o=r.toLowerCase();if(o!==r){var i=(0,Li.charCodeToOptimizedIndex)(o.charCodeAt(0));e[i]=i}}}function dC(t,e){return(0,sn.find)(t.value,function(r){if(typeof r=="number")return(0,sn.contains)(e,r);var n=r;return(0,sn.find)(e,function(i){return n.from<=i&&i<=n.to})!==void 0})}function My(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?(0,sn.isArray)(t.value)?(0,sn.every)(t.value,My):My(t.value):!1}var TG=function(t){yG(e,t);function e(r){var n=t.call(this)||this;return n.targetCharCodes=r,n.found=!1,n}return e.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}t.prototype.visitChildren.call(this,r)}},e.prototype.visitCharacter=function(r){(0,sn.contains)(this.targetCharCodes,r.value)&&(this.found=!0)},e.prototype.visitSet=function(r){r.complement?dC(r,this.targetCharCodes)===void 0&&(this.found=!0):dC(r,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(pC.BaseRegExpVisitor);function RG(t,e){if(e instanceof RegExp){var r=(0,hC.getRegExpAst)(e),n=new TG(t);return n.visit(r),n.found}else return(0,sn.find)(e,function(i){return(0,sn.contains)(t,i.charCodeAt(0))})!==void 0}Mr.canMatchCharCode=RG});var Ly=b(Z=>{"use strict";var yC=Z&&Z.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Z,"__esModule",{value:!0});Z.charCodeToOptimizedIndex=Z.minOptimizationVal=Z.buildLineBreakIssueMessage=Z.LineTerminatorOptimizedTester=Z.isShortPattern=Z.isCustomPattern=Z.cloneEmptyGroups=Z.performWarningRuntimeChecks=Z.performRuntimeChecks=Z.addStickyFlag=Z.addStartOfInput=Z.findUnreachablePatterns=Z.findModesThatDoNotExist=Z.findInvalidGroupType=Z.findDuplicatePatterns=Z.findUnsupportedFlags=Z.findStartOfInputAnchor=Z.findEmptyMatchRegExps=Z.findEndOfInputAnchor=Z.findInvalidPatterns=Z.findMissingPatterns=Z.validatePatterns=Z.analyzeTokenTypes=Z.enableSticky=Z.disableSticky=Z.SUPPORT_STICKY=Z.MODES=Z.DEFAULT_MODE=void 0;var vC=iu(),Ze=yu(),q=$e(),Ya=gC(),_C=kf(),fi="PATTERN";Z.DEFAULT_MODE="defaultMode";Z.MODES="modes";Z.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function bG(){Z.SUPPORT_STICKY=!1}Z.disableSticky=bG;function AG(){Z.SUPPORT_STICKY=!0}Z.enableSticky=AG;function EG(t,e){e=(0,q.defaults)(e,{useSticky:Z.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
3616
+ `],tracer:function(T,v){return v()}});var r=e.tracer;r("initCharCodeToOptimizedIndexMap",function(){IG()});var n;r("Reject Lexer.NA",function(){n=(0,q.reject)(t,function(T){return T[fi]===Ze.Lexer.NA})});var i=!1,o;r("Transform Patterns",function(){i=!1,o=(0,q.map)(n,function(T){var v=T[fi];if((0,q.isRegExp)(v)){var k=v.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!v.ignoreCase?k:k.length===2&&k[0]==="\\"&&!(0,q.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?jy(v):qy(v)}else{if((0,q.isFunction)(v))return i=!0,{exec:v};if((0,q.has)(v,"exec"))return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;var j=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),O=new RegExp(j);return e.useSticky?jy(O):qy(O)}else throw Error("non exhaustive match")}})});var a,s,u,l,c;r("misc mapping",function(){a=(0,q.map)(n,function(T){return T.tokenTypeIdx}),s=(0,q.map)(n,function(T){var v=T.GROUP;if(v!==Ze.Lexer.SKIPPED){if((0,q.isString)(v))return v;if((0,q.isUndefined)(v))return!1;throw Error("non exhaustive match")}}),u=(0,q.map)(n,function(T){var v=T.LONGER_ALT;if(v){var k=(0,q.isArray)(v)?(0,q.map)(v,function(j){return(0,q.indexOf)(n,j)}):[(0,q.indexOf)(n,v)];return k}}),l=(0,q.map)(n,function(T){return T.PUSH_MODE}),c=(0,q.map)(n,function(T){return(0,q.has)(T,"POP_MODE")})});var f;r("Line Terminator Handling",function(){var T=OC(e.lineTerminatorCharacters);f=(0,q.map)(n,function(v){return!1}),e.positionTracking!=="onlyOffset"&&(f=(0,q.map)(n,function(v){if((0,q.has)(v,"LINE_BREAKS"))return v.LINE_BREAKS;if(DC(v,T)===!1)return(0,Ya.canMatchCharCode)(T,v.PATTERN)}))});var p,h,d,g;r("Misc Mapping #2",function(){p=(0,q.map)(n,Uy),h=(0,q.map)(o,PC),d=(0,q.reduce)(n,function(T,v){var k=v.GROUP;return(0,q.isString)(k)&&k!==Ze.Lexer.SKIPPED&&(T[k]=[]),T},{}),g=(0,q.map)(o,function(T,v){return{pattern:o[v],longerAlt:u[v],canLineTerminator:f[v],isCustom:p[v],short:h[v],group:s[v],push:l[v],pop:c[v],tokenTypeIdx:a[v],tokenType:n[v]}})});var C=!0,x=[];return e.safeMode||r("First Char Optimization",function(){x=(0,q.reduce)(n,function(T,v,k){if(typeof v.PATTERN=="string"){var j=v.PATTERN.charCodeAt(0),O=Gy(j);Fy(T,O,g[k])}else if((0,q.isArray)(v.START_CHARS_HINT)){var $;(0,q.forEach)(v.START_CHARS_HINT,function(J){var le=typeof J=="string"?J.charCodeAt(0):J,pe=Gy(le);$!==pe&&($=pe,Fy(T,pe,g[k]))})}else if((0,q.isRegExp)(v.PATTERN))if(v.PATTERN.unicode)C=!1,e.ensureOptimizations&&(0,q.PRINT_ERROR)(""+Ya.failedOptimizationPrefixMsg+(" Unable to analyze < "+v.PATTERN.toString()+` > pattern.
3617
3617
  `)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
3618
3618
  This will disable the lexer's first char optimizations.
3619
3619
  For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var X=(0,Ya.getOptimizedStartCodesIndices)(v.PATTERN,e.ensureOptimizations);(0,q.isEmpty)(X)&&(C=!1),(0,q.forEach)(X,function(J){Fy(T,J,g[k])})}else e.ensureOptimizations&&(0,q.PRINT_ERROR)(""+Ya.failedOptimizationPrefixMsg+(" TokenType: <"+v.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
3620
3620
  `)+` This will disable the lexer's first char optimizations.
3621
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),C=!1;return T},[])}),r("ArrayPacking",function(){x=(0,q.packArray)(x)}),{emptyGroups:d,patternIdxToConfig:g,charCodeToPatternIdxToConfig:x,hasCustom:i,canBeOptimized:C}}Z.analyzeTokenTypes=CG;function xG(t,e){var r=[],n=TC(t);r=r.concat(n.errors);var i=RC(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(wG(o)),r=r.concat(wC(o)),r=r.concat(SC(o,e)),r=r.concat(kC(o)),r}Z.validatePatterns=xG;function wG(t){var e=[],r=(0,q.filter)(t,function(n){return(0,q.isRegExp)(n[fi])});return e=e.concat(bC(r)),e=e.concat(EC(r)),e=e.concat(CC(r)),e=e.concat(xC(r)),e=e.concat(AC(r)),e}function TC(t){var e=(0,q.filter)(t,function(i){return!(0,q.has)(i,fi)}),r=(0,q.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ze.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[i]}}),n=(0,q.difference)(t,e);return{errors:r,valid:n}}Z.findMissingPatterns=TC;function RC(t){var e=(0,q.filter)(t,function(i){var o=i[fi];return!(0,q.isRegExp)(o)&&!(0,q.isFunction)(o)&&!(0,q.has)(o,"exec")&&!(0,q.isString)(o)}),r=(0,q.map)(e,function(i){return{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:Ze.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[i]}}),n=(0,q.difference)(t,e);return{errors:r,valid:n}}Z.findInvalidPatterns=RC;var SG=/[^\\][\$]/;function bC(t){var e=function(i){yC(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return o.prototype.visitEndAnchor=function(a){this.found=!0},o}(vC.BaseRegExpVisitor),r=(0,q.filter)(t,function(i){var o=i[fi];try{var a=(0,_C.getRegExpAst)(o),s=new e;return s.visit(a),s.found}catch{return SG.test(o.source)}}),n=(0,q.map)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
3621
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),C=!1;return T},[])}),r("ArrayPacking",function(){x=(0,q.packArray)(x)}),{emptyGroups:d,patternIdxToConfig:g,charCodeToPatternIdxToConfig:x,hasCustom:i,canBeOptimized:C}}Z.analyzeTokenTypes=EG;function CG(t,e){var r=[],n=TC(t);r=r.concat(n.errors);var i=RC(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(xG(o)),r=r.concat(wC(o)),r=r.concat(SC(o,e)),r=r.concat(kC(o)),r}Z.validatePatterns=CG;function xG(t){var e=[],r=(0,q.filter)(t,function(n){return(0,q.isRegExp)(n[fi])});return e=e.concat(bC(r)),e=e.concat(EC(r)),e=e.concat(CC(r)),e=e.concat(xC(r)),e=e.concat(AC(r)),e}function TC(t){var e=(0,q.filter)(t,function(i){return!(0,q.has)(i,fi)}),r=(0,q.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ze.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[i]}}),n=(0,q.difference)(t,e);return{errors:r,valid:n}}Z.findMissingPatterns=TC;function RC(t){var e=(0,q.filter)(t,function(i){var o=i[fi];return!(0,q.isRegExp)(o)&&!(0,q.isFunction)(o)&&!(0,q.has)(o,"exec")&&!(0,q.isString)(o)}),r=(0,q.map)(e,function(i){return{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:Ze.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[i]}}),n=(0,q.difference)(t,e);return{errors:r,valid:n}}Z.findInvalidPatterns=RC;var wG=/[^\\][\$]/;function bC(t){var e=function(i){yC(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return o.prototype.visitEndAnchor=function(a){this.found=!0},o}(vC.BaseRegExpVisitor),r=(0,q.filter)(t,function(i){var o=i[fi];try{var a=(0,_C.getRegExpAst)(o),s=new e;return s.visit(a),s.found}catch{return wG.test(o.source)}}),n=(0,q.map)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
3622
3622
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
3623
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ze.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}Z.findEndOfInputAnchor=bC;function AC(t){var e=(0,q.filter)(t,function(n){var i=n[fi];return i.test("")}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ze.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[n]}});return r}Z.findEmptyMatchRegExps=AC;var kG=/[^\\[][\^]|^\^/;function EC(t){var e=function(i){yC(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return o.prototype.visitStartAnchor=function(a){this.found=!0},o}(vC.BaseRegExpVisitor),r=(0,q.filter)(t,function(i){var o=i[fi];try{var a=(0,_C.getRegExpAst)(o),s=new e;return s.visit(a),s.found}catch{return kG.test(o.source)}}),n=(0,q.map)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
3623
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ze.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}Z.findEndOfInputAnchor=bC;function AC(t){var e=(0,q.filter)(t,function(n){var i=n[fi];return i.test("")}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ze.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[n]}});return r}Z.findEmptyMatchRegExps=AC;var SG=/[^\\[][\^]|^\^/;function EC(t){var e=function(i){yC(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return o.prototype.visitStartAnchor=function(a){this.found=!0},o}(vC.BaseRegExpVisitor),r=(0,q.filter)(t,function(i){var o=i[fi];try{var a=(0,_C.getRegExpAst)(o),s=new e;return s.visit(a),s.found}catch{return SG.test(o.source)}}),n=(0,q.map)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
3624
3624
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
3625
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ze.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}Z.findStartOfInputAnchor=EC;function CC(t){var e=(0,q.filter)(t,function(n){var i=n[fi];return i instanceof RegExp&&(i.multiline||i.global)}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ze.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}});return r}Z.findUnsupportedFlags=CC;function xC(t){var e=[],r=(0,q.map)(t,function(o){return(0,q.reduce)(t,function(a,s){return o.PATTERN.source===s.PATTERN.source&&!(0,q.contains)(e,s)&&s.PATTERN!==Ze.Lexer.NA&&(e.push(s),a.push(s)),a},[])});r=(0,q.compact)(r);var n=(0,q.filter)(r,function(o){return o.length>1}),i=(0,q.map)(n,function(o){var a=(0,q.map)(o,function(u){return u.name}),s=(0,q.first)(o).PATTERN;return{message:"The same RegExp pattern ->"+s+"<-"+("has been used in all of the following Token Types: "+a.join(", ")+" <-"),type:Ze.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}});return i}Z.findDuplicatePatterns=xC;function wC(t){var e=(0,q.filter)(t,function(n){if(!(0,q.has)(n,"GROUP"))return!1;var i=n.GROUP;return i!==Ze.Lexer.SKIPPED&&i!==Ze.Lexer.NA&&!(0,q.isString)(i)}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ze.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}});return r}Z.findInvalidGroupType=wC;function SC(t,e){var r=(0,q.filter)(t,function(i){return i.PUSH_MODE!==void 0&&!(0,q.contains)(e,i.PUSH_MODE)}),n=(0,q.map)(r,function(i){var o="Token Type: ->"+i.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+i.PUSH_MODE+"<-which does not exist";return{message:o,type:Ze.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return n}Z.findModesThatDoNotExist=SC;function kC(t){var e=[],r=(0,q.reduce)(t,function(n,i,o){var a=i.PATTERN;return a===Ze.Lexer.NA||((0,q.isString)(a)?n.push({str:a,idx:o,tokenType:i}):(0,q.isRegExp)(a)&&DG(a)&&n.push({str:a.source,idx:o,tokenType:i})),n},[]);return(0,q.forEach)(t,function(n,i){(0,q.forEach)(r,function(o){var a=o.str,s=o.idx,u=o.tokenType;if(i<s&&PG(a,n.PATTERN)){var l="Token: ->"+u.name+`<- can never be matched.
3625
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ze.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}Z.findStartOfInputAnchor=EC;function CC(t){var e=(0,q.filter)(t,function(n){var i=n[fi];return i instanceof RegExp&&(i.multiline||i.global)}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ze.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}});return r}Z.findUnsupportedFlags=CC;function xC(t){var e=[],r=(0,q.map)(t,function(o){return(0,q.reduce)(t,function(a,s){return o.PATTERN.source===s.PATTERN.source&&!(0,q.contains)(e,s)&&s.PATTERN!==Ze.Lexer.NA&&(e.push(s),a.push(s)),a},[])});r=(0,q.compact)(r);var n=(0,q.filter)(r,function(o){return o.length>1}),i=(0,q.map)(n,function(o){var a=(0,q.map)(o,function(u){return u.name}),s=(0,q.first)(o).PATTERN;return{message:"The same RegExp pattern ->"+s+"<-"+("has been used in all of the following Token Types: "+a.join(", ")+" <-"),type:Ze.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}});return i}Z.findDuplicatePatterns=xC;function wC(t){var e=(0,q.filter)(t,function(n){if(!(0,q.has)(n,"GROUP"))return!1;var i=n.GROUP;return i!==Ze.Lexer.SKIPPED&&i!==Ze.Lexer.NA&&!(0,q.isString)(i)}),r=(0,q.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ze.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}});return r}Z.findInvalidGroupType=wC;function SC(t,e){var r=(0,q.filter)(t,function(i){return i.PUSH_MODE!==void 0&&!(0,q.contains)(e,i.PUSH_MODE)}),n=(0,q.map)(r,function(i){var o="Token Type: ->"+i.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+i.PUSH_MODE+"<-which does not exist";return{message:o,type:Ze.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return n}Z.findModesThatDoNotExist=SC;function kC(t){var e=[],r=(0,q.reduce)(t,function(n,i,o){var a=i.PATTERN;return a===Ze.Lexer.NA||((0,q.isString)(a)?n.push({str:a,idx:o,tokenType:i}):(0,q.isRegExp)(a)&&PG(a)&&n.push({str:a.source,idx:o,tokenType:i})),n},[]);return(0,q.forEach)(t,function(n,i){(0,q.forEach)(r,function(o){var a=o.str,s=o.idx,u=o.tokenType;if(i<s&&kG(a,n.PATTERN)){var l="Token: ->"+u.name+`<- can never be matched.
3626
3626
  `+("Because it appears AFTER the Token Type ->"+n.name+"<-")+`in the lexer's definition.
3627
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Ze.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),e}Z.findUnreachablePatterns=kC;function PG(t,e){if((0,q.isRegExp)(e)){var r=e.exec(t);return r!==null&&r.index===0}else{if((0,q.isFunction)(e))return e(t,0,[],{});if((0,q.has)(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function DG(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,q.find)(e,function(r){return t.source.indexOf(r)!==-1})===void 0}function qy(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}Z.addStartOfInput=qy;function jy(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}Z.addStickyFlag=jy;function NG(t,e,r){var n=[];return(0,q.has)(t,Z.DEFAULT_MODE)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Z.DEFAULT_MODE+`> property in its definition
3627
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Ze.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),e}Z.findUnreachablePatterns=kC;function kG(t,e){if((0,q.isRegExp)(e)){var r=e.exec(t);return r!==null&&r.index===0}else{if((0,q.isFunction)(e))return e(t,0,[],{});if((0,q.has)(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function PG(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,q.find)(e,function(r){return t.source.indexOf(r)!==-1})===void 0}function qy(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}Z.addStartOfInput=qy;function jy(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}Z.addStickyFlag=jy;function DG(t,e,r){var n=[];return(0,q.has)(t,Z.DEFAULT_MODE)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Z.DEFAULT_MODE+`> property in its definition
3628
3628
  `,type:Ze.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,q.has)(t,Z.MODES)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Z.MODES+`> property in its definition
3629
3629
  `,type:Ze.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,q.has)(t,Z.MODES)&&(0,q.has)(t,Z.DEFAULT_MODE)&&!(0,q.has)(t.modes,t.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a "+Z.DEFAULT_MODE+": <"+t.defaultMode+`>which does not exist
3630
3630
  `,type:Ze.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,q.has)(t,Z.MODES)&&(0,q.forEach)(t.modes,function(i,o){(0,q.forEach)(i,function(a,s){(0,q.isUndefined)(a)&&n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+o+"> at index: <"+s+`>
3631
- `),type:Ze.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),n}Z.performRuntimeChecks=NG;function OG(t,e,r){var n=[],i=!1,o=(0,q.compact)((0,q.flatten)((0,q.mapValues)(t.modes,function(u){return u}))),a=(0,q.reject)(o,function(u){return u[fi]===Ze.Lexer.NA}),s=OC(r);return e&&(0,q.forEach)(a,function(u){var l=DC(u,s);if(l!==!1){var c=NC(u,l),f={message:c,type:l.issue,tokenType:u};n.push(f)}else(0,q.has)(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):(0,Ya.canMatchCharCode)(s,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
3631
+ `),type:Ze.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),n}Z.performRuntimeChecks=DG;function NG(t,e,r){var n=[],i=!1,o=(0,q.compact)((0,q.flatten)((0,q.mapValues)(t.modes,function(u){return u}))),a=(0,q.reject)(o,function(u){return u[fi]===Ze.Lexer.NA}),s=OC(r);return e&&(0,q.forEach)(a,function(u){var l=DC(u,s);if(l!==!1){var c=NC(u,l),f={message:c,type:l.issue,tokenType:u};n.push(f)}else(0,q.has)(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):(0,Ya.canMatchCharCode)(s,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
3632
3632
  This Lexer has been defined to track line and column information,
3633
3633
  But none of the Token Types can be identified as matching a line terminator.
3634
3634
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
3635
- for details.`,type:Ze.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}Z.performWarningRuntimeChecks=OG;function IG(t){var e={},r=(0,q.keys)(t);return(0,q.forEach)(r,function(n){var i=t[n];if((0,q.isArray)(i))e[n]=[];else throw Error("non exhaustive match")}),e}Z.cloneEmptyGroups=IG;function Uy(t){var e=t.PATTERN;if((0,q.isRegExp)(e))return!1;if((0,q.isFunction)(e))return!0;if((0,q.has)(e,"exec"))return!0;if((0,q.isString)(e))return!1;throw Error("non exhaustive match")}Z.isCustomPattern=Uy;function PC(t){return(0,q.isString)(t)&&t.length===1?t.charCodeAt(0):!1}Z.isShortPattern=PC;Z.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,r=this.lastIndex;r<e;r++){var n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function DC(t,e){if((0,q.has)(t,"LINE_BREAKS"))return!1;if((0,q.isRegExp)(t.PATTERN)){try{(0,Ya.canMatchCharCode)(e,t.PATTERN)}catch(r){return{issue:Ze.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if((0,q.isString)(t.PATTERN))return!1;if(Uy(t))return{issue:Ze.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function NC(t,e){if(e.issue===Ze.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
3635
+ for details.`,type:Ze.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}Z.performWarningRuntimeChecks=NG;function OG(t){var e={},r=(0,q.keys)(t);return(0,q.forEach)(r,function(n){var i=t[n];if((0,q.isArray)(i))e[n]=[];else throw Error("non exhaustive match")}),e}Z.cloneEmptyGroups=OG;function Uy(t){var e=t.PATTERN;if((0,q.isRegExp)(e))return!1;if((0,q.isFunction)(e))return!0;if((0,q.has)(e,"exec"))return!0;if((0,q.isString)(e))return!1;throw Error("non exhaustive match")}Z.isCustomPattern=Uy;function PC(t){return(0,q.isString)(t)&&t.length===1?t.charCodeAt(0):!1}Z.isShortPattern=PC;Z.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,r=this.lastIndex;r<e;r++){var n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function DC(t,e){if((0,q.has)(t,"LINE_BREAKS"))return!1;if((0,q.isRegExp)(t.PATTERN)){try{(0,Ya.canMatchCharCode)(e,t.PATTERN)}catch(r){return{issue:Ze.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if((0,q.isString)(t.PATTERN))return!1;if(Uy(t))return{issue:Ze.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function NC(t,e){if(e.issue===Ze.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
3636
3636
  `+(" The problem is in the <"+t.name+`> Token Type
3637
3637
  `)+(" Root cause: "+e.errMsg+`.
3638
3638
  `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ze.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
3639
3639
  `+(" The problem is in the <"+t.name+`> Token Type
3640
- `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Z.buildLineBreakIssueMessage=NC;function OC(t){var e=(0,q.map)(t,function(r){return(0,q.isString)(r)&&r.length>0?r.charCodeAt(0):r});return e}function Fy(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}Z.minOptimizationVal=256;var Nf=[];function Gy(t){return t<Z.minOptimizationVal?t:Nf[t]}Z.charCodeToOptimizedIndex=Gy;function $G(){if((0,q.isEmpty)(Nf)){Nf=new Array(65536);for(var t=0;t<65536;t++)Nf[t]=t>255?255+~~(t/255):t}}});var Xa=b(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.isTokenType=Ae.hasExtendingTokensTypesMapProperty=Ae.hasExtendingTokensTypesProperty=Ae.hasCategoriesProperty=Ae.hasShortKeyProperty=Ae.singleAssignCategoriesToksMap=Ae.assignCategoriesMapProp=Ae.assignCategoriesTokensProp=Ae.assignTokenDefaultProps=Ae.expandCategories=Ae.augmentTokenTypes=Ae.tokenIdxToClass=Ae.tokenShortNameIdx=Ae.tokenStructuredMatcherNoCategories=Ae.tokenStructuredMatcher=void 0;var jt=$e();function MG(t,e){var r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}Ae.tokenStructuredMatcher=MG;function LG(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}Ae.tokenStructuredMatcherNoCategories=LG;Ae.tokenShortNameIdx=1;Ae.tokenIdxToClass={};function FG(t){var e=IC(t);$C(e),LC(e),MC(e),(0,jt.forEach)(e,function(r){r.isParent=r.categoryMatches.length>0})}Ae.augmentTokenTypes=FG;function IC(t){for(var e=(0,jt.cloneArr)(t),r=t,n=!0;n;){r=(0,jt.compact)((0,jt.flatten)((0,jt.map)(r,function(o){return o.CATEGORIES})));var i=(0,jt.difference)(r,e);e=e.concat(i),(0,jt.isEmpty)(i)?n=!1:r=i}return e}Ae.expandCategories=IC;function $C(t){(0,jt.forEach)(t,function(e){FC(e)||(Ae.tokenIdxToClass[Ae.tokenShortNameIdx]=e,e.tokenTypeIdx=Ae.tokenShortNameIdx++),Hy(e)&&!(0,jt.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Hy(e)||(e.CATEGORIES=[]),qC(e)||(e.categoryMatches=[]),jC(e)||(e.categoryMatchesMap={})})}Ae.assignTokenDefaultProps=$C;function MC(t){(0,jt.forEach)(t,function(e){e.categoryMatches=[],(0,jt.forEach)(e.categoryMatchesMap,function(r,n){e.categoryMatches.push(Ae.tokenIdxToClass[n].tokenTypeIdx)})})}Ae.assignCategoriesTokensProp=MC;function LC(t){(0,jt.forEach)(t,function(e){By([],e)})}Ae.assignCategoriesMapProp=LC;function By(t,e){(0,jt.forEach)(t,function(r){e.categoryMatchesMap[r.tokenTypeIdx]=!0}),(0,jt.forEach)(e.CATEGORIES,function(r){var n=t.concat(e);(0,jt.contains)(n,r)||By(n,r)})}Ae.singleAssignCategoriesToksMap=By;function FC(t){return(0,jt.has)(t,"tokenTypeIdx")}Ae.hasShortKeyProperty=FC;function Hy(t){return(0,jt.has)(t,"CATEGORIES")}Ae.hasCategoriesProperty=Hy;function qC(t){return(0,jt.has)(t,"categoryMatches")}Ae.hasExtendingTokensTypesProperty=qC;function jC(t){return(0,jt.has)(t,"categoryMatchesMap")}Ae.hasExtendingTokensTypesMapProperty=jC;function qG(t){return(0,jt.has)(t,"tokenTypeIdx")}Ae.isTokenType=qG});var Wy=b(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.defaultLexerErrorProvider=void 0;Of.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,r,n,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+","+(" skipped "+r+" characters.")}}});var yu=b(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Lexer=Ko.LexerDefinitionErrorType=void 0;var jn=Ly(),Je=$e(),jG=Xa(),GG=Wy(),UG=kf(),HG;(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"})(HG=Ko.LexerDefinitionErrorType||(Ko.LexerDefinitionErrorType={}));var vu={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
3641
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:GG.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(vu);var BG=function(){function t(e,r){var n=this;if(r===void 0&&(r=vu),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
3640
+ `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Z.buildLineBreakIssueMessage=NC;function OC(t){var e=(0,q.map)(t,function(r){return(0,q.isString)(r)&&r.length>0?r.charCodeAt(0):r});return e}function Fy(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}Z.minOptimizationVal=256;var Nf=[];function Gy(t){return t<Z.minOptimizationVal?t:Nf[t]}Z.charCodeToOptimizedIndex=Gy;function IG(){if((0,q.isEmpty)(Nf)){Nf=new Array(65536);for(var t=0;t<65536;t++)Nf[t]=t>255?255+~~(t/255):t}}});var Xa=b(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.isTokenType=Ae.hasExtendingTokensTypesMapProperty=Ae.hasExtendingTokensTypesProperty=Ae.hasCategoriesProperty=Ae.hasShortKeyProperty=Ae.singleAssignCategoriesToksMap=Ae.assignCategoriesMapProp=Ae.assignCategoriesTokensProp=Ae.assignTokenDefaultProps=Ae.expandCategories=Ae.augmentTokenTypes=Ae.tokenIdxToClass=Ae.tokenShortNameIdx=Ae.tokenStructuredMatcherNoCategories=Ae.tokenStructuredMatcher=void 0;var jt=$e();function $G(t,e){var r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}Ae.tokenStructuredMatcher=$G;function MG(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}Ae.tokenStructuredMatcherNoCategories=MG;Ae.tokenShortNameIdx=1;Ae.tokenIdxToClass={};function LG(t){var e=IC(t);$C(e),LC(e),MC(e),(0,jt.forEach)(e,function(r){r.isParent=r.categoryMatches.length>0})}Ae.augmentTokenTypes=LG;function IC(t){for(var e=(0,jt.cloneArr)(t),r=t,n=!0;n;){r=(0,jt.compact)((0,jt.flatten)((0,jt.map)(r,function(o){return o.CATEGORIES})));var i=(0,jt.difference)(r,e);e=e.concat(i),(0,jt.isEmpty)(i)?n=!1:r=i}return e}Ae.expandCategories=IC;function $C(t){(0,jt.forEach)(t,function(e){FC(e)||(Ae.tokenIdxToClass[Ae.tokenShortNameIdx]=e,e.tokenTypeIdx=Ae.tokenShortNameIdx++),Hy(e)&&!(0,jt.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Hy(e)||(e.CATEGORIES=[]),qC(e)||(e.categoryMatches=[]),jC(e)||(e.categoryMatchesMap={})})}Ae.assignTokenDefaultProps=$C;function MC(t){(0,jt.forEach)(t,function(e){e.categoryMatches=[],(0,jt.forEach)(e.categoryMatchesMap,function(r,n){e.categoryMatches.push(Ae.tokenIdxToClass[n].tokenTypeIdx)})})}Ae.assignCategoriesTokensProp=MC;function LC(t){(0,jt.forEach)(t,function(e){By([],e)})}Ae.assignCategoriesMapProp=LC;function By(t,e){(0,jt.forEach)(t,function(r){e.categoryMatchesMap[r.tokenTypeIdx]=!0}),(0,jt.forEach)(e.CATEGORIES,function(r){var n=t.concat(e);(0,jt.contains)(n,r)||By(n,r)})}Ae.singleAssignCategoriesToksMap=By;function FC(t){return(0,jt.has)(t,"tokenTypeIdx")}Ae.hasShortKeyProperty=FC;function Hy(t){return(0,jt.has)(t,"CATEGORIES")}Ae.hasCategoriesProperty=Hy;function qC(t){return(0,jt.has)(t,"categoryMatches")}Ae.hasExtendingTokensTypesProperty=qC;function jC(t){return(0,jt.has)(t,"categoryMatchesMap")}Ae.hasExtendingTokensTypesMapProperty=jC;function FG(t){return(0,jt.has)(t,"tokenTypeIdx")}Ae.isTokenType=FG});var Wy=b(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.defaultLexerErrorProvider=void 0;Of.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,r,n,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+","+(" skipped "+r+" characters.")}}});var yu=b(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Lexer=Ko.LexerDefinitionErrorType=void 0;var jn=Ly(),Je=$e(),qG=Xa(),jG=Wy(),GG=kf(),UG;(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"})(UG=Ko.LexerDefinitionErrorType||(Ko.LexerDefinitionErrorType={}));var vu={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
3641
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:jG.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(vu);var HG=function(){function t(e,r){var n=this;if(r===void 0&&(r=vu),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
3642
3642
  a boolean 2nd argument is no longer supported`);this.config=(0,Je.merge)(vu,r);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var o,a=!0;n.TRACE_INIT("Lexer Config handling",function(){if(n.config.lineTerminatorsPattern===vu.lineTerminatorsPattern)n.config.lineTerminatorsPattern=jn.LineTerminatorOptimizedTester;else if(n.config.lineTerminatorCharacters===vu.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
3643
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),(0,Je.isArray)(e)?(o={modes:{}},o.modes[jn.DEFAULT_MODE]=(0,Je.cloneArr)(e),o[jn.DEFAULT_MODE]=jn.DEFAULT_MODE):(a=!1,o=(0,Je.cloneObj)(e))}),n.config.skipValidations===!1&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,jn.performRuntimeChecks)(o,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat((0,jn.performWarningRuntimeChecks)(o,n.trackStartLines,n.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},(0,Je.forEach)(o.modes,function(c,f){o.modes[f]=(0,Je.reject)(c,function(p){return(0,Je.isUndefined)(p)})});var s=(0,Je.keys)(o.modes);if((0,Je.forEach)(o.modes,function(c,f){n.TRACE_INIT("Mode: <"+f+"> processing",function(){if(n.modes.push(f),n.config.skipValidations===!1&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,jn.validatePatterns)(c,s))}),(0,Je.isEmpty)(n.lexerDefinitionErrors)){(0,jG.augmentTokenTypes)(c);var p;n.TRACE_INIT("analyzeTokenTypes",function(){p=(0,jn.analyzeTokenTypes)(c,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT.bind(n)})}),n.patternIdxToConfig[f]=p.patternIdxToConfig,n.charCodeToPatternIdxToConfig[f]=p.charCodeToPatternIdxToConfig,n.emptyGroups=(0,Je.merge)(n.emptyGroups,p.emptyGroups),n.hasCustom=p.hasCustom||n.hasCustom,n.canModeBeOptimized[f]=p.canBeOptimized}})}),n.defaultMode=o.defaultMode,!(0,Je.isEmpty)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=(0,Je.map)(n.lexerDefinitionErrors,function(c){return c.message}),l=u.join(`-----------------------
3643
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),(0,Je.isArray)(e)?(o={modes:{}},o.modes[jn.DEFAULT_MODE]=(0,Je.cloneArr)(e),o[jn.DEFAULT_MODE]=jn.DEFAULT_MODE):(a=!1,o=(0,Je.cloneObj)(e))}),n.config.skipValidations===!1&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,jn.performRuntimeChecks)(o,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat((0,jn.performWarningRuntimeChecks)(o,n.trackStartLines,n.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},(0,Je.forEach)(o.modes,function(c,f){o.modes[f]=(0,Je.reject)(c,function(p){return(0,Je.isUndefined)(p)})});var s=(0,Je.keys)(o.modes);if((0,Je.forEach)(o.modes,function(c,f){n.TRACE_INIT("Mode: <"+f+"> processing",function(){if(n.modes.push(f),n.config.skipValidations===!1&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,jn.validatePatterns)(c,s))}),(0,Je.isEmpty)(n.lexerDefinitionErrors)){(0,qG.augmentTokenTypes)(c);var p;n.TRACE_INIT("analyzeTokenTypes",function(){p=(0,jn.analyzeTokenTypes)(c,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT.bind(n)})}),n.patternIdxToConfig[f]=p.patternIdxToConfig,n.charCodeToPatternIdxToConfig[f]=p.charCodeToPatternIdxToConfig,n.emptyGroups=(0,Je.merge)(n.emptyGroups,p.emptyGroups),n.hasCustom=p.hasCustom||n.hasCustom,n.canModeBeOptimized[f]=p.canBeOptimized}})}),n.defaultMode=o.defaultMode,!(0,Je.isEmpty)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=(0,Je.map)(n.lexerDefinitionErrors,function(c){return c.message}),l=u.join(`-----------------------
3644
3644
  `);throw new Error(`Errors detected in definition of Lexer:
3645
3645
  `+l)}(0,Je.forEach)(n.lexerDefinitionWarning,function(c){(0,Je.PRINT_WARNING)(c.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if(jn.SUPPORT_STICKY?(n.chopInput=Je.IDENTITY,n.match=n.matchWithTest):(n.updateLastIndex=Je.NOOP,n.match=n.matchWithExec),a&&(n.handleModes=Je.NOOP),n.trackStartLines===!1&&(n.computeNewColumn=Je.IDENTITY),n.trackEndLines===!1&&(n.updateTokenEndLineColumnLocation=Je.NOOP),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else if(/onlyOffset/i.test(n.config.positionTracking))n.createTokenInstance=n.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+n.config.positionTracking+'"');n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)}),n.TRACE_INIT("Failed Optimization Warnings",function(){var c=(0,Je.reduce)(n.canModeBeOptimized,function(f,p,h){return p===!1&&f.push(h),f},[]);if(r.ensureOptimizations&&!(0,Je.isEmpty)(c))throw Error("Lexer Modes: < "+c.join(", ")+` > cannot be optimized.
3646
3646
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
3647
- Or inspect the console log for details on how to resolve these issues.`)}),n.TRACE_INIT("clearRegExpParserCache",function(){(0,UG.clearRegExpParserCache)()}),n.TRACE_INIT("toFastProperties",function(){(0,Je.toFastProperties)(n)})})}return t.prototype.tokenize=function(e,r){if(r===void 0&&(r=this.defaultMode),!(0,Je.isEmpty)(this.lexerDefinitionErrors)){var n=(0,Je.map)(this.lexerDefinitionErrors,function(a){return a.message}),i=n.join(`-----------------------
3647
+ Or inspect the console log for details on how to resolve these issues.`)}),n.TRACE_INIT("clearRegExpParserCache",function(){(0,GG.clearRegExpParserCache)()}),n.TRACE_INIT("toFastProperties",function(){(0,Je.toFastProperties)(n)})})}return t.prototype.tokenize=function(e,r){if(r===void 0&&(r=this.defaultMode),!(0,Je.isEmpty)(this.lexerDefinitionErrors)){var n=(0,Je.map)(this.lexerDefinitionErrors,function(a){return a.message}),i=n.join(`-----------------------
3648
3648
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
3649
- `+i)}var o=this.tokenizeInternal(e,r);return o},t.prototype.tokenizeInternal=function(e,r){var n=this,i,o,a,s,u,l,c,f,p,h,d,g,C,x,T,v,k=e,j=k.length,O=0,$=0,X=this.hasCustom?0:Math.floor(e.length/10),J=new Array(X),le=[],pe=this.trackStartLines?1:void 0,G=this.trackStartLines?1:void 0,I=(0,jn.cloneEmptyGroups)(this.emptyGroups),U=this.trackStartLines,z=this.config.lineTerminatorsPattern,de=0,ie=[],re=[],he=[],me=[];Object.freeze(me);var ze=void 0;function H(){return ie}function K(Ct){var Jn=(0,jn.charCodeToOptimizedIndex)(Ct),Xr=re[Jn];return Xr===void 0?me:Xr}var ne=function(Ct){if(he.length===1&&Ct.tokenType.PUSH_MODE===void 0){var Jn=n.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ct);le.push({offset:Ct.startOffset,line:Ct.startLine!==void 0?Ct.startLine:void 0,column:Ct.startColumn!==void 0?Ct.startColumn:void 0,length:Ct.image.length,message:Jn})}else{he.pop();var Xr=(0,Je.last)(he);ie=n.patternIdxToConfig[Xr],re=n.charCodeToPatternIdxToConfig[Xr],de=ie.length;var fa=n.canModeBeOptimized[Xr]&&n.config.safeMode===!1;re&&fa?ze=K:ze=H}};function Me(Ct){he.push(Ct),re=this.charCodeToPatternIdxToConfig[Ct],ie=this.patternIdxToConfig[Ct],de=ie.length,de=ie.length;var Jn=this.canModeBeOptimized[Ct]&&this.config.safeMode===!1;re&&Jn?ze=K:ze=H}Me.call(this,r);for(var Ne;O<j;){l=null;var Nr=k.charCodeAt(O),Ur=ze(Nr),Or=Ur.length;for(i=0;i<Or;i++){Ne=Ur[i];var _t=Ne.pattern;c=null;var Tt=Ne.short;if(Tt!==!1?Nr===Tt&&(l=_t):Ne.isCustom===!0?(v=_t.exec(k,O,J,I),v!==null?(l=v[0],v.payload!==void 0&&(c=v.payload)):l=null):(this.updateLastIndex(_t,O),l=this.match(_t,e,O)),l!==null){if(u=Ne.longerAlt,u!==void 0){var vn=u.length;for(a=0;a<vn;a++){var Hr=ie[u[a]],Qt=Hr.pattern;if(f=null,Hr.isCustom===!0?(v=Qt.exec(k,O,J,I),v!==null?(s=v[0],v.payload!==void 0&&(f=v.payload)):s=null):(this.updateLastIndex(Qt,O),s=this.match(Qt,e,O)),s&&s.length>l.length){l=s,c=f,Ne=Hr;break}}}break}}if(l!==null){if(p=l.length,h=Ne.group,h!==void 0&&(d=Ne.tokenTypeIdx,g=this.createTokenInstance(l,O,d,Ne.tokenType,pe,G,p),this.handlePayload(g,c),h===!1?$=this.addToken(J,$,g):I[h].push(g)),e=this.chopInput(e,p),O=O+p,G=this.computeNewColumn(G,p),U===!0&&Ne.canLineTerminator===!0){var Br=0,_n=void 0,xo=void 0;z.lastIndex=0;do _n=z.test(l),_n===!0&&(xo=z.lastIndex-1,Br++);while(_n===!0);Br!==0&&(pe=pe+Br,G=p-xo,this.updateTokenEndLineColumnLocation(g,h,xo,Br,pe,G,p))}this.handleModes(Ne,ne,Me,g)}else{for(var Yr=O,Zn=pe,ca=G,Ei=!1;!Ei&&O<j;)for(x=k.charCodeAt(O),e=this.chopInput(e,1),O++,o=0;o<de;o++){var Tn=ie[o],_t=Tn.pattern,Tt=Tn.short;if(Tt!==!1?k.charCodeAt(O)===Tt&&(Ei=!0):Tn.isCustom===!0?Ei=_t.exec(k,O,J,I)!==null:(this.updateLastIndex(_t,O),Ei=_t.exec(e)!==null),Ei===!0)break}C=O-Yr,T=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(k,Yr,C,Zn,ca),le.push({offset:Yr,line:Zn,column:ca,length:C,message:T})}}return this.hasCustom||(J.length=$),{tokens:J,groups:I,errors:le}},t.prototype.handleModes=function(e,r,n,i){if(e.pop===!0){var o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)},t.prototype.chopInput=function(e,r){return e.substring(r)},t.prototype.updateLastIndex=function(e,r){e.lastIndex=r},t.prototype.updateTokenEndLineColumnLocation=function(e,r,n,i,o,a,s){var u,l;r!==void 0&&(u=n===s-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=a-1+-l))},t.prototype.computeNewColumn=function(e,r){return e+r},t.prototype.createTokenInstance=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return null},t.prototype.createOffsetOnlyToken=function(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}},t.prototype.createStartOnlyToken=function(e,r,n,i,o,a){return{image:e,startOffset:r,startLine:o,startColumn:a,tokenTypeIdx:n,tokenType:i}},t.prototype.createFullToken=function(e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:r+s-1,startLine:o,endLine:o,startColumn:a,endColumn:a+s-1,tokenTypeIdx:n,tokenType:i}},t.prototype.addToken=function(e,r,n){return 666},t.prototype.addTokenUsingPush=function(e,r,n){return e.push(n),r},t.prototype.addTokenUsingMemberAccess=function(e,r,n){return e[r]=n,r++,r},t.prototype.handlePayload=function(e,r){},t.prototype.handlePayloadNoCustom=function(e,r){},t.prototype.handlePayloadWithCustom=function(e,r){r!==null&&(e.payload=r)},t.prototype.match=function(e,r,n){return null},t.prototype.matchWithTest=function(e,r,n){var i=e.test(r);return i===!0?r.substring(n,e.lastIndex):null},t.prototype.matchWithExec=function(e,r){var n=e.exec(r);return n!==null?n[0]:n},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--> <"+e+">");var i=(0,Je.timer)(r),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}else return r()},t.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",t.NA=/NOT_APPLICABLE/,t}();Ko.Lexer=BG});var fo=b(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.tokenMatcher=sr.createTokenInstance=sr.EOF=sr.createToken=sr.hasTokenLabel=sr.tokenName=sr.tokenLabel=void 0;var Gn=$e(),WG=yu(),Ky=Xa();function KG(t){return YC(t)?t.LABEL:t.name}sr.tokenLabel=KG;function zG(t){return t.name}sr.tokenName=zG;function YC(t){return(0,Gn.isString)(t.LABEL)&&t.LABEL!==""}sr.hasTokenLabel=YC;var VG="parent",GC="categories",UC="label",HC="group",BC="push_mode",WC="pop_mode",KC="longer_alt",zC="line_breaks",VC="start_chars_hint";function XC(t){return YG(t)}sr.createToken=XC;function YG(t){var e=t.pattern,r={};if(r.name=t.name,(0,Gn.isUndefined)(e)||(r.PATTERN=e),(0,Gn.has)(t,VG))throw`The parent property is no longer supported.
3650
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Gn.has)(t,GC)&&(r.CATEGORIES=t[GC]),(0,Ky.augmentTokenTypes)([r]),(0,Gn.has)(t,UC)&&(r.LABEL=t[UC]),(0,Gn.has)(t,HC)&&(r.GROUP=t[HC]),(0,Gn.has)(t,WC)&&(r.POP_MODE=t[WC]),(0,Gn.has)(t,BC)&&(r.PUSH_MODE=t[BC]),(0,Gn.has)(t,KC)&&(r.LONGER_ALT=t[KC]),(0,Gn.has)(t,zC)&&(r.LINE_BREAKS=t[zC]),(0,Gn.has)(t,VC)&&(r.START_CHARS_HINT=t[VC]),r}sr.EOF=XC({name:"EOF",pattern:WG.Lexer.NA});(0,Ky.augmentTokenTypes)([sr.EOF]);function XG(t,e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}sr.createTokenInstance=XG;function ZG(t,e){return(0,Ky.tokenStructuredMatcher)(t,e)}sr.tokenMatcher=ZG});var Lr=b(Ge=>{"use strict";var Fi=Ge&&Ge.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.serializeProduction=Ge.serializeGrammar=Ge.Terminal=Ge.Alternation=Ge.RepetitionWithSeparator=Ge.Repetition=Ge.RepetitionMandatoryWithSeparator=Ge.RepetitionMandatory=Ge.Option=Ge.Alternative=Ge.Rule=Ge.NonTerminal=Ge.AbstractProduction=void 0;var st=$e(),JG=fo(),di=function(){function t(e){this._definition=e}return Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this),(0,st.forEach)(this.definition,function(r){r.accept(e)})},t}();Ge.AbstractProduction=di;var ZC=function(t){Fi(e,t);function e(r){var n=t.call(this,[])||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(r){},enumerable:!1,configurable:!0}),e.prototype.accept=function(r){r.visit(this)},e}(di);Ge.NonTerminal=ZC;var JC=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.orgText="",(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Rule=JC;var QC=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.ignoreAmbiguities=!1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Alternative=QC;var ex=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Option=ex;var tx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionMandatory=tx;var rx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionMandatoryWithSeparator=rx;var nx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Repetition=nx;var ix=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionWithSeparator=ix;var ox=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(r){this._definition=r},enumerable:!1,configurable:!0}),e}(di);Ge.Alternation=ox;var If=function(){function t(e){this.idx=1,(0,st.assign)(this,(0,st.pick)(e,function(r){return r!==void 0}))}return t.prototype.accept=function(e){e.visit(this)},t}();Ge.Terminal=If;function QG(t){return(0,st.map)(t,_u)}Ge.serializeGrammar=QG;function _u(t){function e(o){return(0,st.map)(o,_u)}if(t instanceof ZC){var r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return(0,st.isString)(t.label)&&(r.label=t.label),r}else{if(t instanceof QC)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ex)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof tx)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof rx)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:_u(new If({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ix)return{type:"RepetitionWithSeparator",idx:t.idx,separator:_u(new If({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof nx)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ox)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof If){var n={type:"Terminal",name:t.terminalType.name,label:(0,JG.tokenLabel)(t.terminalType),idx:t.idx};(0,st.isString)(t.label)&&(n.terminalLabel=t.label);var i=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=(0,st.isRegExp)(i)?i.source:i),n}else{if(t instanceof JC)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}Ge.serializeProduction=_u});var Mf=b($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.RestWalker=void 0;var zy=$e(),Fr=Lr(),eU=function(){function t(){}return t.prototype.walk=function(e,r){var n=this;r===void 0&&(r=[]),(0,zy.forEach)(e.definition,function(i,o){var a=(0,zy.drop)(e.definition,o+1);if(i instanceof Fr.NonTerminal)n.walkProdRef(i,a,r);else if(i instanceof Fr.Terminal)n.walkTerminal(i,a,r);else if(i instanceof Fr.Alternative)n.walkFlat(i,a,r);else if(i instanceof Fr.Option)n.walkOption(i,a,r);else if(i instanceof Fr.RepetitionMandatory)n.walkAtLeastOne(i,a,r);else if(i instanceof Fr.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(i,a,r);else if(i instanceof Fr.RepetitionWithSeparator)n.walkManySep(i,a,r);else if(i instanceof Fr.Repetition)n.walkMany(i,a,r);else if(i instanceof Fr.Alternation)n.walkOr(i,a,r);else throw Error("non exhaustive match")})},t.prototype.walkTerminal=function(e,r,n){},t.prototype.walkProdRef=function(e,r,n){},t.prototype.walkFlat=function(e,r,n){var i=r.concat(n);this.walk(e,i)},t.prototype.walkOption=function(e,r,n){var i=r.concat(n);this.walk(e,i)},t.prototype.walkAtLeastOne=function(e,r,n){var i=[new Fr.Option({definition:e.definition})].concat(r,n);this.walk(e,i)},t.prototype.walkAtLeastOneSep=function(e,r,n){var i=ax(e,r,n);this.walk(e,i)},t.prototype.walkMany=function(e,r,n){var i=[new Fr.Option({definition:e.definition})].concat(r,n);this.walk(e,i)},t.prototype.walkManySep=function(e,r,n){var i=ax(e,r,n);this.walk(e,i)},t.prototype.walkOr=function(e,r,n){var i=this,o=r.concat(n);(0,zy.forEach)(e.definition,function(a){var s=new Fr.Alternative({definition:[a]});i.walk(s,o)})},t}();$f.RestWalker=eU;function ax(t,e,r){var n=[new Fr.Option({definition:[new Fr.Terminal({terminalType:t.separator})].concat(t.definition)})],i=n.concat(e,r);return i}});var Za=b(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.GAstVisitor=void 0;var pi=Lr(),tU=function(){function t(){}return t.prototype.visit=function(e){var r=e;switch(r.constructor){case pi.NonTerminal:return this.visitNonTerminal(r);case pi.Alternative:return this.visitAlternative(r);case pi.Option:return this.visitOption(r);case pi.RepetitionMandatory:return this.visitRepetitionMandatory(r);case pi.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(r);case pi.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(r);case pi.Repetition:return this.visitRepetition(r);case pi.Alternation:return this.visitAlternation(r);case pi.Terminal:return this.visitTerminal(r);case pi.Rule:return this.visitRule(r);default:throw Error("non exhaustive match")}},t.prototype.visitNonTerminal=function(e){},t.prototype.visitAlternative=function(e){},t.prototype.visitOption=function(e){},t.prototype.visitRepetition=function(e){},t.prototype.visitRepetitionMandatory=function(e){},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){},t.prototype.visitRepetitionWithSeparator=function(e){},t.prototype.visitAlternation=function(e){},t.prototype.visitTerminal=function(e){},t.prototype.visitRule=function(e){},t}();Lf.GAstVisitor=tU});var Ru=b(_r=>{"use strict";var rU=_r&&_r.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_r,"__esModule",{value:!0});_r.collectMethods=_r.DslMethodsCollectorVisitor=_r.getProductionDslName=_r.isBranchingProd=_r.isOptionalProd=_r.isSequenceProd=void 0;var Tu=$e(),mt=Lr(),nU=Za();function iU(t){return t instanceof mt.Alternative||t instanceof mt.Option||t instanceof mt.Repetition||t instanceof mt.RepetitionMandatory||t instanceof mt.RepetitionMandatoryWithSeparator||t instanceof mt.RepetitionWithSeparator||t instanceof mt.Terminal||t instanceof mt.Rule}_r.isSequenceProd=iU;function Vy(t,e){e===void 0&&(e=[]);var r=t instanceof mt.Option||t instanceof mt.Repetition||t instanceof mt.RepetitionWithSeparator;return r?!0:t instanceof mt.Alternation?(0,Tu.some)(t.definition,function(n){return Vy(n,e)}):t instanceof mt.NonTerminal&&(0,Tu.contains)(e,t)?!1:t instanceof mt.AbstractProduction?(t instanceof mt.NonTerminal&&e.push(t),(0,Tu.every)(t.definition,function(n){return Vy(n,e)})):!1}_r.isOptionalProd=Vy;function oU(t){return t instanceof mt.Alternation}_r.isBranchingProd=oU;function aU(t){if(t instanceof mt.NonTerminal)return"SUBRULE";if(t instanceof mt.Option)return"OPTION";if(t instanceof mt.Alternation)return"OR";if(t instanceof mt.RepetitionMandatory)return"AT_LEAST_ONE";if(t instanceof mt.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(t instanceof mt.RepetitionWithSeparator)return"MANY_SEP";if(t instanceof mt.Repetition)return"MANY";if(t instanceof mt.Terminal)return"CONSUME";throw Error("non exhaustive match")}_r.getProductionDslName=aU;var sx=function(t){rU(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.separator="-",r.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},r}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(r){var n=r.terminalType.name+this.separator+"Terminal";(0,Tu.has)(this.dslMethods,n)||(this.dslMethods[n]=[]),this.dslMethods[n].push(r)},e.prototype.visitNonTerminal=function(r){var n=r.nonTerminalName+this.separator+"Terminal";(0,Tu.has)(this.dslMethods,n)||(this.dslMethods[n]=[]),this.dslMethods[n].push(r)},e.prototype.visitOption=function(r){this.dslMethods.option.push(r)},e.prototype.visitRepetitionWithSeparator=function(r){this.dslMethods.repetitionWithSeparator.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.dslMethods.repetitionMandatory.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.dslMethods.repetitionMandatoryWithSeparator.push(r)},e.prototype.visitRepetition=function(r){this.dslMethods.repetition.push(r)},e.prototype.visitAlternation=function(r){this.dslMethods.alternation.push(r)},e}(nU.GAstVisitor);_r.DslMethodsCollectorVisitor=sx;var Ff=new sx;function sU(t){Ff.reset(),t.accept(Ff);var e=Ff.dslMethods;return Ff.reset(),e}_r.collectMethods=sU});var Xy=b(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.firstForTerminal=hi.firstForBranching=hi.firstForSequence=hi.first=void 0;var qf=$e(),ux=Lr(),Yy=Ru();function jf(t){if(t instanceof ux.NonTerminal)return jf(t.referencedRule);if(t instanceof ux.Terminal)return fx(t);if((0,Yy.isSequenceProd)(t))return lx(t);if((0,Yy.isBranchingProd)(t))return cx(t);throw Error("non exhaustive match")}hi.first=jf;function lx(t){for(var e=[],r=t.definition,n=0,i=r.length>n,o,a=!0;i&&a;)o=r[n],a=(0,Yy.isOptionalProd)(o),e=e.concat(jf(o)),n=n+1,i=r.length>n;return(0,qf.uniq)(e)}hi.firstForSequence=lx;function cx(t){var e=(0,qf.map)(t.definition,function(r){return jf(r)});return(0,qf.uniq)((0,qf.flatten)(e))}hi.firstForBranching=cx;function fx(t){return[t.terminalType]}hi.firstForTerminal=fx});var Zy=b(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.IN=void 0;Gf.IN="_~IN~_"});var gx=b(un=>{"use strict";var uU=un&&un.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(un,"__esModule",{value:!0});un.buildInProdFollowPrefix=un.buildBetweenProdsFollowPrefix=un.computeAllProdsFollows=un.ResyncFollowsWalker=void 0;var lU=Mf(),cU=Xy(),dx=$e(),px=Zy(),fU=Lr(),hx=function(t){uU(e,t);function e(r){var n=t.call(this)||this;return n.topProd=r,n.follows={},n}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(r,n,i){},e.prototype.walkProdRef=function(r,n,i){var o=mx(r.referencedRule,r.idx)+this.topProd.name,a=n.concat(i),s=new fU.Alternative({definition:a}),u=(0,cU.first)(s);this.follows[o]=u},e}(lU.RestWalker);un.ResyncFollowsWalker=hx;function dU(t){var e={};return(0,dx.forEach)(t,function(r){var n=new hx(r).startWalking();(0,dx.assign)(e,n)}),e}un.computeAllProdsFollows=dU;function mx(t,e){return t.name+e+px.IN}un.buildBetweenProdsFollowPrefix=mx;function pU(t){var e=t.terminalType.name;return e+t.idx+px.IN}un.buildInProdFollowPrefix=pU});var bu=b(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.defaultGrammarValidatorErrorProvider=qi.defaultGrammarResolverErrorProvider=qi.defaultParserErrorProvider=void 0;var Ja=fo(),hU=$e(),Un=$e(),Jy=Lr(),yx=Ru();qi.defaultParserErrorProvider={buildMismatchTokenMessage:function(t){var e=t.expected,r=t.actual,n=t.previous,i=t.ruleName,o=(0,Ja.hasTokenLabel)(e),a=o?"--> "+(0,Ja.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",s="Expecting "+a+" but found --> '"+r.image+"' <--";return s},buildNotAllInputParsedMessage:function(t){var e=t.firstRedundant,r=t.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(t){var e=t.expectedPathsPerAlt,r=t.actual,n=t.previous,i=t.customUserDescription,o=t.ruleName,a="Expecting: ",s=(0,Un.first)(r).image,u=`
3649
+ `+i)}var o=this.tokenizeInternal(e,r);return o},t.prototype.tokenizeInternal=function(e,r){var n=this,i,o,a,s,u,l,c,f,p,h,d,g,C,x,T,v,k=e,j=k.length,O=0,$=0,X=this.hasCustom?0:Math.floor(e.length/10),J=new Array(X),le=[],pe=this.trackStartLines?1:void 0,G=this.trackStartLines?1:void 0,I=(0,jn.cloneEmptyGroups)(this.emptyGroups),U=this.trackStartLines,z=this.config.lineTerminatorsPattern,de=0,ie=[],re=[],he=[],me=[];Object.freeze(me);var ze=void 0;function H(){return ie}function K(Ct){var Jn=(0,jn.charCodeToOptimizedIndex)(Ct),Xr=re[Jn];return Xr===void 0?me:Xr}var ne=function(Ct){if(he.length===1&&Ct.tokenType.PUSH_MODE===void 0){var Jn=n.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ct);le.push({offset:Ct.startOffset,line:Ct.startLine!==void 0?Ct.startLine:void 0,column:Ct.startColumn!==void 0?Ct.startColumn:void 0,length:Ct.image.length,message:Jn})}else{he.pop();var Xr=(0,Je.last)(he);ie=n.patternIdxToConfig[Xr],re=n.charCodeToPatternIdxToConfig[Xr],de=ie.length;var fa=n.canModeBeOptimized[Xr]&&n.config.safeMode===!1;re&&fa?ze=K:ze=H}};function Me(Ct){he.push(Ct),re=this.charCodeToPatternIdxToConfig[Ct],ie=this.patternIdxToConfig[Ct],de=ie.length,de=ie.length;var Jn=this.canModeBeOptimized[Ct]&&this.config.safeMode===!1;re&&Jn?ze=K:ze=H}Me.call(this,r);for(var Ne;O<j;){l=null;var Nr=k.charCodeAt(O),Ur=ze(Nr),Or=Ur.length;for(i=0;i<Or;i++){Ne=Ur[i];var _t=Ne.pattern;c=null;var Tt=Ne.short;if(Tt!==!1?Nr===Tt&&(l=_t):Ne.isCustom===!0?(v=_t.exec(k,O,J,I),v!==null?(l=v[0],v.payload!==void 0&&(c=v.payload)):l=null):(this.updateLastIndex(_t,O),l=this.match(_t,e,O)),l!==null){if(u=Ne.longerAlt,u!==void 0){var vn=u.length;for(a=0;a<vn;a++){var Hr=ie[u[a]],Qt=Hr.pattern;if(f=null,Hr.isCustom===!0?(v=Qt.exec(k,O,J,I),v!==null?(s=v[0],v.payload!==void 0&&(f=v.payload)):s=null):(this.updateLastIndex(Qt,O),s=this.match(Qt,e,O)),s&&s.length>l.length){l=s,c=f,Ne=Hr;break}}}break}}if(l!==null){if(p=l.length,h=Ne.group,h!==void 0&&(d=Ne.tokenTypeIdx,g=this.createTokenInstance(l,O,d,Ne.tokenType,pe,G,p),this.handlePayload(g,c),h===!1?$=this.addToken(J,$,g):I[h].push(g)),e=this.chopInput(e,p),O=O+p,G=this.computeNewColumn(G,p),U===!0&&Ne.canLineTerminator===!0){var Br=0,_n=void 0,xo=void 0;z.lastIndex=0;do _n=z.test(l),_n===!0&&(xo=z.lastIndex-1,Br++);while(_n===!0);Br!==0&&(pe=pe+Br,G=p-xo,this.updateTokenEndLineColumnLocation(g,h,xo,Br,pe,G,p))}this.handleModes(Ne,ne,Me,g)}else{for(var Yr=O,Zn=pe,ca=G,Ei=!1;!Ei&&O<j;)for(x=k.charCodeAt(O),e=this.chopInput(e,1),O++,o=0;o<de;o++){var Tn=ie[o],_t=Tn.pattern,Tt=Tn.short;if(Tt!==!1?k.charCodeAt(O)===Tt&&(Ei=!0):Tn.isCustom===!0?Ei=_t.exec(k,O,J,I)!==null:(this.updateLastIndex(_t,O),Ei=_t.exec(e)!==null),Ei===!0)break}C=O-Yr,T=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(k,Yr,C,Zn,ca),le.push({offset:Yr,line:Zn,column:ca,length:C,message:T})}}return this.hasCustom||(J.length=$),{tokens:J,groups:I,errors:le}},t.prototype.handleModes=function(e,r,n,i){if(e.pop===!0){var o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)},t.prototype.chopInput=function(e,r){return e.substring(r)},t.prototype.updateLastIndex=function(e,r){e.lastIndex=r},t.prototype.updateTokenEndLineColumnLocation=function(e,r,n,i,o,a,s){var u,l;r!==void 0&&(u=n===s-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=a-1+-l))},t.prototype.computeNewColumn=function(e,r){return e+r},t.prototype.createTokenInstance=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return null},t.prototype.createOffsetOnlyToken=function(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}},t.prototype.createStartOnlyToken=function(e,r,n,i,o,a){return{image:e,startOffset:r,startLine:o,startColumn:a,tokenTypeIdx:n,tokenType:i}},t.prototype.createFullToken=function(e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:r+s-1,startLine:o,endLine:o,startColumn:a,endColumn:a+s-1,tokenTypeIdx:n,tokenType:i}},t.prototype.addToken=function(e,r,n){return 666},t.prototype.addTokenUsingPush=function(e,r,n){return e.push(n),r},t.prototype.addTokenUsingMemberAccess=function(e,r,n){return e[r]=n,r++,r},t.prototype.handlePayload=function(e,r){},t.prototype.handlePayloadNoCustom=function(e,r){},t.prototype.handlePayloadWithCustom=function(e,r){r!==null&&(e.payload=r)},t.prototype.match=function(e,r,n){return null},t.prototype.matchWithTest=function(e,r,n){var i=e.test(r);return i===!0?r.substring(n,e.lastIndex):null},t.prototype.matchWithExec=function(e,r){var n=e.exec(r);return n!==null?n[0]:n},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--> <"+e+">");var i=(0,Je.timer)(r),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}else return r()},t.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",t.NA=/NOT_APPLICABLE/,t}();Ko.Lexer=HG});var fo=b(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.tokenMatcher=sr.createTokenInstance=sr.EOF=sr.createToken=sr.hasTokenLabel=sr.tokenName=sr.tokenLabel=void 0;var Gn=$e(),BG=yu(),Ky=Xa();function WG(t){return YC(t)?t.LABEL:t.name}sr.tokenLabel=WG;function KG(t){return t.name}sr.tokenName=KG;function YC(t){return(0,Gn.isString)(t.LABEL)&&t.LABEL!==""}sr.hasTokenLabel=YC;var zG="parent",GC="categories",UC="label",HC="group",BC="push_mode",WC="pop_mode",KC="longer_alt",zC="line_breaks",VC="start_chars_hint";function XC(t){return VG(t)}sr.createToken=XC;function VG(t){var e=t.pattern,r={};if(r.name=t.name,(0,Gn.isUndefined)(e)||(r.PATTERN=e),(0,Gn.has)(t,zG))throw`The parent property is no longer supported.
3650
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Gn.has)(t,GC)&&(r.CATEGORIES=t[GC]),(0,Ky.augmentTokenTypes)([r]),(0,Gn.has)(t,UC)&&(r.LABEL=t[UC]),(0,Gn.has)(t,HC)&&(r.GROUP=t[HC]),(0,Gn.has)(t,WC)&&(r.POP_MODE=t[WC]),(0,Gn.has)(t,BC)&&(r.PUSH_MODE=t[BC]),(0,Gn.has)(t,KC)&&(r.LONGER_ALT=t[KC]),(0,Gn.has)(t,zC)&&(r.LINE_BREAKS=t[zC]),(0,Gn.has)(t,VC)&&(r.START_CHARS_HINT=t[VC]),r}sr.EOF=XC({name:"EOF",pattern:BG.Lexer.NA});(0,Ky.augmentTokenTypes)([sr.EOF]);function YG(t,e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}sr.createTokenInstance=YG;function XG(t,e){return(0,Ky.tokenStructuredMatcher)(t,e)}sr.tokenMatcher=XG});var Lr=b(Ge=>{"use strict";var Fi=Ge&&Ge.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.serializeProduction=Ge.serializeGrammar=Ge.Terminal=Ge.Alternation=Ge.RepetitionWithSeparator=Ge.Repetition=Ge.RepetitionMandatoryWithSeparator=Ge.RepetitionMandatory=Ge.Option=Ge.Alternative=Ge.Rule=Ge.NonTerminal=Ge.AbstractProduction=void 0;var st=$e(),ZG=fo(),di=function(){function t(e){this._definition=e}return Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this),(0,st.forEach)(this.definition,function(r){r.accept(e)})},t}();Ge.AbstractProduction=di;var ZC=function(t){Fi(e,t);function e(r){var n=t.call(this,[])||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(r){},enumerable:!1,configurable:!0}),e.prototype.accept=function(r){r.visit(this)},e}(di);Ge.NonTerminal=ZC;var JC=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.orgText="",(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Rule=JC;var QC=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.ignoreAmbiguities=!1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Alternative=QC;var ex=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Option=ex;var tx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionMandatory=tx;var rx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionMandatoryWithSeparator=rx;var nx=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.Repetition=nx;var ix=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return e}(di);Ge.RepetitionWithSeparator=ix;var ox=function(t){Fi(e,t);function e(r){var n=t.call(this,r.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,(0,st.assign)(n,(0,st.pick)(r,function(i){return i!==void 0})),n}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(r){this._definition=r},enumerable:!1,configurable:!0}),e}(di);Ge.Alternation=ox;var If=function(){function t(e){this.idx=1,(0,st.assign)(this,(0,st.pick)(e,function(r){return r!==void 0}))}return t.prototype.accept=function(e){e.visit(this)},t}();Ge.Terminal=If;function JG(t){return(0,st.map)(t,_u)}Ge.serializeGrammar=JG;function _u(t){function e(o){return(0,st.map)(o,_u)}if(t instanceof ZC){var r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return(0,st.isString)(t.label)&&(r.label=t.label),r}else{if(t instanceof QC)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ex)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof tx)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof rx)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:_u(new If({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ix)return{type:"RepetitionWithSeparator",idx:t.idx,separator:_u(new If({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof nx)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ox)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof If){var n={type:"Terminal",name:t.terminalType.name,label:(0,ZG.tokenLabel)(t.terminalType),idx:t.idx};(0,st.isString)(t.label)&&(n.terminalLabel=t.label);var i=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=(0,st.isRegExp)(i)?i.source:i),n}else{if(t instanceof JC)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}Ge.serializeProduction=_u});var Mf=b($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.RestWalker=void 0;var zy=$e(),Fr=Lr(),QG=function(){function t(){}return t.prototype.walk=function(e,r){var n=this;r===void 0&&(r=[]),(0,zy.forEach)(e.definition,function(i,o){var a=(0,zy.drop)(e.definition,o+1);if(i instanceof Fr.NonTerminal)n.walkProdRef(i,a,r);else if(i instanceof Fr.Terminal)n.walkTerminal(i,a,r);else if(i instanceof Fr.Alternative)n.walkFlat(i,a,r);else if(i instanceof Fr.Option)n.walkOption(i,a,r);else if(i instanceof Fr.RepetitionMandatory)n.walkAtLeastOne(i,a,r);else if(i instanceof Fr.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(i,a,r);else if(i instanceof Fr.RepetitionWithSeparator)n.walkManySep(i,a,r);else if(i instanceof Fr.Repetition)n.walkMany(i,a,r);else if(i instanceof Fr.Alternation)n.walkOr(i,a,r);else throw Error("non exhaustive match")})},t.prototype.walkTerminal=function(e,r,n){},t.prototype.walkProdRef=function(e,r,n){},t.prototype.walkFlat=function(e,r,n){var i=r.concat(n);this.walk(e,i)},t.prototype.walkOption=function(e,r,n){var i=r.concat(n);this.walk(e,i)},t.prototype.walkAtLeastOne=function(e,r,n){var i=[new Fr.Option({definition:e.definition})].concat(r,n);this.walk(e,i)},t.prototype.walkAtLeastOneSep=function(e,r,n){var i=ax(e,r,n);this.walk(e,i)},t.prototype.walkMany=function(e,r,n){var i=[new Fr.Option({definition:e.definition})].concat(r,n);this.walk(e,i)},t.prototype.walkManySep=function(e,r,n){var i=ax(e,r,n);this.walk(e,i)},t.prototype.walkOr=function(e,r,n){var i=this,o=r.concat(n);(0,zy.forEach)(e.definition,function(a){var s=new Fr.Alternative({definition:[a]});i.walk(s,o)})},t}();$f.RestWalker=QG;function ax(t,e,r){var n=[new Fr.Option({definition:[new Fr.Terminal({terminalType:t.separator})].concat(t.definition)})],i=n.concat(e,r);return i}});var Za=b(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.GAstVisitor=void 0;var pi=Lr(),eU=function(){function t(){}return t.prototype.visit=function(e){var r=e;switch(r.constructor){case pi.NonTerminal:return this.visitNonTerminal(r);case pi.Alternative:return this.visitAlternative(r);case pi.Option:return this.visitOption(r);case pi.RepetitionMandatory:return this.visitRepetitionMandatory(r);case pi.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(r);case pi.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(r);case pi.Repetition:return this.visitRepetition(r);case pi.Alternation:return this.visitAlternation(r);case pi.Terminal:return this.visitTerminal(r);case pi.Rule:return this.visitRule(r);default:throw Error("non exhaustive match")}},t.prototype.visitNonTerminal=function(e){},t.prototype.visitAlternative=function(e){},t.prototype.visitOption=function(e){},t.prototype.visitRepetition=function(e){},t.prototype.visitRepetitionMandatory=function(e){},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){},t.prototype.visitRepetitionWithSeparator=function(e){},t.prototype.visitAlternation=function(e){},t.prototype.visitTerminal=function(e){},t.prototype.visitRule=function(e){},t}();Lf.GAstVisitor=eU});var Ru=b(_r=>{"use strict";var tU=_r&&_r.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_r,"__esModule",{value:!0});_r.collectMethods=_r.DslMethodsCollectorVisitor=_r.getProductionDslName=_r.isBranchingProd=_r.isOptionalProd=_r.isSequenceProd=void 0;var Tu=$e(),mt=Lr(),rU=Za();function nU(t){return t instanceof mt.Alternative||t instanceof mt.Option||t instanceof mt.Repetition||t instanceof mt.RepetitionMandatory||t instanceof mt.RepetitionMandatoryWithSeparator||t instanceof mt.RepetitionWithSeparator||t instanceof mt.Terminal||t instanceof mt.Rule}_r.isSequenceProd=nU;function Vy(t,e){e===void 0&&(e=[]);var r=t instanceof mt.Option||t instanceof mt.Repetition||t instanceof mt.RepetitionWithSeparator;return r?!0:t instanceof mt.Alternation?(0,Tu.some)(t.definition,function(n){return Vy(n,e)}):t instanceof mt.NonTerminal&&(0,Tu.contains)(e,t)?!1:t instanceof mt.AbstractProduction?(t instanceof mt.NonTerminal&&e.push(t),(0,Tu.every)(t.definition,function(n){return Vy(n,e)})):!1}_r.isOptionalProd=Vy;function iU(t){return t instanceof mt.Alternation}_r.isBranchingProd=iU;function oU(t){if(t instanceof mt.NonTerminal)return"SUBRULE";if(t instanceof mt.Option)return"OPTION";if(t instanceof mt.Alternation)return"OR";if(t instanceof mt.RepetitionMandatory)return"AT_LEAST_ONE";if(t instanceof mt.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(t instanceof mt.RepetitionWithSeparator)return"MANY_SEP";if(t instanceof mt.Repetition)return"MANY";if(t instanceof mt.Terminal)return"CONSUME";throw Error("non exhaustive match")}_r.getProductionDslName=oU;var sx=function(t){tU(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.separator="-",r.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},r}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(r){var n=r.terminalType.name+this.separator+"Terminal";(0,Tu.has)(this.dslMethods,n)||(this.dslMethods[n]=[]),this.dslMethods[n].push(r)},e.prototype.visitNonTerminal=function(r){var n=r.nonTerminalName+this.separator+"Terminal";(0,Tu.has)(this.dslMethods,n)||(this.dslMethods[n]=[]),this.dslMethods[n].push(r)},e.prototype.visitOption=function(r){this.dslMethods.option.push(r)},e.prototype.visitRepetitionWithSeparator=function(r){this.dslMethods.repetitionWithSeparator.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.dslMethods.repetitionMandatory.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.dslMethods.repetitionMandatoryWithSeparator.push(r)},e.prototype.visitRepetition=function(r){this.dslMethods.repetition.push(r)},e.prototype.visitAlternation=function(r){this.dslMethods.alternation.push(r)},e}(rU.GAstVisitor);_r.DslMethodsCollectorVisitor=sx;var Ff=new sx;function aU(t){Ff.reset(),t.accept(Ff);var e=Ff.dslMethods;return Ff.reset(),e}_r.collectMethods=aU});var Xy=b(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.firstForTerminal=hi.firstForBranching=hi.firstForSequence=hi.first=void 0;var qf=$e(),ux=Lr(),Yy=Ru();function jf(t){if(t instanceof ux.NonTerminal)return jf(t.referencedRule);if(t instanceof ux.Terminal)return fx(t);if((0,Yy.isSequenceProd)(t))return lx(t);if((0,Yy.isBranchingProd)(t))return cx(t);throw Error("non exhaustive match")}hi.first=jf;function lx(t){for(var e=[],r=t.definition,n=0,i=r.length>n,o,a=!0;i&&a;)o=r[n],a=(0,Yy.isOptionalProd)(o),e=e.concat(jf(o)),n=n+1,i=r.length>n;return(0,qf.uniq)(e)}hi.firstForSequence=lx;function cx(t){var e=(0,qf.map)(t.definition,function(r){return jf(r)});return(0,qf.uniq)((0,qf.flatten)(e))}hi.firstForBranching=cx;function fx(t){return[t.terminalType]}hi.firstForTerminal=fx});var Zy=b(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.IN=void 0;Gf.IN="_~IN~_"});var gx=b(un=>{"use strict";var sU=un&&un.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(un,"__esModule",{value:!0});un.buildInProdFollowPrefix=un.buildBetweenProdsFollowPrefix=un.computeAllProdsFollows=un.ResyncFollowsWalker=void 0;var uU=Mf(),lU=Xy(),dx=$e(),px=Zy(),cU=Lr(),hx=function(t){sU(e,t);function e(r){var n=t.call(this)||this;return n.topProd=r,n.follows={},n}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(r,n,i){},e.prototype.walkProdRef=function(r,n,i){var o=mx(r.referencedRule,r.idx)+this.topProd.name,a=n.concat(i),s=new cU.Alternative({definition:a}),u=(0,lU.first)(s);this.follows[o]=u},e}(uU.RestWalker);un.ResyncFollowsWalker=hx;function fU(t){var e={};return(0,dx.forEach)(t,function(r){var n=new hx(r).startWalking();(0,dx.assign)(e,n)}),e}un.computeAllProdsFollows=fU;function mx(t,e){return t.name+e+px.IN}un.buildBetweenProdsFollowPrefix=mx;function dU(t){var e=t.terminalType.name;return e+t.idx+px.IN}un.buildInProdFollowPrefix=dU});var bu=b(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.defaultGrammarValidatorErrorProvider=qi.defaultGrammarResolverErrorProvider=qi.defaultParserErrorProvider=void 0;var Ja=fo(),pU=$e(),Un=$e(),Jy=Lr(),yx=Ru();qi.defaultParserErrorProvider={buildMismatchTokenMessage:function(t){var e=t.expected,r=t.actual,n=t.previous,i=t.ruleName,o=(0,Ja.hasTokenLabel)(e),a=o?"--> "+(0,Ja.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",s="Expecting "+a+" but found --> '"+r.image+"' <--";return s},buildNotAllInputParsedMessage:function(t){var e=t.firstRedundant,r=t.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(t){var e=t.expectedPathsPerAlt,r=t.actual,n=t.previous,i=t.customUserDescription,o=t.ruleName,a="Expecting: ",s=(0,Un.first)(r).image,u=`
3651
3651
  but found: '`+s+"'";if(i)return a+i+u;var l=(0,Un.reduce)(e,function(h,d){return h.concat(d)},[]),c=(0,Un.map)(l,function(h){return"["+(0,Un.map)(h,function(d){return(0,Ja.tokenLabel)(d)}).join(", ")+"]"}),f=(0,Un.map)(c,function(h,d){return" "+(d+1)+". "+h}),p=`one of these possible Token sequences:
3652
3652
  `+f.join(`
3653
3653
  `);return a+p+u},buildEarlyExitMessage:function(t){var e=t.expectedIterationPaths,r=t.actual,n=t.customUserDescription,i=t.ruleName,o="Expecting: ",a=(0,Un.first)(r).image,s=`
@@ -3672,38 +3672,38 @@ For Further details.`,n},buildEmptyRepetitionError:function(t){var e=(0,yx.getPr
3672
3672
  This could lead to an infinite loop.`;return r},buildTokenNameError:function(t){return"deprecated"},buildEmptyAlternationError:function(t){var e="Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+">"+(" in <OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
3673
3673
  `)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(t){var e=`An Alternation cannot have more than 256 alternatives:
3674
3674
  `+("<OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
3675
- has `+(t.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(t){var e=t.topLevelRule.name,r=hU.map(t.leftRecursionPath,function(o){return o.name}),n=e+" --> "+r.concat([e]).join(" --> "),i=`Left Recursion found in grammar.
3675
+ has `+(t.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(t){var e=t.topLevelRule.name,r=pU.map(t.leftRecursionPath,function(o){return o.name}),n=e+" --> "+r.concat([e]).join(" --> "),i=`Left Recursion found in grammar.
3676
3676
  `+("rule: <"+e+`> can be invoked from itself (directly or indirectly)
3677
3677
  `)+(`without consuming any Tokens. The grammar path that causes this is:
3678
3678
  `+n+`
3679
3679
  `)+` To fix this refactor your grammar to remove the left recursion.
3680
- see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return i},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var e;t.topLevelRule instanceof Jy.Rule?e=t.topLevelRule.name:e=t.topLevelRule;var r="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return r}}});var Tx=b(po=>{"use strict";var mU=po&&po.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(po,"__esModule",{value:!0});po.GastRefResolverVisitor=po.resolveGrammar=void 0;var gU=Kr(),vx=$e(),yU=Za();function vU(t,e){var r=new _x(t,e);return r.resolveRefs(),r.errors}po.resolveGrammar=vU;var _x=function(t){mU(e,t);function e(r,n){var i=t.call(this)||this;return i.nameToTopRule=r,i.errMsgProvider=n,i.errors=[],i}return e.prototype.resolveRefs=function(){var r=this;(0,vx.forEach)((0,vx.values)(this.nameToTopRule),function(n){r.currTopLevel=n,n.accept(r)})},e.prototype.visitNonTerminal=function(r){var n=this.nameToTopRule[r.nonTerminalName];if(n)r.referencedRule=n;else{var i=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:i,type:gU.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},e}(yU.GAstVisitor);po.GastRefResolverVisitor=_x});var Eu=b(kt=>{"use strict";var zo=kt&&kt.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(kt,"__esModule",{value:!0});kt.nextPossibleTokensAfter=kt.possiblePathsFrom=kt.NextTerminalAfterAtLeastOneSepWalker=kt.NextTerminalAfterAtLeastOneWalker=kt.NextTerminalAfterManySepWalker=kt.NextTerminalAfterManyWalker=kt.AbstractNextTerminalAfterProductionWalker=kt.NextAfterTokenWalker=kt.AbstractNextPossibleTokensWalker=void 0;var Rx=Mf(),ke=$e(),_U=Xy(),Re=Lr(),bx=function(t){zo(e,t);function e(r,n){var i=t.call(this)||this;return i.topProd=r,i.path=n,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return e.prototype.startWalking=function(){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=(0,ke.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,ke.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(r,n){n===void 0&&(n=[]),this.found||t.prototype.walk.call(this,r,n)},e.prototype.walkProdRef=function(r,n,i){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var o=n.concat(i);this.updateExpectedNext(),this.walk(r.referencedRule,o)}},e.prototype.updateExpectedNext=function(){(0,ke.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Rx.RestWalker);kt.AbstractNextPossibleTokensWalker=bx;var TU=function(t){zo(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.path=n,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return e.prototype.walkTerminal=function(r,n,i){if(this.isAtEndOfPath&&r.terminalType.name===this.nextTerminalName&&r.idx===this.nextTerminalOccurrence&&!this.found){var o=n.concat(i),a=new Re.Alternative({definition:o});this.possibleTokTypes=(0,_U.first)(a),this.found=!0}},e}(bx);kt.NextAfterTokenWalker=TU;var Au=function(t){zo(e,t);function e(r,n){var i=t.call(this)||this;return i.topRule=r,i.occurrence=n,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(Rx.RestWalker);kt.AbstractNextTerminalAfterProductionWalker=Au;var RU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkMany=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkMany.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterManyWalker=RU;var bU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkManySep=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkManySep.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterManySepWalker=bU;var AU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkAtLeastOne.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterAtLeastOneWalker=AU;var EU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkAtLeastOneSep.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterAtLeastOneSepWalker=EU;function Ax(t,e,r){r===void 0&&(r=[]),r=(0,ke.cloneArr)(r);var n=[],i=0;function o(l){return l.concat((0,ke.drop)(t,i+1))}function a(l){var c=Ax(o(l),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){var s=t[i];if(s instanceof Re.Alternative)return a(s.definition);if(s instanceof Re.NonTerminal)return a(s.definition);if(s instanceof Re.Option)n=a(s.definition);else if(s instanceof Re.RepetitionMandatory){var u=s.definition.concat([new Re.Repetition({definition:s.definition})]);return a(u)}else if(s instanceof Re.RepetitionMandatoryWithSeparator){var u=[new Re.Alternative({definition:s.definition}),new Re.Repetition({definition:[new Re.Terminal({terminalType:s.separator})].concat(s.definition)})];return a(u)}else if(s instanceof Re.RepetitionWithSeparator){var u=s.definition.concat([new Re.Repetition({definition:[new Re.Terminal({terminalType:s.separator})].concat(s.definition)})]);n=a(u)}else if(s instanceof Re.Repetition){var u=s.definition.concat([new Re.Repetition({definition:s.definition})]);n=a(u)}else{if(s instanceof Re.Alternation)return(0,ke.forEach)(s.definition,function(l){(0,ke.isEmpty)(l.definition)===!1&&(n=a(l.definition))}),n;if(s instanceof Re.Terminal)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:(0,ke.drop)(t,i)}),n}kt.possiblePathsFrom=Ax;function CU(t,e,r,n){var i="EXIT_NONE_TERMINAL",o=[i],a="EXIT_ALTERNATIVE",s=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!(0,ke.isEmpty)(f);){var p=f.pop();if(p===a){s&&(0,ke.last)(f).idx<=l&&f.pop();continue}var h=p.def,d=p.idx,g=p.ruleStack,C=p.occurrenceStack;if(!(0,ke.isEmpty)(h)){var x=h[0];if(x===i){var T={idx:d,def:(0,ke.drop)(h),ruleStack:(0,ke.dropRight)(g),occurrenceStack:(0,ke.dropRight)(C)};f.push(T)}else if(x instanceof Re.Terminal)if(d<u-1){var v=d+1,k=e[v];if(r(k,x.terminalType)){var T={idx:v,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push(T)}}else if(d===u-1)c.push({nextTokenType:x.terminalType,nextTokenOccurrence:x.idx,ruleStack:g,occurrenceStack:C}),s=!0;else throw Error("non exhaustive match");else if(x instanceof Re.NonTerminal){var j=(0,ke.cloneArr)(g);j.push(x.nonTerminalName);var O=(0,ke.cloneArr)(C);O.push(x.idx);var T={idx:d,def:x.definition.concat(o,(0,ke.drop)(h)),ruleStack:j,occurrenceStack:O};f.push(T)}else if(x instanceof Re.Option){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var X={idx:d,def:x.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.RepetitionMandatory){var J=new Re.Repetition({definition:x.definition,idx:x.idx}),le=x.definition.concat([J],(0,ke.drop)(h)),T={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(T)}else if(x instanceof Re.RepetitionMandatoryWithSeparator){var pe=new Re.Terminal({terminalType:x.separator}),J=new Re.Repetition({definition:[pe].concat(x.definition),idx:x.idx}),le=x.definition.concat([J],(0,ke.drop)(h)),T={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(T)}else if(x instanceof Re.RepetitionWithSeparator){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var pe=new Re.Terminal({terminalType:x.separator}),G=new Re.Repetition({definition:[pe].concat(x.definition),idx:x.idx}),le=x.definition.concat([G],(0,ke.drop)(h)),X={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.Repetition){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var G=new Re.Repetition({definition:x.definition,idx:x.idx}),le=x.definition.concat([G],(0,ke.drop)(h)),X={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.Alternation)for(var I=x.definition.length-1;I>=0;I--){var U=x.definition[I],z={idx:d,def:U.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C};f.push(z),f.push(a)}else if(x instanceof Re.Alternative)f.push({idx:d,def:x.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C});else if(x instanceof Re.Rule)f.push(xU(x,d,g,C));else throw Error("non exhaustive match")}}return c}kt.nextPossibleTokensAfter=CU;function xU(t,e,r,n){var i=(0,ke.cloneArr)(r);i.push(t.name);var o=(0,ke.cloneArr)(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}});var Cu=b(We=>{"use strict";var xx=We&&We.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(We,"__esModule",{value:!0});We.areTokenCategoriesNotUsed=We.isStrictPrefixOfPath=We.containsPath=We.getLookaheadPathsForOptionalProd=We.getLookaheadPathsForOr=We.lookAheadSequenceFromAlternatives=We.buildSingleAlternativeLookaheadFunction=We.buildAlternativesLookAheadFunc=We.buildLookaheadFuncForOptionalProd=We.buildLookaheadFuncForOr=We.getProdType=We.PROD_TYPE=void 0;var Qe=$e(),Ex=Eu(),wU=Mf(),Uf=Xa(),ho=Lr(),SU=Za(),Kt;(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"})(Kt=We.PROD_TYPE||(We.PROD_TYPE={}));function kU(t){if(t instanceof ho.Option)return Kt.OPTION;if(t instanceof ho.Repetition)return Kt.REPETITION;if(t instanceof ho.RepetitionMandatory)return Kt.REPETITION_MANDATORY;if(t instanceof ho.RepetitionMandatoryWithSeparator)return Kt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ho.RepetitionWithSeparator)return Kt.REPETITION_WITH_SEPARATOR;if(t instanceof ho.Alternation)return Kt.ALTERNATION;throw Error("non exhaustive match")}We.getProdType=kU;function PU(t,e,r,n,i,o){var a=Sx(t,e,r),s=tv(a)?Uf.tokenStructuredMatcherNoCategories:Uf.tokenStructuredMatcher;return o(a,n,s,i)}We.buildLookaheadFuncForOr=PU;function DU(t,e,r,n,i,o){var a=kx(t,e,i,r),s=tv(a)?Uf.tokenStructuredMatcherNoCategories:Uf.tokenStructuredMatcher;return o(a[0],s,n)}We.buildLookaheadFuncForOptionalProd=DU;function NU(t,e,r,n){var i=t.length,o=(0,Qe.every)(t,function(u){return(0,Qe.every)(u,function(l){return l.length===1})});if(e)return function(u){for(var l=(0,Qe.map)(u,function(v){return v.GATE}),c=0;c<i;c++){var f=t[c],p=f.length,h=l[c];if(h!==void 0&&h.call(this)===!1)continue;e:for(var d=0;d<p;d++){for(var g=f[d],C=g.length,x=0;x<C;x++){var T=this.LA(x+1);if(r(T,g[x])===!1)continue e}return c}}};if(o&&!n){var a=(0,Qe.map)(t,function(u){return(0,Qe.flatten)(u)}),s=(0,Qe.reduce)(a,function(u,l,c){return(0,Qe.forEach)(l,function(f){(0,Qe.has)(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),(0,Qe.forEach)(f.categoryMatches,function(p){(0,Qe.has)(u,p)||(u[p]=c)})}),u},[]);return function(){var u=this.LA(1);return s[u.tokenTypeIdx]}}else return function(){for(var u=0;u<i;u++){var l=t[u],c=l.length;e:for(var f=0;f<c;f++){for(var p=l[f],h=p.length,d=0;d<h;d++){var g=this.LA(d+1);if(r(g,p[d])===!1)continue e}return u}}}}We.buildAlternativesLookAheadFunc=NU;function OU(t,e,r){var n=(0,Qe.every)(t,function(l){return l.length===1}),i=t.length;if(n&&!r){var o=(0,Qe.flatten)(t);if(o.length===1&&(0,Qe.isEmpty)(o[0].categoryMatches)){var a=o[0],s=a.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{var u=(0,Qe.reduce)(o,function(l,c,f){return l[c.tokenTypeIdx]=!0,(0,Qe.forEach)(c.categoryMatches,function(p){l[p]=!0}),l},[]);return function(){var l=this.LA(1);return u[l.tokenTypeIdx]===!0}}}else return function(){e:for(var l=0;l<i;l++){for(var c=t[l],f=c.length,p=0;p<f;p++){var h=this.LA(p+1);if(e(h,c[p])===!1)continue e}return!0}return!1}}We.buildSingleAlternativeLookaheadFunction=OU;var IU=function(t){xx(e,t);function e(r,n,i){var o=t.call(this)||this;return o.topProd=r,o.targetOccurrence=n,o.targetProdType=i,o}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},e.prototype.checkIsTarget=function(r,n,i,o){return r.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=i.concat(o),!0):!1},e.prototype.walkOption=function(r,n,i){this.checkIsTarget(r,Kt.OPTION,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkAtLeastOne=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_MANDATORY,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkAtLeastOneSep=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_MANDATORY_WITH_SEPARATOR,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkMany=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkManySep=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_WITH_SEPARATOR,n,i)||t.prototype.walkOption.call(this,r,n,i)},e}(wU.RestWalker),wx=function(t){xx(e,t);function e(r,n,i){var o=t.call(this)||this;return o.targetOccurrence=r,o.targetProdType=n,o.targetRef=i,o.result=[],o}return e.prototype.checkIsTarget=function(r,n){r.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||r===this.targetRef)&&(this.result=r.definition)},e.prototype.visitOption=function(r){this.checkIsTarget(r,Kt.OPTION)},e.prototype.visitRepetition=function(r){this.checkIsTarget(r,Kt.REPETITION)},e.prototype.visitRepetitionMandatory=function(r){this.checkIsTarget(r,Kt.REPETITION_MANDATORY)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.checkIsTarget(r,Kt.REPETITION_MANDATORY_WITH_SEPARATOR)},e.prototype.visitRepetitionWithSeparator=function(r){this.checkIsTarget(r,Kt.REPETITION_WITH_SEPARATOR)},e.prototype.visitAlternation=function(r){this.checkIsTarget(r,Kt.ALTERNATION)},e}(SU.GAstVisitor);function Cx(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}function Qy(t){for(var e=[""],r=0;r<t.length;r++){for(var n=t[r],i=[],o=0;o<e.length;o++){var a=e[o];i.push(a+"_"+n.tokenTypeIdx);for(var s=0;s<n.categoryMatches.length;s++){var u="_"+n.categoryMatches[s];i.push(a+u)}}e=i}return e}function $U(t,e,r){for(var n=0;n<t.length;n++)if(n!==r)for(var i=t[n],o=0;o<e.length;o++){var a=e[o];if(i[a]===!0)return!1}return!0}function ev(t,e){for(var r=(0,Qe.map)(t,function(c){return(0,Ex.possiblePathsFrom)([c],1)}),n=Cx(r.length),i=(0,Qe.map)(r,function(c){var f={};return(0,Qe.forEach)(c,function(p){var h=Qy(p.partialPath);(0,Qe.forEach)(h,function(d){f[d]=!0})}),f}),o=r,a=1;a<=e;a++){var s=o;o=Cx(s.length);for(var u=function(c){for(var f=s[c],p=0;p<f.length;p++){var h=f[p].partialPath,d=f[p].suffixDef,g=Qy(h),C=$U(i,g,c);if(C||(0,Qe.isEmpty)(d)||h.length===e){var x=n[c];if(Px(x,h)===!1){x.push(h);for(var T=0;T<g.length;T++){var v=g[T];i[c][v]=!0}}}else{var k=(0,Ex.possiblePathsFrom)(d,a+1,h);o[c]=o[c].concat(k),(0,Qe.forEach)(k,function(j){var O=Qy(j.partialPath);(0,Qe.forEach)(O,function($){i[c][$]=!0})})}}},l=0;l<s.length;l++)u(l)}return n}We.lookAheadSequenceFromAlternatives=ev;function Sx(t,e,r,n){var i=new wx(t,Kt.ALTERNATION,n);return e.accept(i),ev(i.result,r)}We.getLookaheadPathsForOr=Sx;function kx(t,e,r,n){var i=new wx(t,r);e.accept(i);var o=i.result,a=new IU(e,t,r),s=a.startWalking(),u=new ho.Alternative({definition:o}),l=new ho.Alternative({definition:s});return ev([u,l],n)}We.getLookaheadPathsForOptionalProd=kx;function Px(t,e){e:for(var r=0;r<t.length;r++){var n=t[r];if(n.length===e.length){for(var i=0;i<n.length;i++){var o=e[i],a=n[i],s=o===a||a.categoryMatchesMap[o.tokenTypeIdx]!==void 0;if(s===!1)continue e}return!0}}return!1}We.containsPath=Px;function MU(t,e){return t.length<e.length&&(0,Qe.every)(t,function(r,n){var i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}We.isStrictPrefixOfPath=MU;function tv(t){return(0,Qe.every)(t,function(e){return(0,Qe.every)(e,function(r){return(0,Qe.every)(r,function(n){return(0,Qe.isEmpty)(n.categoryMatches)})})})}We.areTokenCategoriesNotUsed=tv});var sv=b(Ue=>{"use strict";var rv=Ue&&Ue.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkPrefixAlternativesAmbiguities=Ue.validateSomeNonEmptyLookaheadPath=Ue.validateTooManyAlts=Ue.RepetionCollector=Ue.validateAmbiguousAlternationAlternatives=Ue.validateEmptyOrAlternative=Ue.getFirstNoneTerminal=Ue.validateNoLeftRecursion=Ue.validateRuleIsOverridden=Ue.validateRuleDoesNotAlreadyExist=Ue.OccurrenceValidationCollector=Ue.identifyProductionForDuplicates=Ue.validateGrammar=void 0;var Ke=$e(),gt=$e(),mi=Kr(),nv=Ru(),Qa=Cu(),LU=Eu(),Hn=Lr(),iv=Za();function FU(t,e,r,n,i){var o=Ke.map(t,function(h){return qU(h,n)}),a=Ke.map(t,function(h){return ov(h,h,n)}),s=[],u=[],l=[];(0,gt.every)(a,gt.isEmpty)&&(s=(0,gt.map)(t,function(h){return $x(h,n)}),u=(0,gt.map)(t,function(h){return Mx(h,e,n)}),l=qx(t,e,n));var c=UU(t,r,n),f=(0,gt.map)(t,function(h){return Fx(h,n)}),p=(0,gt.map)(t,function(h){return Ix(h,t,i,n)});return Ke.flatten(o.concat(l,a,s,u,c,f,p))}Ue.validateGrammar=FU;function qU(t,e){var r=new Ox;t.accept(r);var n=r.allProductions,i=Ke.groupBy(n,Dx),o=Ke.pick(i,function(s){return s.length>1}),a=Ke.map(Ke.values(o),function(s){var u=Ke.first(s),l=e.buildDuplicateFoundError(t,s),c=(0,nv.getProductionDslName)(u),f={message:l,type:mi.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=Nx(u);return p&&(f.parameter=p),f});return a}function Dx(t){return(0,nv.getProductionDslName)(t)+"_#_"+t.idx+"_#_"+Nx(t)}Ue.identifyProductionForDuplicates=Dx;function Nx(t){return t instanceof Hn.Terminal?t.terminalType.name:t instanceof Hn.NonTerminal?t.nonTerminalName:""}var Ox=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitNonTerminal=function(r){this.allProductions.push(r)},e.prototype.visitOption=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e.prototype.visitAlternation=function(r){this.allProductions.push(r)},e.prototype.visitTerminal=function(r){this.allProductions.push(r)},e}(iv.GAstVisitor);Ue.OccurrenceValidationCollector=Ox;function Ix(t,e,r,n){var i=[],o=(0,gt.reduce)(e,function(s,u){return u.name===t.name?s+1:s},0);if(o>1){var a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:mi.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}Ue.validateRuleDoesNotAlreadyExist=Ix;function jU(t,e,r){var n=[],i;return Ke.contains(e,t)||(i="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",n.push({message:i,type:mi.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),n}Ue.validateRuleIsOverridden=jU;function ov(t,e,r,n){n===void 0&&(n=[]);var i=[],o=xu(e.definition);if(Ke.isEmpty(o))return[];var a=t.name,s=Ke.contains(o,t);s&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:mi.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:a});var u=Ke.difference(o,n.concat([t])),l=Ke.map(u,function(c){var f=Ke.cloneArr(n);return f.push(c),ov(t,c,r,f)});return i.concat(Ke.flatten(l))}Ue.validateNoLeftRecursion=ov;function xu(t){var e=[];if(Ke.isEmpty(t))return e;var r=Ke.first(t);if(r instanceof Hn.NonTerminal)e.push(r.referencedRule);else if(r instanceof Hn.Alternative||r instanceof Hn.Option||r instanceof Hn.RepetitionMandatory||r instanceof Hn.RepetitionMandatoryWithSeparator||r instanceof Hn.RepetitionWithSeparator||r instanceof Hn.Repetition)e=e.concat(xu(r.definition));else if(r instanceof Hn.Alternation)e=Ke.flatten(Ke.map(r.definition,function(a){return xu(a.definition)}));else if(!(r instanceof Hn.Terminal))throw Error("non exhaustive match");var n=(0,nv.isOptionalProd)(r),i=t.length>1;if(n&&i){var o=Ke.drop(t);return e.concat(xu(o))}else return e}Ue.getFirstNoneTerminal=xu;var av=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.alternations=[],r}return e.prototype.visitAlternation=function(r){this.alternations.push(r)},e}(iv.GAstVisitor);function $x(t,e){var r=new av;t.accept(r);var n=r.alternations,i=Ke.reduce(n,function(o,a){var s=Ke.dropRight(a.definition),u=Ke.map(s,function(l,c){var f=(0,LU.nextPossibleTokensAfter)([l],[],null,1);return Ke.isEmpty(f)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:c}),type:mi.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:c+1}:null});return o.concat(Ke.compact(u))},[]);return i}Ue.validateEmptyOrAlternative=$x;function Mx(t,e,r){var n=new av;t.accept(n);var i=n.alternations;i=(0,gt.reject)(i,function(a){return a.ignoreAmbiguities===!0});var o=Ke.reduce(i,function(a,s){var u=s.idx,l=s.maxLookahead||e,c=(0,Qa.getLookaheadPathsForOr)(u,t,l,s),f=GU(c,s,t,r),p=jx(c,s,t,r);return a.concat(f,p)},[]);return o}Ue.validateAmbiguousAlternationAlternatives=Mx;var Lx=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e}(iv.GAstVisitor);Ue.RepetionCollector=Lx;function Fx(t,e){var r=new av;t.accept(r);var n=r.alternations,i=Ke.reduce(n,function(o,a){return a.definition.length>255&&o.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:mi.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}),o},[]);return i}Ue.validateTooManyAlts=Fx;function qx(t,e,r){var n=[];return(0,gt.forEach)(t,function(i){var o=new Lx;i.accept(o);var a=o.allProductions;(0,gt.forEach)(a,function(s){var u=(0,Qa.getProdType)(s),l=s.maxLookahead||e,c=s.idx,f=(0,Qa.getLookaheadPathsForOptionalProd)(c,i,u,l),p=f[0];if((0,gt.isEmpty)((0,gt.flatten)(p))){var h=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:h,type:mi.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}Ue.validateSomeNonEmptyLookaheadPath=qx;function GU(t,e,r,n){var i=[],o=(0,gt.reduce)(t,function(s,u,l){return e.definition[l].ignoreAmbiguities===!0||(0,gt.forEach)(u,function(c){var f=[l];(0,gt.forEach)(t,function(p,h){l!==h&&(0,Qa.containsPath)(p,c)&&e.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!(0,Qa.containsPath)(i,c)&&(i.push(c),s.push({alts:f,path:c}))}),s},[]),a=Ke.map(o,function(s){var u=(0,gt.map)(s.alts,function(c){return c+1}),l=n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:s.path});return{message:l,type:mi.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:[s.alts]}});return a}function jx(t,e,r,n){var i=[],o=(0,gt.reduce)(t,function(a,s,u){var l=(0,gt.map)(s,function(c){return{idx:u,path:c}});return a.concat(l)},[]);return(0,gt.forEach)(o,function(a){var s=e.definition[a.idx];if(s.ignoreAmbiguities!==!0){var u=a.idx,l=a.path,c=(0,gt.findAll)(o,function(p){return e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&(0,Qa.isStrictPrefixOfPath)(p.path,l)}),f=(0,gt.map)(c,function(p){var h=[p.idx+1,u+1],d=e.idx===0?"":e.idx,g=n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:h,prefixPath:p.path});return{message:g,type:mi.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:d,alternatives:h}});i=i.concat(f)}}),i}Ue.checkPrefixAlternativesAmbiguities=jx;function UU(t,e,r){var n=[],i=(0,gt.map)(e,function(o){return o.name});return(0,gt.forEach)(t,function(o){var a=o.name;if((0,gt.contains)(i,a)){var s=r.buildNamespaceConflictError(o);n.push({message:s,type:mi.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}});var Ux=b(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.validateGrammar=es.resolveGrammar=void 0;var uv=$e(),HU=Tx(),BU=sv(),Gx=bu();function WU(t){t=(0,uv.defaults)(t,{errMsgProvider:Gx.defaultGrammarResolverErrorProvider});var e={};return(0,uv.forEach)(t.rules,function(r){e[r.name]=r}),(0,HU.resolveGrammar)(e,t.errMsgProvider)}es.resolveGrammar=WU;function KU(t){return t=(0,uv.defaults)(t,{errMsgProvider:Gx.defaultGrammarValidatorErrorProvider}),(0,BU.validateGrammar)(t.rules,t.maxLookahead,t.tokenTypes,t.errMsgProvider,t.grammarName)}es.validateGrammar=KU});var ts=b(qr=>{"use strict";var wu=qr&&qr.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(qr,"__esModule",{value:!0});qr.EarlyExitException=qr.NotAllInputParsedException=qr.NoViableAltException=qr.MismatchedTokenException=qr.isRecognitionException=void 0;var zU=$e(),Hx="MismatchedTokenException",Bx="NoViableAltException",Wx="EarlyExitException",Kx="NotAllInputParsedException",zx=[Hx,Bx,Wx,Kx];Object.freeze(zx);function VU(t){return(0,zU.contains)(zx,t.name)}qr.isRecognitionException=VU;var Hf=function(t){wu(e,t);function e(r,n){var i=this.constructor,o=t.call(this,r)||this;return o.token=n,o.resyncedTokens=[],Object.setPrototypeOf(o,i.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,o.constructor),o}return e}(Error),YU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Hx,o}return e}(Hf);qr.MismatchedTokenException=YU;var XU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Bx,o}return e}(Hf);qr.NoViableAltException=XU;var ZU=function(t){wu(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name=Kx,i}return e}(Hf);qr.NotAllInputParsedException=ZU;var JU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Wx,o}return e}(Hf);qr.EarlyExitException=JU});var cv=b(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.attemptInRepetitionRecovery=Tr.Recoverable=Tr.InRuleRecoveryException=Tr.IN_RULE_RECOVERY_EXCEPTION=Tr.EOF_FOLLOW_KEY=void 0;var Bf=fo(),ln=$e(),QU=ts(),eH=Zy(),tH=Kr();Tr.EOF_FOLLOW_KEY={};Tr.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function lv(t){this.name=Tr.IN_RULE_RECOVERY_EXCEPTION,this.message=t}Tr.InRuleRecoveryException=lv;lv.prototype=Error.prototype;var rH=function(){function t(){}return t.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,ln.has)(e,"recoveryEnabled")?e.recoveryEnabled:tH.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Vx)},t.prototype.getTokenToInsert=function(e){var r=(0,Bf.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r},t.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},t.prototype.tryInRepetitionRecovery=function(e,r,n,i){for(var o=this,a=this.findReSyncTokenType(),s=this.exportLexerState(),u=[],l=!1,c=this.LA(1),f=this.LA(1),p=function(){var h=o.LA(0),d=o.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:h,ruleName:o.getCurrRuleFullName()}),g=new QU.MismatchedTokenException(d,c,o.LA(0));g.resyncedTokens=(0,ln.dropRight)(u),o.SAVE_ERROR(g)};!l;)if(this.tokenMatcher(f,i)){p();return}else if(n.call(this)){p(),e.apply(this,r);return}else this.tokenMatcher(f,a)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,u));this.importLexerState(s)},t.prototype.shouldInRepetitionRecoveryBeTried=function(e,r,n){return!(n===!1||e===void 0||r===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))},t.prototype.getFollowsForInRuleRecovery=function(e,r){var n=this.getCurrentGrammarPath(e,r),i=this.getNextPossibleTokenTypes(n);return i},t.prototype.tryInRuleRecovery=function(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r)){var n=this.getTokenToInsert(e);return n}if(this.canRecoverWithSingleTokenDeletion(e)){var i=this.SKIP_TOKEN();return this.consumeToken(),i}throw new lv("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)},t.prototype.canRecoverWithSingleTokenInsertion=function(e,r){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,ln.isEmpty)(r))return!1;var i=this.LA(1),o=(0,ln.find)(r,function(a){return n.tokenMatcher(i,a)})!==void 0;return o},t.prototype.canRecoverWithSingleTokenDeletion=function(e){var r=this.tokenMatcher(this.LA(2),e);return r},t.prototype.isInCurrentRuleReSyncSet=function(e){var r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return(0,ln.contains)(n,e)},t.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),r=this.LA(1),n=2;;){var i=r.tokenType;if((0,ln.contains)(e,i))return i;r=this.LA(n),n++}},t.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Tr.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}},t.prototype.buildFullFollowKeyStack=function(){var e=this,r=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,ln.map)(r,function(i,o){return o===0?Tr.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(i),idxInCallingRule:n[o],inRule:e.shortRuleNameToFullName(r[o-1])}})},t.prototype.flattenFollowSet=function(){var e=this,r=(0,ln.map)(this.buildFullFollowKeyStack(),function(n){return e.getFollowSetFromFollowKey(n)});return(0,ln.flatten)(r)},t.prototype.getFollowSetFromFollowKey=function(e){if(e===Tr.EOF_FOLLOW_KEY)return[Bf.EOF];var r=e.ruleName+e.idxInCallingRule+eH.IN+e.inRule;return this.resyncFollows[r]},t.prototype.addToResyncTokens=function(e,r){return this.tokenMatcher(e,Bf.EOF)||r.push(e),r},t.prototype.reSyncTo=function(e){for(var r=[],n=this.LA(1);this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return(0,ln.dropRight)(r)},t.prototype.attemptInRepetitionRecovery=function(e,r,n,i,o,a,s){},t.prototype.getCurrentGrammarPath=function(e,r){var n=this.getHumanReadableRuleStack(),i=(0,ln.cloneArr)(this.RULE_OCCURRENCE_STACK),o={ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r};return o},t.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,ln.map)(this.RULE_STACK,function(r){return e.shortRuleNameToFullName(r)})},t}();Tr.Recoverable=rH;function Vx(t,e,r,n,i,o,a){var s=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[s];if(u===void 0){var l=this.getCurrRuleFullName(),c=this.getGAstProductions()[l],f=new o(c,i);u=f.startWalking(),this.firstAfterRepMap[s]=u}var p=u.token,h=u.occurrence,d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&p===void 0&&(p=Bf.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(p,h,a)&&this.tryInRepetitionRecovery(t,e,r,p)}Tr.attemptInRepetitionRecovery=Vx});var Wf=b(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.getKeyForAutomaticLookahead=qe.AT_LEAST_ONE_SEP_IDX=qe.MANY_SEP_IDX=qe.AT_LEAST_ONE_IDX=qe.MANY_IDX=qe.OPTION_IDX=qe.OR_IDX=qe.BITS_FOR_ALT_IDX=qe.BITS_FOR_RULE_IDX=qe.BITS_FOR_OCCURRENCE_IDX=qe.BITS_FOR_METHOD_TYPE=void 0;qe.BITS_FOR_METHOD_TYPE=4;qe.BITS_FOR_OCCURRENCE_IDX=8;qe.BITS_FOR_RULE_IDX=12;qe.BITS_FOR_ALT_IDX=8;qe.OR_IDX=1<<qe.BITS_FOR_OCCURRENCE_IDX;qe.OPTION_IDX=2<<qe.BITS_FOR_OCCURRENCE_IDX;qe.MANY_IDX=3<<qe.BITS_FOR_OCCURRENCE_IDX;qe.AT_LEAST_ONE_IDX=4<<qe.BITS_FOR_OCCURRENCE_IDX;qe.MANY_SEP_IDX=5<<qe.BITS_FOR_OCCURRENCE_IDX;qe.AT_LEAST_ONE_SEP_IDX=6<<qe.BITS_FOR_OCCURRENCE_IDX;function nH(t,e,r){return r|e|t}qe.getKeyForAutomaticLookahead=nH;var z9=32-qe.BITS_FOR_ALT_IDX});var Xx=b(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.LooksAhead=void 0;var ji=Cu(),Bn=$e(),Yx=Kr(),Gi=Wf(),Vo=Ru(),iH=function(){function t(){}return t.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,Bn.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Yx.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,Bn.has)(e,"maxLookahead")?e.maxLookahead:Yx.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,Bn.isES2015MapSupported)()?new Map:[],(0,Bn.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(e){var r=this;(0,Bn.forEach)(e,function(n){r.TRACE_INIT(n.name+" Rule Lookahead",function(){var i=(0,Vo.collectMethods)(n),o=i.alternation,a=i.repetition,s=i.option,u=i.repetitionMandatory,l=i.repetitionMandatoryWithSeparator,c=i.repetitionWithSeparator;(0,Bn.forEach)(o,function(f){var p=f.idx===0?"":f.idx;r.TRACE_INIT(""+(0,Vo.getProductionDslName)(f)+p,function(){var h=(0,ji.buildLookaheadFuncForOr)(f.idx,n,f.maxLookahead||r.maxLookahead,f.hasPredicates,r.dynamicTokensEnabled,r.lookAheadBuilderForAlternatives),d=(0,Gi.getKeyForAutomaticLookahead)(r.fullRuleNameToShort[n.name],Gi.OR_IDX,f.idx);r.setLaFuncCache(d,h)})}),(0,Bn.forEach)(a,function(f){r.computeLookaheadFunc(n,f.idx,Gi.MANY_IDX,ji.PROD_TYPE.REPETITION,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(s,function(f){r.computeLookaheadFunc(n,f.idx,Gi.OPTION_IDX,ji.PROD_TYPE.OPTION,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(u,function(f){r.computeLookaheadFunc(n,f.idx,Gi.AT_LEAST_ONE_IDX,ji.PROD_TYPE.REPETITION_MANDATORY,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(l,function(f){r.computeLookaheadFunc(n,f.idx,Gi.AT_LEAST_ONE_SEP_IDX,ji.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(c,function(f){r.computeLookaheadFunc(n,f.idx,Gi.MANY_SEP_IDX,ji.PROD_TYPE.REPETITION_WITH_SEPARATOR,f.maxLookahead,(0,Vo.getProductionDslName)(f))})})})},t.prototype.computeLookaheadFunc=function(e,r,n,i,o,a){var s=this;this.TRACE_INIT(""+a+(r===0?"":r),function(){var u=(0,ji.buildLookaheadFuncForOptionalProd)(r,e,o||s.maxLookahead,s.dynamicTokensEnabled,i,s.lookAheadBuilderForOptional),l=(0,Gi.getKeyForAutomaticLookahead)(s.fullRuleNameToShort[e.name],n,r);s.setLaFuncCache(l,u)})},t.prototype.lookAheadBuilderForOptional=function(e,r,n){return(0,ji.buildSingleAlternativeLookaheadFunction)(e,r,n)},t.prototype.lookAheadBuilderForAlternatives=function(e,r,n,i){return(0,ji.buildAlternativesLookAheadFunc)(e,r,n,i)},t.prototype.getKeyForAutomaticLookahead=function(e,r){var n=this.getLastExplicitRuleShortName();return(0,Gi.getKeyForAutomaticLookahead)(n,e,r)},t.prototype.getLaFuncFromCache=function(e){},t.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},t.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},t.prototype.setLaFuncCache=function(e,r){},t.prototype.setLaFuncCacheUsingMap=function(e,r){this.lookAheadFuncsCache.set(e,r)},t.prototype.setLaFuncUsingObj=function(e,r){this.lookAheadFuncsCache[e]=r},t}();Kf.LooksAhead=iH});var Zx=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.addNoneTerminalToCst=gi.addTerminalToCst=gi.setNodeLocationFull=gi.setNodeLocationOnlyOffset=void 0;function oH(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}gi.setNodeLocationOnlyOffset=oH;function aH(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)}gi.setNodeLocationFull=aH;function sH(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}gi.addTerminalToCst=sH;function uH(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}gi.addNoneTerminalToCst=uH});var fv=b(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.defineNameProp=mo.functionName=mo.classNameFromInstance=void 0;var lH=$e();function cH(t){return Qx(t.constructor)}mo.classNameFromInstance=cH;var Jx="name";function Qx(t){var e=t.name;return e||"anonymous"}mo.functionName=Qx;function fH(t,e){var r=Object.getOwnPropertyDescriptor(t,Jx);return(0,lH.isUndefined)(r)||r.configurable?(Object.defineProperty(t,Jx,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}mo.defineNameProp=fH});var iw=b(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.validateRedundantMethods=ur.validateMissingCstMethods=ur.validateVisitor=ur.CstVisitorDefinitionError=ur.createBaseVisitorConstructorWithDefaults=ur.createBaseSemanticVisitorConstructor=ur.defaultVisit=void 0;var cn=$e(),Su=fv();function ew(t,e){for(var r=(0,cn.keys)(t),n=r.length,i=0;i<n;i++)for(var o=r[i],a=t[o],s=a.length,u=0;u<s;u++){var l=a[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}ur.defaultVisit=ew;function dH(t,e){var r=function(){};(0,Su.defineNameProp)(r,t+"BaseSemantics");var n={visit:function(i,o){if((0,cn.isArray)(i)&&(i=i[0]),!(0,cn.isUndefined)(i))return this[i.name](i.children,o)},validateVisitor:function(){var i=tw(this,e);if(!(0,cn.isEmpty)(i)){var o=(0,cn.map)(i,function(a){return a.msg});throw Error("Errors Detected in CST Visitor <"+(0,Su.functionName)(this.constructor)+`>:
3680
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return i},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var e;t.topLevelRule instanceof Jy.Rule?e=t.topLevelRule.name:e=t.topLevelRule;var r="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return r}}});var Tx=b(po=>{"use strict";var hU=po&&po.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(po,"__esModule",{value:!0});po.GastRefResolverVisitor=po.resolveGrammar=void 0;var mU=Kr(),vx=$e(),gU=Za();function yU(t,e){var r=new _x(t,e);return r.resolveRefs(),r.errors}po.resolveGrammar=yU;var _x=function(t){hU(e,t);function e(r,n){var i=t.call(this)||this;return i.nameToTopRule=r,i.errMsgProvider=n,i.errors=[],i}return e.prototype.resolveRefs=function(){var r=this;(0,vx.forEach)((0,vx.values)(this.nameToTopRule),function(n){r.currTopLevel=n,n.accept(r)})},e.prototype.visitNonTerminal=function(r){var n=this.nameToTopRule[r.nonTerminalName];if(n)r.referencedRule=n;else{var i=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:i,type:mU.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},e}(gU.GAstVisitor);po.GastRefResolverVisitor=_x});var Eu=b(kt=>{"use strict";var zo=kt&&kt.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(kt,"__esModule",{value:!0});kt.nextPossibleTokensAfter=kt.possiblePathsFrom=kt.NextTerminalAfterAtLeastOneSepWalker=kt.NextTerminalAfterAtLeastOneWalker=kt.NextTerminalAfterManySepWalker=kt.NextTerminalAfterManyWalker=kt.AbstractNextTerminalAfterProductionWalker=kt.NextAfterTokenWalker=kt.AbstractNextPossibleTokensWalker=void 0;var Rx=Mf(),ke=$e(),vU=Xy(),Re=Lr(),bx=function(t){zo(e,t);function e(r,n){var i=t.call(this)||this;return i.topProd=r,i.path=n,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return e.prototype.startWalking=function(){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=(0,ke.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,ke.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(r,n){n===void 0&&(n=[]),this.found||t.prototype.walk.call(this,r,n)},e.prototype.walkProdRef=function(r,n,i){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var o=n.concat(i);this.updateExpectedNext(),this.walk(r.referencedRule,o)}},e.prototype.updateExpectedNext=function(){(0,ke.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Rx.RestWalker);kt.AbstractNextPossibleTokensWalker=bx;var _U=function(t){zo(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.path=n,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return e.prototype.walkTerminal=function(r,n,i){if(this.isAtEndOfPath&&r.terminalType.name===this.nextTerminalName&&r.idx===this.nextTerminalOccurrence&&!this.found){var o=n.concat(i),a=new Re.Alternative({definition:o});this.possibleTokTypes=(0,vU.first)(a),this.found=!0}},e}(bx);kt.NextAfterTokenWalker=_U;var Au=function(t){zo(e,t);function e(r,n){var i=t.call(this)||this;return i.topRule=r,i.occurrence=n,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(Rx.RestWalker);kt.AbstractNextTerminalAfterProductionWalker=Au;var TU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkMany=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkMany.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterManyWalker=TU;var RU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkManySep=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkManySep.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterManySepWalker=RU;var bU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkAtLeastOne.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterAtLeastOneWalker=bU;var AU=function(t){zo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(r,n,i){if(r.idx===this.occurrence){var o=(0,ke.first)(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof Re.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else t.prototype.walkAtLeastOneSep.call(this,r,n,i)},e}(Au);kt.NextTerminalAfterAtLeastOneSepWalker=AU;function Ax(t,e,r){r===void 0&&(r=[]),r=(0,ke.cloneArr)(r);var n=[],i=0;function o(l){return l.concat((0,ke.drop)(t,i+1))}function a(l){var c=Ax(o(l),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){var s=t[i];if(s instanceof Re.Alternative)return a(s.definition);if(s instanceof Re.NonTerminal)return a(s.definition);if(s instanceof Re.Option)n=a(s.definition);else if(s instanceof Re.RepetitionMandatory){var u=s.definition.concat([new Re.Repetition({definition:s.definition})]);return a(u)}else if(s instanceof Re.RepetitionMandatoryWithSeparator){var u=[new Re.Alternative({definition:s.definition}),new Re.Repetition({definition:[new Re.Terminal({terminalType:s.separator})].concat(s.definition)})];return a(u)}else if(s instanceof Re.RepetitionWithSeparator){var u=s.definition.concat([new Re.Repetition({definition:[new Re.Terminal({terminalType:s.separator})].concat(s.definition)})]);n=a(u)}else if(s instanceof Re.Repetition){var u=s.definition.concat([new Re.Repetition({definition:s.definition})]);n=a(u)}else{if(s instanceof Re.Alternation)return(0,ke.forEach)(s.definition,function(l){(0,ke.isEmpty)(l.definition)===!1&&(n=a(l.definition))}),n;if(s instanceof Re.Terminal)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:(0,ke.drop)(t,i)}),n}kt.possiblePathsFrom=Ax;function EU(t,e,r,n){var i="EXIT_NONE_TERMINAL",o=[i],a="EXIT_ALTERNATIVE",s=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!(0,ke.isEmpty)(f);){var p=f.pop();if(p===a){s&&(0,ke.last)(f).idx<=l&&f.pop();continue}var h=p.def,d=p.idx,g=p.ruleStack,C=p.occurrenceStack;if(!(0,ke.isEmpty)(h)){var x=h[0];if(x===i){var T={idx:d,def:(0,ke.drop)(h),ruleStack:(0,ke.dropRight)(g),occurrenceStack:(0,ke.dropRight)(C)};f.push(T)}else if(x instanceof Re.Terminal)if(d<u-1){var v=d+1,k=e[v];if(r(k,x.terminalType)){var T={idx:v,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push(T)}}else if(d===u-1)c.push({nextTokenType:x.terminalType,nextTokenOccurrence:x.idx,ruleStack:g,occurrenceStack:C}),s=!0;else throw Error("non exhaustive match");else if(x instanceof Re.NonTerminal){var j=(0,ke.cloneArr)(g);j.push(x.nonTerminalName);var O=(0,ke.cloneArr)(C);O.push(x.idx);var T={idx:d,def:x.definition.concat(o,(0,ke.drop)(h)),ruleStack:j,occurrenceStack:O};f.push(T)}else if(x instanceof Re.Option){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var X={idx:d,def:x.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.RepetitionMandatory){var J=new Re.Repetition({definition:x.definition,idx:x.idx}),le=x.definition.concat([J],(0,ke.drop)(h)),T={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(T)}else if(x instanceof Re.RepetitionMandatoryWithSeparator){var pe=new Re.Terminal({terminalType:x.separator}),J=new Re.Repetition({definition:[pe].concat(x.definition),idx:x.idx}),le=x.definition.concat([J],(0,ke.drop)(h)),T={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(T)}else if(x instanceof Re.RepetitionWithSeparator){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var pe=new Re.Terminal({terminalType:x.separator}),G=new Re.Repetition({definition:[pe].concat(x.definition),idx:x.idx}),le=x.definition.concat([G],(0,ke.drop)(h)),X={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.Repetition){var $={idx:d,def:(0,ke.drop)(h),ruleStack:g,occurrenceStack:C};f.push($),f.push(a);var G=new Re.Repetition({definition:x.definition,idx:x.idx}),le=x.definition.concat([G],(0,ke.drop)(h)),X={idx:d,def:le,ruleStack:g,occurrenceStack:C};f.push(X)}else if(x instanceof Re.Alternation)for(var I=x.definition.length-1;I>=0;I--){var U=x.definition[I],z={idx:d,def:U.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C};f.push(z),f.push(a)}else if(x instanceof Re.Alternative)f.push({idx:d,def:x.definition.concat((0,ke.drop)(h)),ruleStack:g,occurrenceStack:C});else if(x instanceof Re.Rule)f.push(CU(x,d,g,C));else throw Error("non exhaustive match")}}return c}kt.nextPossibleTokensAfter=EU;function CU(t,e,r,n){var i=(0,ke.cloneArr)(r);i.push(t.name);var o=(0,ke.cloneArr)(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}});var Cu=b(We=>{"use strict";var xx=We&&We.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(We,"__esModule",{value:!0});We.areTokenCategoriesNotUsed=We.isStrictPrefixOfPath=We.containsPath=We.getLookaheadPathsForOptionalProd=We.getLookaheadPathsForOr=We.lookAheadSequenceFromAlternatives=We.buildSingleAlternativeLookaheadFunction=We.buildAlternativesLookAheadFunc=We.buildLookaheadFuncForOptionalProd=We.buildLookaheadFuncForOr=We.getProdType=We.PROD_TYPE=void 0;var Qe=$e(),Ex=Eu(),xU=Mf(),Uf=Xa(),ho=Lr(),wU=Za(),Kt;(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"})(Kt=We.PROD_TYPE||(We.PROD_TYPE={}));function SU(t){if(t instanceof ho.Option)return Kt.OPTION;if(t instanceof ho.Repetition)return Kt.REPETITION;if(t instanceof ho.RepetitionMandatory)return Kt.REPETITION_MANDATORY;if(t instanceof ho.RepetitionMandatoryWithSeparator)return Kt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ho.RepetitionWithSeparator)return Kt.REPETITION_WITH_SEPARATOR;if(t instanceof ho.Alternation)return Kt.ALTERNATION;throw Error("non exhaustive match")}We.getProdType=SU;function kU(t,e,r,n,i,o){var a=Sx(t,e,r),s=tv(a)?Uf.tokenStructuredMatcherNoCategories:Uf.tokenStructuredMatcher;return o(a,n,s,i)}We.buildLookaheadFuncForOr=kU;function PU(t,e,r,n,i,o){var a=kx(t,e,i,r),s=tv(a)?Uf.tokenStructuredMatcherNoCategories:Uf.tokenStructuredMatcher;return o(a[0],s,n)}We.buildLookaheadFuncForOptionalProd=PU;function DU(t,e,r,n){var i=t.length,o=(0,Qe.every)(t,function(u){return(0,Qe.every)(u,function(l){return l.length===1})});if(e)return function(u){for(var l=(0,Qe.map)(u,function(v){return v.GATE}),c=0;c<i;c++){var f=t[c],p=f.length,h=l[c];if(h!==void 0&&h.call(this)===!1)continue;e:for(var d=0;d<p;d++){for(var g=f[d],C=g.length,x=0;x<C;x++){var T=this.LA(x+1);if(r(T,g[x])===!1)continue e}return c}}};if(o&&!n){var a=(0,Qe.map)(t,function(u){return(0,Qe.flatten)(u)}),s=(0,Qe.reduce)(a,function(u,l,c){return(0,Qe.forEach)(l,function(f){(0,Qe.has)(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),(0,Qe.forEach)(f.categoryMatches,function(p){(0,Qe.has)(u,p)||(u[p]=c)})}),u},[]);return function(){var u=this.LA(1);return s[u.tokenTypeIdx]}}else return function(){for(var u=0;u<i;u++){var l=t[u],c=l.length;e:for(var f=0;f<c;f++){for(var p=l[f],h=p.length,d=0;d<h;d++){var g=this.LA(d+1);if(r(g,p[d])===!1)continue e}return u}}}}We.buildAlternativesLookAheadFunc=DU;function NU(t,e,r){var n=(0,Qe.every)(t,function(l){return l.length===1}),i=t.length;if(n&&!r){var o=(0,Qe.flatten)(t);if(o.length===1&&(0,Qe.isEmpty)(o[0].categoryMatches)){var a=o[0],s=a.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{var u=(0,Qe.reduce)(o,function(l,c,f){return l[c.tokenTypeIdx]=!0,(0,Qe.forEach)(c.categoryMatches,function(p){l[p]=!0}),l},[]);return function(){var l=this.LA(1);return u[l.tokenTypeIdx]===!0}}}else return function(){e:for(var l=0;l<i;l++){for(var c=t[l],f=c.length,p=0;p<f;p++){var h=this.LA(p+1);if(e(h,c[p])===!1)continue e}return!0}return!1}}We.buildSingleAlternativeLookaheadFunction=NU;var OU=function(t){xx(e,t);function e(r,n,i){var o=t.call(this)||this;return o.topProd=r,o.targetOccurrence=n,o.targetProdType=i,o}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},e.prototype.checkIsTarget=function(r,n,i,o){return r.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=i.concat(o),!0):!1},e.prototype.walkOption=function(r,n,i){this.checkIsTarget(r,Kt.OPTION,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkAtLeastOne=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_MANDATORY,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkAtLeastOneSep=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_MANDATORY_WITH_SEPARATOR,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkMany=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION,n,i)||t.prototype.walkOption.call(this,r,n,i)},e.prototype.walkManySep=function(r,n,i){this.checkIsTarget(r,Kt.REPETITION_WITH_SEPARATOR,n,i)||t.prototype.walkOption.call(this,r,n,i)},e}(xU.RestWalker),wx=function(t){xx(e,t);function e(r,n,i){var o=t.call(this)||this;return o.targetOccurrence=r,o.targetProdType=n,o.targetRef=i,o.result=[],o}return e.prototype.checkIsTarget=function(r,n){r.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||r===this.targetRef)&&(this.result=r.definition)},e.prototype.visitOption=function(r){this.checkIsTarget(r,Kt.OPTION)},e.prototype.visitRepetition=function(r){this.checkIsTarget(r,Kt.REPETITION)},e.prototype.visitRepetitionMandatory=function(r){this.checkIsTarget(r,Kt.REPETITION_MANDATORY)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.checkIsTarget(r,Kt.REPETITION_MANDATORY_WITH_SEPARATOR)},e.prototype.visitRepetitionWithSeparator=function(r){this.checkIsTarget(r,Kt.REPETITION_WITH_SEPARATOR)},e.prototype.visitAlternation=function(r){this.checkIsTarget(r,Kt.ALTERNATION)},e}(wU.GAstVisitor);function Cx(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}function Qy(t){for(var e=[""],r=0;r<t.length;r++){for(var n=t[r],i=[],o=0;o<e.length;o++){var a=e[o];i.push(a+"_"+n.tokenTypeIdx);for(var s=0;s<n.categoryMatches.length;s++){var u="_"+n.categoryMatches[s];i.push(a+u)}}e=i}return e}function IU(t,e,r){for(var n=0;n<t.length;n++)if(n!==r)for(var i=t[n],o=0;o<e.length;o++){var a=e[o];if(i[a]===!0)return!1}return!0}function ev(t,e){for(var r=(0,Qe.map)(t,function(c){return(0,Ex.possiblePathsFrom)([c],1)}),n=Cx(r.length),i=(0,Qe.map)(r,function(c){var f={};return(0,Qe.forEach)(c,function(p){var h=Qy(p.partialPath);(0,Qe.forEach)(h,function(d){f[d]=!0})}),f}),o=r,a=1;a<=e;a++){var s=o;o=Cx(s.length);for(var u=function(c){for(var f=s[c],p=0;p<f.length;p++){var h=f[p].partialPath,d=f[p].suffixDef,g=Qy(h),C=IU(i,g,c);if(C||(0,Qe.isEmpty)(d)||h.length===e){var x=n[c];if(Px(x,h)===!1){x.push(h);for(var T=0;T<g.length;T++){var v=g[T];i[c][v]=!0}}}else{var k=(0,Ex.possiblePathsFrom)(d,a+1,h);o[c]=o[c].concat(k),(0,Qe.forEach)(k,function(j){var O=Qy(j.partialPath);(0,Qe.forEach)(O,function($){i[c][$]=!0})})}}},l=0;l<s.length;l++)u(l)}return n}We.lookAheadSequenceFromAlternatives=ev;function Sx(t,e,r,n){var i=new wx(t,Kt.ALTERNATION,n);return e.accept(i),ev(i.result,r)}We.getLookaheadPathsForOr=Sx;function kx(t,e,r,n){var i=new wx(t,r);e.accept(i);var o=i.result,a=new OU(e,t,r),s=a.startWalking(),u=new ho.Alternative({definition:o}),l=new ho.Alternative({definition:s});return ev([u,l],n)}We.getLookaheadPathsForOptionalProd=kx;function Px(t,e){e:for(var r=0;r<t.length;r++){var n=t[r];if(n.length===e.length){for(var i=0;i<n.length;i++){var o=e[i],a=n[i],s=o===a||a.categoryMatchesMap[o.tokenTypeIdx]!==void 0;if(s===!1)continue e}return!0}}return!1}We.containsPath=Px;function $U(t,e){return t.length<e.length&&(0,Qe.every)(t,function(r,n){var i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}We.isStrictPrefixOfPath=$U;function tv(t){return(0,Qe.every)(t,function(e){return(0,Qe.every)(e,function(r){return(0,Qe.every)(r,function(n){return(0,Qe.isEmpty)(n.categoryMatches)})})})}We.areTokenCategoriesNotUsed=tv});var sv=b(Ue=>{"use strict";var rv=Ue&&Ue.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkPrefixAlternativesAmbiguities=Ue.validateSomeNonEmptyLookaheadPath=Ue.validateTooManyAlts=Ue.RepetionCollector=Ue.validateAmbiguousAlternationAlternatives=Ue.validateEmptyOrAlternative=Ue.getFirstNoneTerminal=Ue.validateNoLeftRecursion=Ue.validateRuleIsOverridden=Ue.validateRuleDoesNotAlreadyExist=Ue.OccurrenceValidationCollector=Ue.identifyProductionForDuplicates=Ue.validateGrammar=void 0;var Ke=$e(),gt=$e(),mi=Kr(),nv=Ru(),Qa=Cu(),MU=Eu(),Hn=Lr(),iv=Za();function LU(t,e,r,n,i){var o=Ke.map(t,function(h){return FU(h,n)}),a=Ke.map(t,function(h){return ov(h,h,n)}),s=[],u=[],l=[];(0,gt.every)(a,gt.isEmpty)&&(s=(0,gt.map)(t,function(h){return $x(h,n)}),u=(0,gt.map)(t,function(h){return Mx(h,e,n)}),l=qx(t,e,n));var c=GU(t,r,n),f=(0,gt.map)(t,function(h){return Fx(h,n)}),p=(0,gt.map)(t,function(h){return Ix(h,t,i,n)});return Ke.flatten(o.concat(l,a,s,u,c,f,p))}Ue.validateGrammar=LU;function FU(t,e){var r=new Ox;t.accept(r);var n=r.allProductions,i=Ke.groupBy(n,Dx),o=Ke.pick(i,function(s){return s.length>1}),a=Ke.map(Ke.values(o),function(s){var u=Ke.first(s),l=e.buildDuplicateFoundError(t,s),c=(0,nv.getProductionDslName)(u),f={message:l,type:mi.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=Nx(u);return p&&(f.parameter=p),f});return a}function Dx(t){return(0,nv.getProductionDslName)(t)+"_#_"+t.idx+"_#_"+Nx(t)}Ue.identifyProductionForDuplicates=Dx;function Nx(t){return t instanceof Hn.Terminal?t.terminalType.name:t instanceof Hn.NonTerminal?t.nonTerminalName:""}var Ox=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitNonTerminal=function(r){this.allProductions.push(r)},e.prototype.visitOption=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e.prototype.visitAlternation=function(r){this.allProductions.push(r)},e.prototype.visitTerminal=function(r){this.allProductions.push(r)},e}(iv.GAstVisitor);Ue.OccurrenceValidationCollector=Ox;function Ix(t,e,r,n){var i=[],o=(0,gt.reduce)(e,function(s,u){return u.name===t.name?s+1:s},0);if(o>1){var a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:mi.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}Ue.validateRuleDoesNotAlreadyExist=Ix;function qU(t,e,r){var n=[],i;return Ke.contains(e,t)||(i="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",n.push({message:i,type:mi.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),n}Ue.validateRuleIsOverridden=qU;function ov(t,e,r,n){n===void 0&&(n=[]);var i=[],o=xu(e.definition);if(Ke.isEmpty(o))return[];var a=t.name,s=Ke.contains(o,t);s&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:mi.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:a});var u=Ke.difference(o,n.concat([t])),l=Ke.map(u,function(c){var f=Ke.cloneArr(n);return f.push(c),ov(t,c,r,f)});return i.concat(Ke.flatten(l))}Ue.validateNoLeftRecursion=ov;function xu(t){var e=[];if(Ke.isEmpty(t))return e;var r=Ke.first(t);if(r instanceof Hn.NonTerminal)e.push(r.referencedRule);else if(r instanceof Hn.Alternative||r instanceof Hn.Option||r instanceof Hn.RepetitionMandatory||r instanceof Hn.RepetitionMandatoryWithSeparator||r instanceof Hn.RepetitionWithSeparator||r instanceof Hn.Repetition)e=e.concat(xu(r.definition));else if(r instanceof Hn.Alternation)e=Ke.flatten(Ke.map(r.definition,function(a){return xu(a.definition)}));else if(!(r instanceof Hn.Terminal))throw Error("non exhaustive match");var n=(0,nv.isOptionalProd)(r),i=t.length>1;if(n&&i){var o=Ke.drop(t);return e.concat(xu(o))}else return e}Ue.getFirstNoneTerminal=xu;var av=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.alternations=[],r}return e.prototype.visitAlternation=function(r){this.alternations.push(r)},e}(iv.GAstVisitor);function $x(t,e){var r=new av;t.accept(r);var n=r.alternations,i=Ke.reduce(n,function(o,a){var s=Ke.dropRight(a.definition),u=Ke.map(s,function(l,c){var f=(0,MU.nextPossibleTokensAfter)([l],[],null,1);return Ke.isEmpty(f)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:c}),type:mi.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:c+1}:null});return o.concat(Ke.compact(u))},[]);return i}Ue.validateEmptyOrAlternative=$x;function Mx(t,e,r){var n=new av;t.accept(n);var i=n.alternations;i=(0,gt.reject)(i,function(a){return a.ignoreAmbiguities===!0});var o=Ke.reduce(i,function(a,s){var u=s.idx,l=s.maxLookahead||e,c=(0,Qa.getLookaheadPathsForOr)(u,t,l,s),f=jU(c,s,t,r),p=jx(c,s,t,r);return a.concat(f,p)},[]);return o}Ue.validateAmbiguousAlternationAlternatives=Mx;var Lx=function(t){rv(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e}(iv.GAstVisitor);Ue.RepetionCollector=Lx;function Fx(t,e){var r=new av;t.accept(r);var n=r.alternations,i=Ke.reduce(n,function(o,a){return a.definition.length>255&&o.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:mi.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}),o},[]);return i}Ue.validateTooManyAlts=Fx;function qx(t,e,r){var n=[];return(0,gt.forEach)(t,function(i){var o=new Lx;i.accept(o);var a=o.allProductions;(0,gt.forEach)(a,function(s){var u=(0,Qa.getProdType)(s),l=s.maxLookahead||e,c=s.idx,f=(0,Qa.getLookaheadPathsForOptionalProd)(c,i,u,l),p=f[0];if((0,gt.isEmpty)((0,gt.flatten)(p))){var h=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:h,type:mi.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}Ue.validateSomeNonEmptyLookaheadPath=qx;function jU(t,e,r,n){var i=[],o=(0,gt.reduce)(t,function(s,u,l){return e.definition[l].ignoreAmbiguities===!0||(0,gt.forEach)(u,function(c){var f=[l];(0,gt.forEach)(t,function(p,h){l!==h&&(0,Qa.containsPath)(p,c)&&e.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!(0,Qa.containsPath)(i,c)&&(i.push(c),s.push({alts:f,path:c}))}),s},[]),a=Ke.map(o,function(s){var u=(0,gt.map)(s.alts,function(c){return c+1}),l=n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:s.path});return{message:l,type:mi.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:[s.alts]}});return a}function jx(t,e,r,n){var i=[],o=(0,gt.reduce)(t,function(a,s,u){var l=(0,gt.map)(s,function(c){return{idx:u,path:c}});return a.concat(l)},[]);return(0,gt.forEach)(o,function(a){var s=e.definition[a.idx];if(s.ignoreAmbiguities!==!0){var u=a.idx,l=a.path,c=(0,gt.findAll)(o,function(p){return e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&(0,Qa.isStrictPrefixOfPath)(p.path,l)}),f=(0,gt.map)(c,function(p){var h=[p.idx+1,u+1],d=e.idx===0?"":e.idx,g=n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:h,prefixPath:p.path});return{message:g,type:mi.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:d,alternatives:h}});i=i.concat(f)}}),i}Ue.checkPrefixAlternativesAmbiguities=jx;function GU(t,e,r){var n=[],i=(0,gt.map)(e,function(o){return o.name});return(0,gt.forEach)(t,function(o){var a=o.name;if((0,gt.contains)(i,a)){var s=r.buildNamespaceConflictError(o);n.push({message:s,type:mi.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}});var Ux=b(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.validateGrammar=es.resolveGrammar=void 0;var uv=$e(),UU=Tx(),HU=sv(),Gx=bu();function BU(t){t=(0,uv.defaults)(t,{errMsgProvider:Gx.defaultGrammarResolverErrorProvider});var e={};return(0,uv.forEach)(t.rules,function(r){e[r.name]=r}),(0,UU.resolveGrammar)(e,t.errMsgProvider)}es.resolveGrammar=BU;function WU(t){return t=(0,uv.defaults)(t,{errMsgProvider:Gx.defaultGrammarValidatorErrorProvider}),(0,HU.validateGrammar)(t.rules,t.maxLookahead,t.tokenTypes,t.errMsgProvider,t.grammarName)}es.validateGrammar=WU});var ts=b(qr=>{"use strict";var wu=qr&&qr.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(qr,"__esModule",{value:!0});qr.EarlyExitException=qr.NotAllInputParsedException=qr.NoViableAltException=qr.MismatchedTokenException=qr.isRecognitionException=void 0;var KU=$e(),Hx="MismatchedTokenException",Bx="NoViableAltException",Wx="EarlyExitException",Kx="NotAllInputParsedException",zx=[Hx,Bx,Wx,Kx];Object.freeze(zx);function zU(t){return(0,KU.contains)(zx,t.name)}qr.isRecognitionException=zU;var Hf=function(t){wu(e,t);function e(r,n){var i=this.constructor,o=t.call(this,r)||this;return o.token=n,o.resyncedTokens=[],Object.setPrototypeOf(o,i.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,o.constructor),o}return e}(Error),VU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Hx,o}return e}(Hf);qr.MismatchedTokenException=VU;var YU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Bx,o}return e}(Hf);qr.NoViableAltException=YU;var XU=function(t){wu(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name=Kx,i}return e}(Hf);qr.NotAllInputParsedException=XU;var ZU=function(t){wu(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return o.previousToken=i,o.name=Wx,o}return e}(Hf);qr.EarlyExitException=ZU});var cv=b(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.attemptInRepetitionRecovery=Tr.Recoverable=Tr.InRuleRecoveryException=Tr.IN_RULE_RECOVERY_EXCEPTION=Tr.EOF_FOLLOW_KEY=void 0;var Bf=fo(),ln=$e(),JU=ts(),QU=Zy(),eH=Kr();Tr.EOF_FOLLOW_KEY={};Tr.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function lv(t){this.name=Tr.IN_RULE_RECOVERY_EXCEPTION,this.message=t}Tr.InRuleRecoveryException=lv;lv.prototype=Error.prototype;var tH=function(){function t(){}return t.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,ln.has)(e,"recoveryEnabled")?e.recoveryEnabled:eH.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Vx)},t.prototype.getTokenToInsert=function(e){var r=(0,Bf.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r},t.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},t.prototype.tryInRepetitionRecovery=function(e,r,n,i){for(var o=this,a=this.findReSyncTokenType(),s=this.exportLexerState(),u=[],l=!1,c=this.LA(1),f=this.LA(1),p=function(){var h=o.LA(0),d=o.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:h,ruleName:o.getCurrRuleFullName()}),g=new JU.MismatchedTokenException(d,c,o.LA(0));g.resyncedTokens=(0,ln.dropRight)(u),o.SAVE_ERROR(g)};!l;)if(this.tokenMatcher(f,i)){p();return}else if(n.call(this)){p(),e.apply(this,r);return}else this.tokenMatcher(f,a)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,u));this.importLexerState(s)},t.prototype.shouldInRepetitionRecoveryBeTried=function(e,r,n){return!(n===!1||e===void 0||r===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))},t.prototype.getFollowsForInRuleRecovery=function(e,r){var n=this.getCurrentGrammarPath(e,r),i=this.getNextPossibleTokenTypes(n);return i},t.prototype.tryInRuleRecovery=function(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r)){var n=this.getTokenToInsert(e);return n}if(this.canRecoverWithSingleTokenDeletion(e)){var i=this.SKIP_TOKEN();return this.consumeToken(),i}throw new lv("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)},t.prototype.canRecoverWithSingleTokenInsertion=function(e,r){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,ln.isEmpty)(r))return!1;var i=this.LA(1),o=(0,ln.find)(r,function(a){return n.tokenMatcher(i,a)})!==void 0;return o},t.prototype.canRecoverWithSingleTokenDeletion=function(e){var r=this.tokenMatcher(this.LA(2),e);return r},t.prototype.isInCurrentRuleReSyncSet=function(e){var r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return(0,ln.contains)(n,e)},t.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),r=this.LA(1),n=2;;){var i=r.tokenType;if((0,ln.contains)(e,i))return i;r=this.LA(n),n++}},t.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Tr.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}},t.prototype.buildFullFollowKeyStack=function(){var e=this,r=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,ln.map)(r,function(i,o){return o===0?Tr.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(i),idxInCallingRule:n[o],inRule:e.shortRuleNameToFullName(r[o-1])}})},t.prototype.flattenFollowSet=function(){var e=this,r=(0,ln.map)(this.buildFullFollowKeyStack(),function(n){return e.getFollowSetFromFollowKey(n)});return(0,ln.flatten)(r)},t.prototype.getFollowSetFromFollowKey=function(e){if(e===Tr.EOF_FOLLOW_KEY)return[Bf.EOF];var r=e.ruleName+e.idxInCallingRule+QU.IN+e.inRule;return this.resyncFollows[r]},t.prototype.addToResyncTokens=function(e,r){return this.tokenMatcher(e,Bf.EOF)||r.push(e),r},t.prototype.reSyncTo=function(e){for(var r=[],n=this.LA(1);this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return(0,ln.dropRight)(r)},t.prototype.attemptInRepetitionRecovery=function(e,r,n,i,o,a,s){},t.prototype.getCurrentGrammarPath=function(e,r){var n=this.getHumanReadableRuleStack(),i=(0,ln.cloneArr)(this.RULE_OCCURRENCE_STACK),o={ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r};return o},t.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,ln.map)(this.RULE_STACK,function(r){return e.shortRuleNameToFullName(r)})},t}();Tr.Recoverable=tH;function Vx(t,e,r,n,i,o,a){var s=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[s];if(u===void 0){var l=this.getCurrRuleFullName(),c=this.getGAstProductions()[l],f=new o(c,i);u=f.startWalking(),this.firstAfterRepMap[s]=u}var p=u.token,h=u.occurrence,d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&p===void 0&&(p=Bf.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(p,h,a)&&this.tryInRepetitionRecovery(t,e,r,p)}Tr.attemptInRepetitionRecovery=Vx});var Wf=b(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.getKeyForAutomaticLookahead=qe.AT_LEAST_ONE_SEP_IDX=qe.MANY_SEP_IDX=qe.AT_LEAST_ONE_IDX=qe.MANY_IDX=qe.OPTION_IDX=qe.OR_IDX=qe.BITS_FOR_ALT_IDX=qe.BITS_FOR_RULE_IDX=qe.BITS_FOR_OCCURRENCE_IDX=qe.BITS_FOR_METHOD_TYPE=void 0;qe.BITS_FOR_METHOD_TYPE=4;qe.BITS_FOR_OCCURRENCE_IDX=8;qe.BITS_FOR_RULE_IDX=12;qe.BITS_FOR_ALT_IDX=8;qe.OR_IDX=1<<qe.BITS_FOR_OCCURRENCE_IDX;qe.OPTION_IDX=2<<qe.BITS_FOR_OCCURRENCE_IDX;qe.MANY_IDX=3<<qe.BITS_FOR_OCCURRENCE_IDX;qe.AT_LEAST_ONE_IDX=4<<qe.BITS_FOR_OCCURRENCE_IDX;qe.MANY_SEP_IDX=5<<qe.BITS_FOR_OCCURRENCE_IDX;qe.AT_LEAST_ONE_SEP_IDX=6<<qe.BITS_FOR_OCCURRENCE_IDX;function rH(t,e,r){return r|e|t}qe.getKeyForAutomaticLookahead=rH;var K9=32-qe.BITS_FOR_ALT_IDX});var Xx=b(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.LooksAhead=void 0;var ji=Cu(),Bn=$e(),Yx=Kr(),Gi=Wf(),Vo=Ru(),nH=function(){function t(){}return t.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,Bn.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Yx.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,Bn.has)(e,"maxLookahead")?e.maxLookahead:Yx.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,Bn.isES2015MapSupported)()?new Map:[],(0,Bn.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(e){var r=this;(0,Bn.forEach)(e,function(n){r.TRACE_INIT(n.name+" Rule Lookahead",function(){var i=(0,Vo.collectMethods)(n),o=i.alternation,a=i.repetition,s=i.option,u=i.repetitionMandatory,l=i.repetitionMandatoryWithSeparator,c=i.repetitionWithSeparator;(0,Bn.forEach)(o,function(f){var p=f.idx===0?"":f.idx;r.TRACE_INIT(""+(0,Vo.getProductionDslName)(f)+p,function(){var h=(0,ji.buildLookaheadFuncForOr)(f.idx,n,f.maxLookahead||r.maxLookahead,f.hasPredicates,r.dynamicTokensEnabled,r.lookAheadBuilderForAlternatives),d=(0,Gi.getKeyForAutomaticLookahead)(r.fullRuleNameToShort[n.name],Gi.OR_IDX,f.idx);r.setLaFuncCache(d,h)})}),(0,Bn.forEach)(a,function(f){r.computeLookaheadFunc(n,f.idx,Gi.MANY_IDX,ji.PROD_TYPE.REPETITION,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(s,function(f){r.computeLookaheadFunc(n,f.idx,Gi.OPTION_IDX,ji.PROD_TYPE.OPTION,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(u,function(f){r.computeLookaheadFunc(n,f.idx,Gi.AT_LEAST_ONE_IDX,ji.PROD_TYPE.REPETITION_MANDATORY,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(l,function(f){r.computeLookaheadFunc(n,f.idx,Gi.AT_LEAST_ONE_SEP_IDX,ji.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,f.maxLookahead,(0,Vo.getProductionDslName)(f))}),(0,Bn.forEach)(c,function(f){r.computeLookaheadFunc(n,f.idx,Gi.MANY_SEP_IDX,ji.PROD_TYPE.REPETITION_WITH_SEPARATOR,f.maxLookahead,(0,Vo.getProductionDslName)(f))})})})},t.prototype.computeLookaheadFunc=function(e,r,n,i,o,a){var s=this;this.TRACE_INIT(""+a+(r===0?"":r),function(){var u=(0,ji.buildLookaheadFuncForOptionalProd)(r,e,o||s.maxLookahead,s.dynamicTokensEnabled,i,s.lookAheadBuilderForOptional),l=(0,Gi.getKeyForAutomaticLookahead)(s.fullRuleNameToShort[e.name],n,r);s.setLaFuncCache(l,u)})},t.prototype.lookAheadBuilderForOptional=function(e,r,n){return(0,ji.buildSingleAlternativeLookaheadFunction)(e,r,n)},t.prototype.lookAheadBuilderForAlternatives=function(e,r,n,i){return(0,ji.buildAlternativesLookAheadFunc)(e,r,n,i)},t.prototype.getKeyForAutomaticLookahead=function(e,r){var n=this.getLastExplicitRuleShortName();return(0,Gi.getKeyForAutomaticLookahead)(n,e,r)},t.prototype.getLaFuncFromCache=function(e){},t.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},t.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},t.prototype.setLaFuncCache=function(e,r){},t.prototype.setLaFuncCacheUsingMap=function(e,r){this.lookAheadFuncsCache.set(e,r)},t.prototype.setLaFuncUsingObj=function(e,r){this.lookAheadFuncsCache[e]=r},t}();Kf.LooksAhead=nH});var Zx=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.addNoneTerminalToCst=gi.addTerminalToCst=gi.setNodeLocationFull=gi.setNodeLocationOnlyOffset=void 0;function iH(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}gi.setNodeLocationOnlyOffset=iH;function oH(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)}gi.setNodeLocationFull=oH;function aH(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}gi.addTerminalToCst=aH;function sH(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}gi.addNoneTerminalToCst=sH});var fv=b(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.defineNameProp=mo.functionName=mo.classNameFromInstance=void 0;var uH=$e();function lH(t){return Qx(t.constructor)}mo.classNameFromInstance=lH;var Jx="name";function Qx(t){var e=t.name;return e||"anonymous"}mo.functionName=Qx;function cH(t,e){var r=Object.getOwnPropertyDescriptor(t,Jx);return(0,uH.isUndefined)(r)||r.configurable?(Object.defineProperty(t,Jx,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}mo.defineNameProp=cH});var iw=b(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.validateRedundantMethods=ur.validateMissingCstMethods=ur.validateVisitor=ur.CstVisitorDefinitionError=ur.createBaseVisitorConstructorWithDefaults=ur.createBaseSemanticVisitorConstructor=ur.defaultVisit=void 0;var cn=$e(),Su=fv();function ew(t,e){for(var r=(0,cn.keys)(t),n=r.length,i=0;i<n;i++)for(var o=r[i],a=t[o],s=a.length,u=0;u<s;u++){var l=a[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}ur.defaultVisit=ew;function fH(t,e){var r=function(){};(0,Su.defineNameProp)(r,t+"BaseSemantics");var n={visit:function(i,o){if((0,cn.isArray)(i)&&(i=i[0]),!(0,cn.isUndefined)(i))return this[i.name](i.children,o)},validateVisitor:function(){var i=tw(this,e);if(!(0,cn.isEmpty)(i)){var o=(0,cn.map)(i,function(a){return a.msg});throw Error("Errors Detected in CST Visitor <"+(0,Su.functionName)(this.constructor)+`>:
3681
3681
  `+(""+o.join(`
3682
3682
 
3683
3683
  `).replace(/\n/g,`
3684
- `)))}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}ur.createBaseSemanticVisitorConstructor=dH;function pH(t,e,r){var n=function(){};(0,Su.defineNameProp)(n,t+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,cn.forEach)(e,function(o){i[o]=ew}),n.prototype=i,n.prototype.constructor=n,n}ur.createBaseVisitorConstructorWithDefaults=pH;var dv;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(dv=ur.CstVisitorDefinitionError||(ur.CstVisitorDefinitionError={}));function tw(t,e){var r=rw(t,e),n=nw(t,e);return r.concat(n)}ur.validateVisitor=tw;function rw(t,e){var r=(0,cn.map)(e,function(n){if(!(0,cn.isFunction)(t[n]))return{msg:"Missing visitor method: <"+n+"> on "+(0,Su.functionName)(t.constructor)+" CST Visitor.",type:dv.MISSING_METHOD,methodName:n}});return(0,cn.compact)(r)}ur.validateMissingCstMethods=rw;var hH=["constructor","visit","validateVisitor"];function nw(t,e){var r=[];for(var n in t)(0,cn.isFunction)(t[n])&&!(0,cn.contains)(hH,n)&&!(0,cn.contains)(e,n)&&r.push({msg:"Redundant visitor method: <"+n+"> on "+(0,Su.functionName)(t.constructor)+` CST Visitor
3684
+ `)))}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}ur.createBaseSemanticVisitorConstructor=fH;function dH(t,e,r){var n=function(){};(0,Su.defineNameProp)(n,t+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,cn.forEach)(e,function(o){i[o]=ew}),n.prototype=i,n.prototype.constructor=n,n}ur.createBaseVisitorConstructorWithDefaults=dH;var dv;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(dv=ur.CstVisitorDefinitionError||(ur.CstVisitorDefinitionError={}));function tw(t,e){var r=rw(t,e),n=nw(t,e);return r.concat(n)}ur.validateVisitor=tw;function rw(t,e){var r=(0,cn.map)(e,function(n){if(!(0,cn.isFunction)(t[n]))return{msg:"Missing visitor method: <"+n+"> on "+(0,Su.functionName)(t.constructor)+" CST Visitor.",type:dv.MISSING_METHOD,methodName:n}});return(0,cn.compact)(r)}ur.validateMissingCstMethods=rw;var pH=["constructor","visit","validateVisitor"];function nw(t,e){var r=[];for(var n in t)(0,cn.isFunction)(t[n])&&!(0,cn.contains)(pH,n)&&!(0,cn.contains)(e,n)&&r.push({msg:"Redundant visitor method: <"+n+"> on "+(0,Su.functionName)(t.constructor)+` CST Visitor
3685
3685
  There is no Grammar Rule corresponding to this method's name.
3686
- `,type:dv.REDUNDANT_METHOD,methodName:n});return r}ur.validateRedundantMethods=nw});var aw=b(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.TreeBuilder=void 0;var rs=Zx(),Gt=$e(),ow=iw(),mH=Kr(),gH=function(){function t(){}return t.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,Gt.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:mH.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Gt.NOOP,this.cstFinallyStateUpdate=Gt.NOOP,this.cstPostTerminal=Gt.NOOP,this.cstPostNonTerminal=Gt.NOOP,this.cstPostRule=Gt.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=rs.setNodeLocationFull,this.setNodeLocationFromNode=rs.setNodeLocationFull,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=rs.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=rs.setNodeLocationOnlyOffset,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=Gt.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(e){var r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstInvocationStateUpdate=function(e,r){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},t.prototype.cstPostRuleFull=function(e){var r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(e){var r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN},t.prototype.cstPostTerminal=function(e,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,rs.addTerminalToCst)(n,r,e),this.setNodeLocationFromToken(n.location,r)},t.prototype.cstPostNonTerminal=function(e,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,rs.addNoneTerminalToCst)(n,r,e),this.setNodeLocationFromNode(n.location,e.location)},t.prototype.getBaseCstVisitorConstructor=function(){if((0,Gt.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,ow.createBaseSemanticVisitorConstructor)(this.className,(0,Gt.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,Gt.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,ow.createBaseVisitorConstructorWithDefaults)(this.className,(0,Gt.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},t.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},t.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},t}();zf.TreeBuilder=gH});var uw=b(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.LexerAdapter=void 0;var sw=Kr(),yH=function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(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},enumerable:!1,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):sw.END_OF_FILE},t.prototype.LA=function(e){var r=this.currIdx+e;return r<0||this.tokVectorLength<=r?sw.END_OF_FILE:this.tokVector[r]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(e){this.currIdx=e},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t}();Vf.LexerAdapter=yH});var cw=b(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.RecognizerApi=void 0;var lw=$e(),vH=ts(),pv=Kr(),_H=bu(),TH=sv(),RH=Lr(),bH=function(){function t(){}return t.prototype.ACTION=function(e){return e.call(this)},t.prototype.consume=function(e,r,n){return this.consumeInternal(r,e,n)},t.prototype.subrule=function(e,r,n){return this.subruleInternal(r,e,n)},t.prototype.option=function(e,r){return this.optionInternal(r,e)},t.prototype.or=function(e,r){return this.orInternal(r,e)},t.prototype.many=function(e,r){return this.manyInternal(e,r)},t.prototype.atLeastOne=function(e,r){return this.atLeastOneInternal(e,r)},t.prototype.CONSUME=function(e,r){return this.consumeInternal(e,0,r)},t.prototype.CONSUME1=function(e,r){return this.consumeInternal(e,1,r)},t.prototype.CONSUME2=function(e,r){return this.consumeInternal(e,2,r)},t.prototype.CONSUME3=function(e,r){return this.consumeInternal(e,3,r)},t.prototype.CONSUME4=function(e,r){return this.consumeInternal(e,4,r)},t.prototype.CONSUME5=function(e,r){return this.consumeInternal(e,5,r)},t.prototype.CONSUME6=function(e,r){return this.consumeInternal(e,6,r)},t.prototype.CONSUME7=function(e,r){return this.consumeInternal(e,7,r)},t.prototype.CONSUME8=function(e,r){return this.consumeInternal(e,8,r)},t.prototype.CONSUME9=function(e,r){return this.consumeInternal(e,9,r)},t.prototype.SUBRULE=function(e,r){return this.subruleInternal(e,0,r)},t.prototype.SUBRULE1=function(e,r){return this.subruleInternal(e,1,r)},t.prototype.SUBRULE2=function(e,r){return this.subruleInternal(e,2,r)},t.prototype.SUBRULE3=function(e,r){return this.subruleInternal(e,3,r)},t.prototype.SUBRULE4=function(e,r){return this.subruleInternal(e,4,r)},t.prototype.SUBRULE5=function(e,r){return this.subruleInternal(e,5,r)},t.prototype.SUBRULE6=function(e,r){return this.subruleInternal(e,6,r)},t.prototype.SUBRULE7=function(e,r){return this.subruleInternal(e,7,r)},t.prototype.SUBRULE8=function(e,r){return this.subruleInternal(e,8,r)},t.prototype.SUBRULE9=function(e,r){return this.subruleInternal(e,9,r)},t.prototype.OPTION=function(e){return this.optionInternal(e,0)},t.prototype.OPTION1=function(e){return this.optionInternal(e,1)},t.prototype.OPTION2=function(e){return this.optionInternal(e,2)},t.prototype.OPTION3=function(e){return this.optionInternal(e,3)},t.prototype.OPTION4=function(e){return this.optionInternal(e,4)},t.prototype.OPTION5=function(e){return this.optionInternal(e,5)},t.prototype.OPTION6=function(e){return this.optionInternal(e,6)},t.prototype.OPTION7=function(e){return this.optionInternal(e,7)},t.prototype.OPTION8=function(e){return this.optionInternal(e,8)},t.prototype.OPTION9=function(e){return this.optionInternal(e,9)},t.prototype.OR=function(e){return this.orInternal(e,0)},t.prototype.OR1=function(e){return this.orInternal(e,1)},t.prototype.OR2=function(e){return this.orInternal(e,2)},t.prototype.OR3=function(e){return this.orInternal(e,3)},t.prototype.OR4=function(e){return this.orInternal(e,4)},t.prototype.OR5=function(e){return this.orInternal(e,5)},t.prototype.OR6=function(e){return this.orInternal(e,6)},t.prototype.OR7=function(e){return this.orInternal(e,7)},t.prototype.OR8=function(e){return this.orInternal(e,8)},t.prototype.OR9=function(e){return this.orInternal(e,9)},t.prototype.MANY=function(e){this.manyInternal(0,e)},t.prototype.MANY1=function(e){this.manyInternal(1,e)},t.prototype.MANY2=function(e){this.manyInternal(2,e)},t.prototype.MANY3=function(e){this.manyInternal(3,e)},t.prototype.MANY4=function(e){this.manyInternal(4,e)},t.prototype.MANY5=function(e){this.manyInternal(5,e)},t.prototype.MANY6=function(e){this.manyInternal(6,e)},t.prototype.MANY7=function(e){this.manyInternal(7,e)},t.prototype.MANY8=function(e){this.manyInternal(8,e)},t.prototype.MANY9=function(e){this.manyInternal(9,e)},t.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},t.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},t.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},t.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},t.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},t.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},t.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},t.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},t.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},t.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},t.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},t.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},t.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},t.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},t.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},t.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},t.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},t.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},t.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},t.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},t.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},t.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},t.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},t.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},t.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},t.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},t.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},t.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},t.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},t.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},t.prototype.RULE=function(e,r,n){if(n===void 0&&(n=pv.DEFAULT_RULE_CONFIG),(0,lw.contains)(this.definedRulesNames,e)){var i=_H.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),o={message:i,type:pv.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var a=this.defineRule(e,r,n);return this[e]=a,a},t.prototype.OVERRIDE_RULE=function(e,r,n){n===void 0&&(n=pv.DEFAULT_RULE_CONFIG);var i=[];i=i.concat((0,TH.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(i);var o=this.defineRule(e,r,n);return this[e]=o,o},t.prototype.BACKTRACK=function(e,r){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if((0,vH.isRecognitionException)(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return(0,RH.serializeGrammar)((0,lw.values)(this.gastProductionsCache))},t}();Yf.RecognizerApi=bH});var hw=b(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.RecognizerEngine=void 0;var At=$e(),zr=Wf(),Xf=ts(),fw=Cu(),ns=Eu(),dw=Kr(),AH=cv(),pw=fo(),ku=Xa(),EH=fv(),CH=function(){function t(){}return t.prototype.initRecognizerEngine=function(e,r){if(this.className=(0,EH.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ku.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,At.has)(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
3686
+ `,type:dv.REDUNDANT_METHOD,methodName:n});return r}ur.validateRedundantMethods=nw});var aw=b(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.TreeBuilder=void 0;var rs=Zx(),Gt=$e(),ow=iw(),hH=Kr(),mH=function(){function t(){}return t.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,Gt.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:hH.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Gt.NOOP,this.cstFinallyStateUpdate=Gt.NOOP,this.cstPostTerminal=Gt.NOOP,this.cstPostNonTerminal=Gt.NOOP,this.cstPostRule=Gt.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=rs.setNodeLocationFull,this.setNodeLocationFromNode=rs.setNodeLocationFull,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=rs.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=rs.setNodeLocationOnlyOffset,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Gt.NOOP,this.setNodeLocationFromNode=Gt.NOOP,this.cstPostRule=Gt.NOOP,this.setInitialNodeLocation=Gt.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(e){var r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstInvocationStateUpdate=function(e,r){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},t.prototype.cstPostRuleFull=function(e){var r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(e){var r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN},t.prototype.cstPostTerminal=function(e,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,rs.addTerminalToCst)(n,r,e),this.setNodeLocationFromToken(n.location,r)},t.prototype.cstPostNonTerminal=function(e,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,rs.addNoneTerminalToCst)(n,r,e),this.setNodeLocationFromNode(n.location,e.location)},t.prototype.getBaseCstVisitorConstructor=function(){if((0,Gt.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,ow.createBaseSemanticVisitorConstructor)(this.className,(0,Gt.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,Gt.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,ow.createBaseVisitorConstructorWithDefaults)(this.className,(0,Gt.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},t.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},t.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},t}();zf.TreeBuilder=mH});var uw=b(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.LexerAdapter=void 0;var sw=Kr(),gH=function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(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},enumerable:!1,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):sw.END_OF_FILE},t.prototype.LA=function(e){var r=this.currIdx+e;return r<0||this.tokVectorLength<=r?sw.END_OF_FILE:this.tokVector[r]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(e){this.currIdx=e},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t}();Vf.LexerAdapter=gH});var cw=b(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.RecognizerApi=void 0;var lw=$e(),yH=ts(),pv=Kr(),vH=bu(),_H=sv(),TH=Lr(),RH=function(){function t(){}return t.prototype.ACTION=function(e){return e.call(this)},t.prototype.consume=function(e,r,n){return this.consumeInternal(r,e,n)},t.prototype.subrule=function(e,r,n){return this.subruleInternal(r,e,n)},t.prototype.option=function(e,r){return this.optionInternal(r,e)},t.prototype.or=function(e,r){return this.orInternal(r,e)},t.prototype.many=function(e,r){return this.manyInternal(e,r)},t.prototype.atLeastOne=function(e,r){return this.atLeastOneInternal(e,r)},t.prototype.CONSUME=function(e,r){return this.consumeInternal(e,0,r)},t.prototype.CONSUME1=function(e,r){return this.consumeInternal(e,1,r)},t.prototype.CONSUME2=function(e,r){return this.consumeInternal(e,2,r)},t.prototype.CONSUME3=function(e,r){return this.consumeInternal(e,3,r)},t.prototype.CONSUME4=function(e,r){return this.consumeInternal(e,4,r)},t.prototype.CONSUME5=function(e,r){return this.consumeInternal(e,5,r)},t.prototype.CONSUME6=function(e,r){return this.consumeInternal(e,6,r)},t.prototype.CONSUME7=function(e,r){return this.consumeInternal(e,7,r)},t.prototype.CONSUME8=function(e,r){return this.consumeInternal(e,8,r)},t.prototype.CONSUME9=function(e,r){return this.consumeInternal(e,9,r)},t.prototype.SUBRULE=function(e,r){return this.subruleInternal(e,0,r)},t.prototype.SUBRULE1=function(e,r){return this.subruleInternal(e,1,r)},t.prototype.SUBRULE2=function(e,r){return this.subruleInternal(e,2,r)},t.prototype.SUBRULE3=function(e,r){return this.subruleInternal(e,3,r)},t.prototype.SUBRULE4=function(e,r){return this.subruleInternal(e,4,r)},t.prototype.SUBRULE5=function(e,r){return this.subruleInternal(e,5,r)},t.prototype.SUBRULE6=function(e,r){return this.subruleInternal(e,6,r)},t.prototype.SUBRULE7=function(e,r){return this.subruleInternal(e,7,r)},t.prototype.SUBRULE8=function(e,r){return this.subruleInternal(e,8,r)},t.prototype.SUBRULE9=function(e,r){return this.subruleInternal(e,9,r)},t.prototype.OPTION=function(e){return this.optionInternal(e,0)},t.prototype.OPTION1=function(e){return this.optionInternal(e,1)},t.prototype.OPTION2=function(e){return this.optionInternal(e,2)},t.prototype.OPTION3=function(e){return this.optionInternal(e,3)},t.prototype.OPTION4=function(e){return this.optionInternal(e,4)},t.prototype.OPTION5=function(e){return this.optionInternal(e,5)},t.prototype.OPTION6=function(e){return this.optionInternal(e,6)},t.prototype.OPTION7=function(e){return this.optionInternal(e,7)},t.prototype.OPTION8=function(e){return this.optionInternal(e,8)},t.prototype.OPTION9=function(e){return this.optionInternal(e,9)},t.prototype.OR=function(e){return this.orInternal(e,0)},t.prototype.OR1=function(e){return this.orInternal(e,1)},t.prototype.OR2=function(e){return this.orInternal(e,2)},t.prototype.OR3=function(e){return this.orInternal(e,3)},t.prototype.OR4=function(e){return this.orInternal(e,4)},t.prototype.OR5=function(e){return this.orInternal(e,5)},t.prototype.OR6=function(e){return this.orInternal(e,6)},t.prototype.OR7=function(e){return this.orInternal(e,7)},t.prototype.OR8=function(e){return this.orInternal(e,8)},t.prototype.OR9=function(e){return this.orInternal(e,9)},t.prototype.MANY=function(e){this.manyInternal(0,e)},t.prototype.MANY1=function(e){this.manyInternal(1,e)},t.prototype.MANY2=function(e){this.manyInternal(2,e)},t.prototype.MANY3=function(e){this.manyInternal(3,e)},t.prototype.MANY4=function(e){this.manyInternal(4,e)},t.prototype.MANY5=function(e){this.manyInternal(5,e)},t.prototype.MANY6=function(e){this.manyInternal(6,e)},t.prototype.MANY7=function(e){this.manyInternal(7,e)},t.prototype.MANY8=function(e){this.manyInternal(8,e)},t.prototype.MANY9=function(e){this.manyInternal(9,e)},t.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},t.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},t.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},t.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},t.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},t.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},t.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},t.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},t.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},t.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},t.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},t.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},t.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},t.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},t.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},t.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},t.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},t.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},t.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},t.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},t.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},t.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},t.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},t.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},t.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},t.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},t.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},t.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},t.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},t.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},t.prototype.RULE=function(e,r,n){if(n===void 0&&(n=pv.DEFAULT_RULE_CONFIG),(0,lw.contains)(this.definedRulesNames,e)){var i=vH.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),o={message:i,type:pv.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var a=this.defineRule(e,r,n);return this[e]=a,a},t.prototype.OVERRIDE_RULE=function(e,r,n){n===void 0&&(n=pv.DEFAULT_RULE_CONFIG);var i=[];i=i.concat((0,_H.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(i);var o=this.defineRule(e,r,n);return this[e]=o,o},t.prototype.BACKTRACK=function(e,r){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if((0,yH.isRecognitionException)(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return(0,TH.serializeGrammar)((0,lw.values)(this.gastProductionsCache))},t}();Yf.RecognizerApi=RH});var hw=b(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.RecognizerEngine=void 0;var At=$e(),zr=Wf(),Xf=ts(),fw=Cu(),ns=Eu(),dw=Kr(),bH=cv(),pw=fo(),ku=Xa(),AH=fv(),EH=function(){function t(){}return t.prototype.initRecognizerEngine=function(e,r){if(this.className=(0,AH.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ku.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,At.has)(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
3687
3687
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
3688
3688
  For Further details.`);if((0,At.isArray)(e)){if((0,At.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty.
3689
3689
  Note that the first argument for the parser constructor
3690
3690
  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.
3691
3691
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
3692
3692
  For Further details.`)}if((0,At.isArray)(e))this.tokensMap=(0,At.reduce)(e,function(a,s){return a[s.name]=s,a},{});else if((0,At.has)(e,"modes")&&(0,At.every)((0,At.flatten)((0,At.values)(e.modes)),ku.isTokenType)){var n=(0,At.flatten)((0,At.values)(e.modes)),i=(0,At.uniq)(n);this.tokensMap=(0,At.reduce)(i,function(a,s){return a[s.name]=s,a},{})}else if((0,At.isObject)(e))this.tokensMap=(0,At.cloneObj)(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=pw.EOF;var o=(0,At.every)((0,At.values)(e),function(a){return(0,At.isEmpty)(a.categoryMatches)});this.tokenMatcher=o?ku.tokenStructuredMatcherNoCategories:ku.tokenStructuredMatcher,(0,ku.augmentTokenTypes)((0,At.values)(this.tokensMap))},t.prototype.defineRule=function(e,r,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called'
3693
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var i=(0,At.has)(n,"resyncEnabled")?n.resyncEnabled:dw.DEFAULT_RULE_CONFIG.resyncEnabled,o=(0,At.has)(n,"recoveryValueFunc")?n.recoveryValueFunc:dw.DEFAULT_RULE_CONFIG.recoveryValueFunc,a=this.ruleShortNameIdx<<zr.BITS_FOR_METHOD_TYPE+zr.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;function s(c){try{if(this.outputCst===!0){r.apply(this,c);var f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}else return r.apply(this,c)}catch(p){return this.invokeRuleCatch(p,i,o)}finally{this.ruleFinallyStateUpdate()}}var u=function(c,f){return c===void 0&&(c=0),this.ruleInvocationStateUpdate(a,e,c),s.call(this,f)},l="ruleName";return u[l]=e,u.originalGrammarAction=r,u},t.prototype.invokeRuleCatch=function(e,r,n){var i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if((0,Xf.isRecognitionException)(e)){var a=e;if(o){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(a.resyncedTokens=this.reSyncTo(s),this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n();else{if(this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,a.partialCstResult=u}throw a}}else{if(i)return this.moveToTerminatedState(),n();throw a}}else throw e},t.prototype.optionInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.OPTION_IDX,r);return this.optionInternalLogic(e,r,n)},t.prototype.optionInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(e.DEF!==void 0){if(a=e.DEF,s=e.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=e;if(o.call(this)===!0)return a.call(this)},t.prototype.atLeastOneInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,r,n)},t.prototype.atLeastOneInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(r.DEF!==void 0){if(a=r.DEF,s=r.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=r;if(o.call(this)===!0)for(var l=this.doSingleRepetition(a);o.call(this)===!0&&l===!0;)l=this.doSingleRepetition(a);else throw this.raiseEarlyExitException(e,fw.PROD_TYPE.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],o,zr.AT_LEAST_ONE_IDX,e,ns.NextTerminalAfterAtLeastOneWalker)},t.prototype.atLeastOneSepFirstInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,r,n)},t.prototype.atLeastOneSepFirstInternalLogic=function(e,r,n){var i=this,o=r.DEF,a=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){o.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),a)};this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,u,o,ns.NextTerminalAfterAtLeastOneSepWalker],u,zr.AT_LEAST_ONE_SEP_IDX,e,ns.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,fw.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)},t.prototype.manyInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.MANY_IDX,e);return this.manyInternalLogic(e,r,n)},t.prototype.manyInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(r.DEF!==void 0){if(a=r.DEF,s=r.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=r;for(var l=!0;o.call(this)===!0&&l===!0;)l=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],o,zr.MANY_IDX,e,ns.NextTerminalAfterManyWalker,l)},t.prototype.manySepFirstInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,r,n)},t.prototype.manySepFirstInternalLogic=function(e,r,n){var i=this,o=r.DEF,a=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){o.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),a)};this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,u,o,ns.NextTerminalAfterManySepWalker],u,zr.MANY_SEP_IDX,e,ns.NextTerminalAfterManySepWalker)}},t.prototype.repetitionSepSecondInternal=function(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,zr.AT_LEAST_ONE_SEP_IDX,e,o)},t.prototype.doSingleRepetition=function(e){var r=this.getLexerPosition();e.call(this);var n=this.getLexerPosition();return n>r},t.prototype.orInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.OR_IDX,r),i=(0,At.isArray)(e)?e:e.DEF,o=this.getLaFuncFromCache(n),a=o.call(this,i);if(a!==void 0){var s=i[a];return s.ALT.call(this)}this.raiseNoAltException(r,e.ERR_MSG)},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Xf.NotAllInputParsedException(r,e))}},t.prototype.subruleInternal=function(e,r,n){var i;try{var o=n!==void 0?n.ARGS:void 0;return i=e.call(this,r,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){this.subruleInternalError(a,n,e.ruleName)}},t.prototype.subruleInternalError=function(e,r,n){throw(0,Xf.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e},t.prototype.consumeInternal=function(e,r,n){var i;try{var o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i},t.prototype.consumeInternalError=function(e,r,n){var i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Xf.MismatchedTokenException(i,r,o))},t.prototype.consumeInternalRecovery=function(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){var i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===AH.IN_RULE_RECOVERY_EXCEPTION?n:o}}else throw n},t.prototype.saveRecogState=function(){var e=this.errors,r=(0,At.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}},t.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r,e)},t.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},t.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},t.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),pw.EOF)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t}();Zf.RecognizerEngine=CH});var gw=b(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.ErrorHandler=void 0;var hv=ts(),mv=$e(),mw=Cu(),xH=Kr(),wH=function(){function t(){}return t.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,mv.has)(e,"errorMessageProvider")?e.errorMessageProvider:xH.DEFAULT_PARSER_CONFIG.errorMessageProvider},t.prototype.SAVE_ERROR=function(e){if((0,hv.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,mv.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return(0,mv.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),t.prototype.raiseEarlyExitException=function(e,r,n){for(var i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=(0,mw.getLookaheadPathsForOptionalProd)(e,o,r,this.maxLookahead),s=a[0],u=[],l=1;l<=this.maxLookahead;l++)u.push(this.LA(l));var c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new hv.EarlyExitException(c,this.LA(1),this.LA(0)))},t.prototype.raiseNoAltException=function(e,r){for(var n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=(0,mw.getLookaheadPathsForOr)(e,i,this.maxLookahead),a=[],s=1;s<=this.maxLookahead;s++)a.push(this.LA(s));var u=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:a,previous:u,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new hv.NoViableAltException(l,this.LA(1),u))},t}();Jf.ErrorHandler=wH});var _w=b(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.ContentAssist=void 0;var yw=Eu(),vw=$e(),SH=function(){function t(){}return t.prototype.initContentAssist=function(){},t.prototype.computeContentAssist=function(e,r){var n=this.gastProductionsCache[e];if((0,vw.isUndefined)(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,yw.nextPossibleTokensAfter)([n],r,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(e){var r=(0,vw.first)(e.ruleStack),n=this.getGAstProductions(),i=n[r],o=new yw.NextAfterTokenWalker(i,e).startWalking();return o},t}();Qf.ContentAssist=SH});var ww=b(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.GastRecorder=void 0;var jr=$e(),yi=Lr(),kH=yu(),Aw=Xa(),Ew=fo(),PH=Kr(),DH=Wf(),td={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(td);var Tw=!0,Rw=Math.pow(2,DH.BITS_FOR_OCCURRENCE_IDX)-1,Cw=(0,Ew.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:kH.Lexer.NA});(0,Aw.augmentTokenTypes)([Cw]);var xw=(0,Ew.createTokenInstance)(Cw,`This IToken indicates the Parser is in Recording Phase
3694
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(xw);var NH={name:`This CSTNode indicates the Parser is in Recording Phase
3695
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},OH=function(){function t(){}return t.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var r=function(i){var o=i>0?i:"";e["CONSUME"+o]=function(a,s){return this.consumeInternalRecord(a,i,s)},e["SUBRULE"+o]=function(a,s){return this.subruleInternalRecord(a,i,s)},e["OPTION"+o]=function(a){return this.optionInternalRecord(a,i)},e["OR"+o]=function(a){return this.orInternalRecord(a,i)},e["MANY"+o]=function(a){this.manyInternalRecord(i,a)},e["MANY_SEP"+o]=function(a){this.manySepFirstInternalRecord(i,a)},e["AT_LEAST_ONE"+o]=function(a){this.atLeastOneInternalRecord(i,a)},e["AT_LEAST_ONE_SEP"+o]=function(a){this.atLeastOneSepFirstInternalRecord(i,a)}},n=0;n<10;n++)r(n);e.consume=function(i,o,a){return this.consumeInternalRecord(o,i,a)},e.subrule=function(i,o,a){return this.subruleInternalRecord(o,i,a)},e.option=function(i,o){return this.optionInternalRecord(o,i)},e.or=function(i,o){return this.orInternalRecord(o,i)},e.many=function(i,o){this.manyInternalRecord(i,o)},e.atLeastOne=function(i,o){this.atLeastOneInternalRecord(i,o)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},t.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var r=0;r<10;r++){var n=r>0?r:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},t.prototype.ACTION_RECORD=function(e){},t.prototype.BACKTRACK_RECORD=function(e,r){return function(){return!0}},t.prototype.LA_RECORD=function(e){return PH.END_OF_FILE},t.prototype.topLevelRuleRecord=function(e,r){try{var n=new yi.Rule({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(i){if(i.KNOWN_RECORDER_ERROR!==!0)try{i.message=i.message+`
3693
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var i=(0,At.has)(n,"resyncEnabled")?n.resyncEnabled:dw.DEFAULT_RULE_CONFIG.resyncEnabled,o=(0,At.has)(n,"recoveryValueFunc")?n.recoveryValueFunc:dw.DEFAULT_RULE_CONFIG.recoveryValueFunc,a=this.ruleShortNameIdx<<zr.BITS_FOR_METHOD_TYPE+zr.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;function s(c){try{if(this.outputCst===!0){r.apply(this,c);var f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}else return r.apply(this,c)}catch(p){return this.invokeRuleCatch(p,i,o)}finally{this.ruleFinallyStateUpdate()}}var u=function(c,f){return c===void 0&&(c=0),this.ruleInvocationStateUpdate(a,e,c),s.call(this,f)},l="ruleName";return u[l]=e,u.originalGrammarAction=r,u},t.prototype.invokeRuleCatch=function(e,r,n){var i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if((0,Xf.isRecognitionException)(e)){var a=e;if(o){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(a.resyncedTokens=this.reSyncTo(s),this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n();else{if(this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,a.partialCstResult=u}throw a}}else{if(i)return this.moveToTerminatedState(),n();throw a}}else throw e},t.prototype.optionInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.OPTION_IDX,r);return this.optionInternalLogic(e,r,n)},t.prototype.optionInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(e.DEF!==void 0){if(a=e.DEF,s=e.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=e;if(o.call(this)===!0)return a.call(this)},t.prototype.atLeastOneInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,r,n)},t.prototype.atLeastOneInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(r.DEF!==void 0){if(a=r.DEF,s=r.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=r;if(o.call(this)===!0)for(var l=this.doSingleRepetition(a);o.call(this)===!0&&l===!0;)l=this.doSingleRepetition(a);else throw this.raiseEarlyExitException(e,fw.PROD_TYPE.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],o,zr.AT_LEAST_ONE_IDX,e,ns.NextTerminalAfterAtLeastOneWalker)},t.prototype.atLeastOneSepFirstInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,r,n)},t.prototype.atLeastOneSepFirstInternalLogic=function(e,r,n){var i=this,o=r.DEF,a=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){o.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),a)};this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,u,o,ns.NextTerminalAfterAtLeastOneSepWalker],u,zr.AT_LEAST_ONE_SEP_IDX,e,ns.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,fw.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)},t.prototype.manyInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.MANY_IDX,e);return this.manyInternalLogic(e,r,n)},t.prototype.manyInternalLogic=function(e,r,n){var i=this,o=this.getLaFuncFromCache(n),a,s;if(r.DEF!==void 0){if(a=r.DEF,s=r.GATE,s!==void 0){var u=o;o=function(){return s.call(i)&&u.call(i)}}}else a=r;for(var l=!0;o.call(this)===!0&&l===!0;)l=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],o,zr.MANY_IDX,e,ns.NextTerminalAfterManyWalker,l)},t.prototype.manySepFirstInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,r,n)},t.prototype.manySepFirstInternalLogic=function(e,r,n){var i=this,o=r.DEF,a=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){o.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),a)};this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,u,o,ns.NextTerminalAfterManySepWalker],u,zr.MANY_SEP_IDX,e,ns.NextTerminalAfterManySepWalker)}},t.prototype.repetitionSepSecondInternal=function(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,zr.AT_LEAST_ONE_SEP_IDX,e,o)},t.prototype.doSingleRepetition=function(e){var r=this.getLexerPosition();e.call(this);var n=this.getLexerPosition();return n>r},t.prototype.orInternal=function(e,r){var n=this.getKeyForAutomaticLookahead(zr.OR_IDX,r),i=(0,At.isArray)(e)?e:e.DEF,o=this.getLaFuncFromCache(n),a=o.call(this,i);if(a!==void 0){var s=i[a];return s.ALT.call(this)}this.raiseNoAltException(r,e.ERR_MSG)},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Xf.NotAllInputParsedException(r,e))}},t.prototype.subruleInternal=function(e,r,n){var i;try{var o=n!==void 0?n.ARGS:void 0;return i=e.call(this,r,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){this.subruleInternalError(a,n,e.ruleName)}},t.prototype.subruleInternalError=function(e,r,n){throw(0,Xf.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e},t.prototype.consumeInternal=function(e,r,n){var i;try{var o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i},t.prototype.consumeInternalError=function(e,r,n){var i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Xf.MismatchedTokenException(i,r,o))},t.prototype.consumeInternalRecovery=function(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){var i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===bH.IN_RULE_RECOVERY_EXCEPTION?n:o}}else throw n},t.prototype.saveRecogState=function(){var e=this.errors,r=(0,At.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}},t.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r,e)},t.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},t.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},t.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),pw.EOF)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t}();Zf.RecognizerEngine=EH});var gw=b(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.ErrorHandler=void 0;var hv=ts(),mv=$e(),mw=Cu(),CH=Kr(),xH=function(){function t(){}return t.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,mv.has)(e,"errorMessageProvider")?e.errorMessageProvider:CH.DEFAULT_PARSER_CONFIG.errorMessageProvider},t.prototype.SAVE_ERROR=function(e){if((0,hv.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,mv.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return(0,mv.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),t.prototype.raiseEarlyExitException=function(e,r,n){for(var i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=(0,mw.getLookaheadPathsForOptionalProd)(e,o,r,this.maxLookahead),s=a[0],u=[],l=1;l<=this.maxLookahead;l++)u.push(this.LA(l));var c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new hv.EarlyExitException(c,this.LA(1),this.LA(0)))},t.prototype.raiseNoAltException=function(e,r){for(var n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=(0,mw.getLookaheadPathsForOr)(e,i,this.maxLookahead),a=[],s=1;s<=this.maxLookahead;s++)a.push(this.LA(s));var u=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:a,previous:u,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new hv.NoViableAltException(l,this.LA(1),u))},t}();Jf.ErrorHandler=xH});var _w=b(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.ContentAssist=void 0;var yw=Eu(),vw=$e(),wH=function(){function t(){}return t.prototype.initContentAssist=function(){},t.prototype.computeContentAssist=function(e,r){var n=this.gastProductionsCache[e];if((0,vw.isUndefined)(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,yw.nextPossibleTokensAfter)([n],r,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(e){var r=(0,vw.first)(e.ruleStack),n=this.getGAstProductions(),i=n[r],o=new yw.NextAfterTokenWalker(i,e).startWalking();return o},t}();Qf.ContentAssist=wH});var ww=b(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.GastRecorder=void 0;var jr=$e(),yi=Lr(),SH=yu(),Aw=Xa(),Ew=fo(),kH=Kr(),PH=Wf(),td={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(td);var Tw=!0,Rw=Math.pow(2,PH.BITS_FOR_OCCURRENCE_IDX)-1,Cw=(0,Ew.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:SH.Lexer.NA});(0,Aw.augmentTokenTypes)([Cw]);var xw=(0,Ew.createTokenInstance)(Cw,`This IToken indicates the Parser is in Recording Phase
3694
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(xw);var DH={name:`This CSTNode indicates the Parser is in Recording Phase
3695
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},NH=function(){function t(){}return t.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var r=function(i){var o=i>0?i:"";e["CONSUME"+o]=function(a,s){return this.consumeInternalRecord(a,i,s)},e["SUBRULE"+o]=function(a,s){return this.subruleInternalRecord(a,i,s)},e["OPTION"+o]=function(a){return this.optionInternalRecord(a,i)},e["OR"+o]=function(a){return this.orInternalRecord(a,i)},e["MANY"+o]=function(a){this.manyInternalRecord(i,a)},e["MANY_SEP"+o]=function(a){this.manySepFirstInternalRecord(i,a)},e["AT_LEAST_ONE"+o]=function(a){this.atLeastOneInternalRecord(i,a)},e["AT_LEAST_ONE_SEP"+o]=function(a){this.atLeastOneSepFirstInternalRecord(i,a)}},n=0;n<10;n++)r(n);e.consume=function(i,o,a){return this.consumeInternalRecord(o,i,a)},e.subrule=function(i,o,a){return this.subruleInternalRecord(o,i,a)},e.option=function(i,o){return this.optionInternalRecord(o,i)},e.or=function(i,o){return this.orInternalRecord(o,i)},e.many=function(i,o){this.manyInternalRecord(i,o)},e.atLeastOne=function(i,o){this.atLeastOneInternalRecord(i,o)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},t.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var r=0;r<10;r++){var n=r>0?r:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},t.prototype.ACTION_RECORD=function(e){},t.prototype.BACKTRACK_RECORD=function(e,r){return function(){return!0}},t.prototype.LA_RECORD=function(e){return kH.END_OF_FILE},t.prototype.topLevelRuleRecord=function(e,r){try{var n=new yi.Rule({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(i){if(i.KNOWN_RECORDER_ERROR!==!0)try{i.message=i.message+`
3696
3696
  This error was thrown during the "grammar recording phase" For more info see:
3697
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw i}throw i}},t.prototype.optionInternalRecord=function(e,r){return Pu.call(this,yi.Option,e,r)},t.prototype.atLeastOneInternalRecord=function(e,r){Pu.call(this,yi.RepetitionMandatory,r,e)},t.prototype.atLeastOneSepFirstInternalRecord=function(e,r){Pu.call(this,yi.RepetitionMandatoryWithSeparator,r,e,Tw)},t.prototype.manyInternalRecord=function(e,r){Pu.call(this,yi.Repetition,r,e)},t.prototype.manySepFirstInternalRecord=function(e,r){Pu.call(this,yi.RepetitionWithSeparator,r,e,Tw)},t.prototype.orInternalRecord=function(e,r){return IH.call(this,e,r)},t.prototype.subruleInternalRecord=function(e,r,n){if(ed(r),!e||(0,jr.has)(e,"ruleName")===!1){var i=new Error("<SUBRULE"+bw(r)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(`
3698
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var o=(0,jr.peek)(this.recordingProdStack),a=e.ruleName,s=new yi.NonTerminal({idx:r,nonTerminalName:a,label:n?.LABEL,referencedRule:void 0});return o.definition.push(s),this.outputCst?NH:td},t.prototype.consumeInternalRecord=function(e,r,n){if(ed(r),!(0,Aw.hasShortKeyProperty)(e)){var i=new Error("<CONSUME"+bw(r)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(`
3699
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var o=(0,jr.peek)(this.recordingProdStack),a=new yi.Terminal({idx:r,terminalType:e,label:n?.LABEL});return o.definition.push(a),xw},t}();rd.GastRecorder=OH;function Pu(t,e,r,n){n===void 0&&(n=!1),ed(r);var i=(0,jr.peek)(this.recordingProdStack),o=(0,jr.isFunction)(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),(0,jr.has)(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),o.call(this),i.definition.push(a),this.recordingProdStack.pop(),td}function IH(t,e){var r=this;ed(e);var n=(0,jr.peek)(this.recordingProdStack),i=(0,jr.isArray)(t)===!1,o=i===!1?t:t.DEF,a=new yi.Alternation({definition:[],idx:e,ignoreAmbiguities:i&&t.IGNORE_AMBIGUITIES===!0});(0,jr.has)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);var s=(0,jr.some)(o,function(u){return(0,jr.isFunction)(u.GATE)});return a.hasPredicates=s,n.definition.push(a),(0,jr.forEach)(o,function(u){var l=new yi.Alternative({definition:[]});a.definition.push(l),(0,jr.has)(u,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:(0,jr.has)(u,"GATE")&&(l.ignoreAmbiguities=!0),r.recordingProdStack.push(l),u.ALT.call(r),r.recordingProdStack.pop()}),td}function bw(t){return t===0?"":""+t}function ed(t){if(t<0||t>Rw){var e=new Error("Invalid DSL Method idx value: <"+t+`>
3700
- `+("Idx value must be a none negative value smaller than "+(Rw+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var kw=b(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.PerformanceTracer=void 0;var Sw=$e(),$H=Kr(),MH=function(){function t(){}return t.prototype.initPerformanceTracer=function(e){if((0,Sw.has)(e,"traceInitPerf")){var r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=$H.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--> <"+e+">");var i=(0,Sw.timer)(r),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}else return r()},t}();nd.PerformanceTracer=MH});var Pw=b(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.applyMixins=void 0;function LH(t,e){e.forEach(function(r){var n=r.prototype;Object.getOwnPropertyNames(n).forEach(function(i){if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]}})})}id.applyMixins=LH});var Kr=b(ct=>{"use strict";var Ow=ct&&ct.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ct,"__esModule",{value:!0});ct.EmbeddedActionsParser=ct.CstParser=ct.Parser=ct.EMPTY_ALT=ct.ParserDefinitionErrorType=ct.DEFAULT_RULE_CONFIG=ct.DEFAULT_PARSER_CONFIG=ct.END_OF_FILE=void 0;var Pr=$e(),FH=gx(),Dw=fo(),Iw=bu(),Nw=Ux(),qH=cv(),jH=Xx(),GH=aw(),UH=uw(),HH=cw(),BH=hw(),WH=gw(),KH=_w(),zH=ww(),VH=kw(),YH=Pw();ct.END_OF_FILE=(0,Dw.createTokenInstance)(Dw.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ct.END_OF_FILE);ct.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Iw.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});ct.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var XH;(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"})(XH=ct.ParserDefinitionErrorType||(ct.ParserDefinitionErrorType={}));function ZH(t){return t===void 0&&(t=void 0),function(){return t}}ct.EMPTY_ALT=ZH;var od=function(){function t(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),(0,Pr.has)(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
3697
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw i}throw i}},t.prototype.optionInternalRecord=function(e,r){return Pu.call(this,yi.Option,e,r)},t.prototype.atLeastOneInternalRecord=function(e,r){Pu.call(this,yi.RepetitionMandatory,r,e)},t.prototype.atLeastOneSepFirstInternalRecord=function(e,r){Pu.call(this,yi.RepetitionMandatoryWithSeparator,r,e,Tw)},t.prototype.manyInternalRecord=function(e,r){Pu.call(this,yi.Repetition,r,e)},t.prototype.manySepFirstInternalRecord=function(e,r){Pu.call(this,yi.RepetitionWithSeparator,r,e,Tw)},t.prototype.orInternalRecord=function(e,r){return OH.call(this,e,r)},t.prototype.subruleInternalRecord=function(e,r,n){if(ed(r),!e||(0,jr.has)(e,"ruleName")===!1){var i=new Error("<SUBRULE"+bw(r)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(`
3698
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var o=(0,jr.peek)(this.recordingProdStack),a=e.ruleName,s=new yi.NonTerminal({idx:r,nonTerminalName:a,label:n?.LABEL,referencedRule:void 0});return o.definition.push(s),this.outputCst?DH:td},t.prototype.consumeInternalRecord=function(e,r,n){if(ed(r),!(0,Aw.hasShortKeyProperty)(e)){var i=new Error("<CONSUME"+bw(r)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(`
3699
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var o=(0,jr.peek)(this.recordingProdStack),a=new yi.Terminal({idx:r,terminalType:e,label:n?.LABEL});return o.definition.push(a),xw},t}();rd.GastRecorder=NH;function Pu(t,e,r,n){n===void 0&&(n=!1),ed(r);var i=(0,jr.peek)(this.recordingProdStack),o=(0,jr.isFunction)(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),(0,jr.has)(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),o.call(this),i.definition.push(a),this.recordingProdStack.pop(),td}function OH(t,e){var r=this;ed(e);var n=(0,jr.peek)(this.recordingProdStack),i=(0,jr.isArray)(t)===!1,o=i===!1?t:t.DEF,a=new yi.Alternation({definition:[],idx:e,ignoreAmbiguities:i&&t.IGNORE_AMBIGUITIES===!0});(0,jr.has)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);var s=(0,jr.some)(o,function(u){return(0,jr.isFunction)(u.GATE)});return a.hasPredicates=s,n.definition.push(a),(0,jr.forEach)(o,function(u){var l=new yi.Alternative({definition:[]});a.definition.push(l),(0,jr.has)(u,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:(0,jr.has)(u,"GATE")&&(l.ignoreAmbiguities=!0),r.recordingProdStack.push(l),u.ALT.call(r),r.recordingProdStack.pop()}),td}function bw(t){return t===0?"":""+t}function ed(t){if(t<0||t>Rw){var e=new Error("Invalid DSL Method idx value: <"+t+`>
3700
+ `+("Idx value must be a none negative value smaller than "+(Rw+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var kw=b(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.PerformanceTracer=void 0;var Sw=$e(),IH=Kr(),$H=function(){function t(){}return t.prototype.initPerformanceTracer=function(e){if((0,Sw.has)(e,"traceInitPerf")){var r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=IH.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--> <"+e+">");var i=(0,Sw.timer)(r),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}else return r()},t}();nd.PerformanceTracer=$H});var Pw=b(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.applyMixins=void 0;function MH(t,e){e.forEach(function(r){var n=r.prototype;Object.getOwnPropertyNames(n).forEach(function(i){if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]}})})}id.applyMixins=MH});var Kr=b(ct=>{"use strict";var Ow=ct&&ct.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ct,"__esModule",{value:!0});ct.EmbeddedActionsParser=ct.CstParser=ct.Parser=ct.EMPTY_ALT=ct.ParserDefinitionErrorType=ct.DEFAULT_RULE_CONFIG=ct.DEFAULT_PARSER_CONFIG=ct.END_OF_FILE=void 0;var Pr=$e(),LH=gx(),Dw=fo(),Iw=bu(),Nw=Ux(),FH=cv(),qH=Xx(),jH=aw(),GH=uw(),UH=cw(),HH=hw(),BH=gw(),WH=_w(),KH=ww(),zH=kw(),VH=Pw();ct.END_OF_FILE=(0,Dw.createTokenInstance)(Dw.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ct.END_OF_FILE);ct.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Iw.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});ct.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var YH;(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"})(YH=ct.ParserDefinitionErrorType||(ct.ParserDefinitionErrorType={}));function XH(t){return t===void 0&&(t=void 0),function(){return t}}ct.EMPTY_ALT=XH;var od=function(){function t(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),(0,Pr.has)(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
3701
3701
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
3702
3702
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
3703
- For further details.`);this.skipValidations=(0,Pr.has)(r,"skipValidations")?r.skipValidations:ct.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;e.selfAnalysisDone=!0;var n=e.className;e.TRACE_INIT("toFastProps",function(){(0,Pr.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,Pr.forEach)(e.definedRulesNames,function(o){var a=e[o],s=a.originalGrammarAction,u=void 0;e.TRACE_INIT(o+" Rule",function(){u=e.topLevelRuleRecord(o,s)}),e.gastProductionsCache[o]=u})}finally{e.disableRecording()}});var i=[];if(e.TRACE_INIT("Grammar Resolving",function(){i=(0,Nw.resolveGrammar)({rules:(0,Pr.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(i)}),e.TRACE_INIT("Grammar Validations",function(){if((0,Pr.isEmpty)(i)&&e.skipValidations===!1){var o=(0,Nw.validateGrammar)({rules:(0,Pr.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,Pr.values)(e.tokensMap),errMsgProvider:Iw.defaultGrammarValidatorErrorProvider,grammarName:n});e.definitionErrors=e.definitionErrors.concat(o)}}),(0,Pr.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var o=(0,FH.computeAllProdsFollows)((0,Pr.values)(e.gastProductionsCache));e.resyncFollows=o}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,Pr.values)(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Pr.isEmpty)(e.definitionErrors))throw r=(0,Pr.map)(e.definitionErrors,function(o){return o.message}),new Error(`Parser Definition Errors detected:
3703
+ For further details.`);this.skipValidations=(0,Pr.has)(r,"skipValidations")?r.skipValidations:ct.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;e.selfAnalysisDone=!0;var n=e.className;e.TRACE_INIT("toFastProps",function(){(0,Pr.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,Pr.forEach)(e.definedRulesNames,function(o){var a=e[o],s=a.originalGrammarAction,u=void 0;e.TRACE_INIT(o+" Rule",function(){u=e.topLevelRuleRecord(o,s)}),e.gastProductionsCache[o]=u})}finally{e.disableRecording()}});var i=[];if(e.TRACE_INIT("Grammar Resolving",function(){i=(0,Nw.resolveGrammar)({rules:(0,Pr.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(i)}),e.TRACE_INIT("Grammar Validations",function(){if((0,Pr.isEmpty)(i)&&e.skipValidations===!1){var o=(0,Nw.validateGrammar)({rules:(0,Pr.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,Pr.values)(e.tokensMap),errMsgProvider:Iw.defaultGrammarValidatorErrorProvider,grammarName:n});e.definitionErrors=e.definitionErrors.concat(o)}}),(0,Pr.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var o=(0,LH.computeAllProdsFollows)((0,Pr.values)(e.gastProductionsCache));e.resyncFollows=o}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,Pr.values)(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Pr.isEmpty)(e.definitionErrors))throw r=(0,Pr.map)(e.definitionErrors,function(o){return o.message}),new Error(`Parser Definition Errors detected:
3704
3704
  `+r.join(`
3705
3705
  -------------------------------
3706
- `))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();ct.Parser=od;(0,YH.applyMixins)(od,[qH.Recoverable,jH.LooksAhead,GH.TreeBuilder,UH.LexerAdapter,BH.RecognizerEngine,HH.RecognizerApi,WH.ErrorHandler,KH.ContentAssist,zH.GastRecorder,VH.PerformanceTracer]);var JH=function(t){Ow(e,t);function e(r,n){n===void 0&&(n=ct.DEFAULT_PARSER_CONFIG);var i=this,o=(0,Pr.cloneObj)(n);return o.outputCst=!0,i=t.call(this,r,o)||this,i}return e}(od);ct.CstParser=JH;var QH=function(t){Ow(e,t);function e(r,n){n===void 0&&(n=ct.DEFAULT_PARSER_CONFIG);var i=this,o=(0,Pr.cloneObj)(n);return o.outputCst=!1,i=t.call(this,r,o)||this,i}return e}(od);ct.EmbeddedActionsParser=QH});var Mw=b(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.createSyntaxDiagramsCode=void 0;var $w=$y();function eB(t,e){var r=e===void 0?{}:e,n=r.resourceBase,i=n===void 0?"https://unpkg.com/chevrotain@"+$w.VERSION+"/diagrams/":n,o=r.css,a=o===void 0?"https://unpkg.com/chevrotain@"+$w.VERSION+"/diagrams/diagrams.css":o,s=`
3706
+ `))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();ct.Parser=od;(0,VH.applyMixins)(od,[FH.Recoverable,qH.LooksAhead,jH.TreeBuilder,GH.LexerAdapter,HH.RecognizerEngine,UH.RecognizerApi,BH.ErrorHandler,WH.ContentAssist,KH.GastRecorder,zH.PerformanceTracer]);var ZH=function(t){Ow(e,t);function e(r,n){n===void 0&&(n=ct.DEFAULT_PARSER_CONFIG);var i=this,o=(0,Pr.cloneObj)(n);return o.outputCst=!0,i=t.call(this,r,o)||this,i}return e}(od);ct.CstParser=ZH;var JH=function(t){Ow(e,t);function e(r,n){n===void 0&&(n=ct.DEFAULT_PARSER_CONFIG);var i=this,o=(0,Pr.cloneObj)(n);return o.outputCst=!1,i=t.call(this,r,o)||this,i}return e}(od);ct.EmbeddedActionsParser=JH});var Mw=b(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.createSyntaxDiagramsCode=void 0;var $w=$y();function QH(t,e){var r=e===void 0?{}:e,n=r.resourceBase,i=n===void 0?"https://unpkg.com/chevrotain@"+$w.VERSION+"/diagrams/":n,o=r.css,a=o===void 0?"https://unpkg.com/chevrotain@"+$w.VERSION+"/diagrams/diagrams.css":o,s=`
3707
3707
  <!-- This is a generated file -->
3708
3708
  <!DOCTYPE html>
3709
3709
  <meta charset="utf-8">
@@ -3731,14 +3731,14 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
3731
3731
  var diagramsDiv = document.getElementById("diagrams");
3732
3732
  main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
3733
3733
  <\/script>
3734
- `;return s+u+l+c+f+p}ad.createSyntaxDiagramsCode=eB});var ud=b(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Parser=Y.createSyntaxDiagramsCode=Y.clearCache=Y.GAstVisitor=Y.serializeProduction=Y.serializeGrammar=Y.Terminal=Y.Rule=Y.RepetitionWithSeparator=Y.RepetitionMandatoryWithSeparator=Y.RepetitionMandatory=Y.Repetition=Y.Option=Y.NonTerminal=Y.Alternative=Y.Alternation=Y.defaultLexerErrorProvider=Y.NoViableAltException=Y.NotAllInputParsedException=Y.MismatchedTokenException=Y.isRecognitionException=Y.EarlyExitException=Y.defaultParserErrorProvider=Y.tokenName=Y.tokenMatcher=Y.tokenLabel=Y.EOF=Y.createTokenInstance=Y.createToken=Y.LexerDefinitionErrorType=Y.Lexer=Y.EMPTY_ALT=Y.ParserDefinitionErrorType=Y.EmbeddedActionsParser=Y.CstParser=Y.VERSION=void 0;var tB=$y();Object.defineProperty(Y,"VERSION",{enumerable:!0,get:function(){return tB.VERSION}});var sd=Kr();Object.defineProperty(Y,"CstParser",{enumerable:!0,get:function(){return sd.CstParser}});Object.defineProperty(Y,"EmbeddedActionsParser",{enumerable:!0,get:function(){return sd.EmbeddedActionsParser}});Object.defineProperty(Y,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return sd.ParserDefinitionErrorType}});Object.defineProperty(Y,"EMPTY_ALT",{enumerable:!0,get:function(){return sd.EMPTY_ALT}});var Lw=yu();Object.defineProperty(Y,"Lexer",{enumerable:!0,get:function(){return Lw.Lexer}});Object.defineProperty(Y,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return Lw.LexerDefinitionErrorType}});var is=fo();Object.defineProperty(Y,"createToken",{enumerable:!0,get:function(){return is.createToken}});Object.defineProperty(Y,"createTokenInstance",{enumerable:!0,get:function(){return is.createTokenInstance}});Object.defineProperty(Y,"EOF",{enumerable:!0,get:function(){return is.EOF}});Object.defineProperty(Y,"tokenLabel",{enumerable:!0,get:function(){return is.tokenLabel}});Object.defineProperty(Y,"tokenMatcher",{enumerable:!0,get:function(){return is.tokenMatcher}});Object.defineProperty(Y,"tokenName",{enumerable:!0,get:function(){return is.tokenName}});var rB=bu();Object.defineProperty(Y,"defaultParserErrorProvider",{enumerable:!0,get:function(){return rB.defaultParserErrorProvider}});var Du=ts();Object.defineProperty(Y,"EarlyExitException",{enumerable:!0,get:function(){return Du.EarlyExitException}});Object.defineProperty(Y,"isRecognitionException",{enumerable:!0,get:function(){return Du.isRecognitionException}});Object.defineProperty(Y,"MismatchedTokenException",{enumerable:!0,get:function(){return Du.MismatchedTokenException}});Object.defineProperty(Y,"NotAllInputParsedException",{enumerable:!0,get:function(){return Du.NotAllInputParsedException}});Object.defineProperty(Y,"NoViableAltException",{enumerable:!0,get:function(){return Du.NoViableAltException}});var nB=Wy();Object.defineProperty(Y,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return nB.defaultLexerErrorProvider}});var vi=Lr();Object.defineProperty(Y,"Alternation",{enumerable:!0,get:function(){return vi.Alternation}});Object.defineProperty(Y,"Alternative",{enumerable:!0,get:function(){return vi.Alternative}});Object.defineProperty(Y,"NonTerminal",{enumerable:!0,get:function(){return vi.NonTerminal}});Object.defineProperty(Y,"Option",{enumerable:!0,get:function(){return vi.Option}});Object.defineProperty(Y,"Repetition",{enumerable:!0,get:function(){return vi.Repetition}});Object.defineProperty(Y,"RepetitionMandatory",{enumerable:!0,get:function(){return vi.RepetitionMandatory}});Object.defineProperty(Y,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return vi.RepetitionMandatoryWithSeparator}});Object.defineProperty(Y,"RepetitionWithSeparator",{enumerable:!0,get:function(){return vi.RepetitionWithSeparator}});Object.defineProperty(Y,"Rule",{enumerable:!0,get:function(){return vi.Rule}});Object.defineProperty(Y,"Terminal",{enumerable:!0,get:function(){return vi.Terminal}});var Fw=Lr();Object.defineProperty(Y,"serializeGrammar",{enumerable:!0,get:function(){return Fw.serializeGrammar}});Object.defineProperty(Y,"serializeProduction",{enumerable:!0,get:function(){return Fw.serializeProduction}});var iB=Za();Object.defineProperty(Y,"GAstVisitor",{enumerable:!0,get:function(){return iB.GAstVisitor}});function oB(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
3734
+ `;return s+u+l+c+f+p}ad.createSyntaxDiagramsCode=QH});var ud=b(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Parser=Y.createSyntaxDiagramsCode=Y.clearCache=Y.GAstVisitor=Y.serializeProduction=Y.serializeGrammar=Y.Terminal=Y.Rule=Y.RepetitionWithSeparator=Y.RepetitionMandatoryWithSeparator=Y.RepetitionMandatory=Y.Repetition=Y.Option=Y.NonTerminal=Y.Alternative=Y.Alternation=Y.defaultLexerErrorProvider=Y.NoViableAltException=Y.NotAllInputParsedException=Y.MismatchedTokenException=Y.isRecognitionException=Y.EarlyExitException=Y.defaultParserErrorProvider=Y.tokenName=Y.tokenMatcher=Y.tokenLabel=Y.EOF=Y.createTokenInstance=Y.createToken=Y.LexerDefinitionErrorType=Y.Lexer=Y.EMPTY_ALT=Y.ParserDefinitionErrorType=Y.EmbeddedActionsParser=Y.CstParser=Y.VERSION=void 0;var eB=$y();Object.defineProperty(Y,"VERSION",{enumerable:!0,get:function(){return eB.VERSION}});var sd=Kr();Object.defineProperty(Y,"CstParser",{enumerable:!0,get:function(){return sd.CstParser}});Object.defineProperty(Y,"EmbeddedActionsParser",{enumerable:!0,get:function(){return sd.EmbeddedActionsParser}});Object.defineProperty(Y,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return sd.ParserDefinitionErrorType}});Object.defineProperty(Y,"EMPTY_ALT",{enumerable:!0,get:function(){return sd.EMPTY_ALT}});var Lw=yu();Object.defineProperty(Y,"Lexer",{enumerable:!0,get:function(){return Lw.Lexer}});Object.defineProperty(Y,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return Lw.LexerDefinitionErrorType}});var is=fo();Object.defineProperty(Y,"createToken",{enumerable:!0,get:function(){return is.createToken}});Object.defineProperty(Y,"createTokenInstance",{enumerable:!0,get:function(){return is.createTokenInstance}});Object.defineProperty(Y,"EOF",{enumerable:!0,get:function(){return is.EOF}});Object.defineProperty(Y,"tokenLabel",{enumerable:!0,get:function(){return is.tokenLabel}});Object.defineProperty(Y,"tokenMatcher",{enumerable:!0,get:function(){return is.tokenMatcher}});Object.defineProperty(Y,"tokenName",{enumerable:!0,get:function(){return is.tokenName}});var tB=bu();Object.defineProperty(Y,"defaultParserErrorProvider",{enumerable:!0,get:function(){return tB.defaultParserErrorProvider}});var Du=ts();Object.defineProperty(Y,"EarlyExitException",{enumerable:!0,get:function(){return Du.EarlyExitException}});Object.defineProperty(Y,"isRecognitionException",{enumerable:!0,get:function(){return Du.isRecognitionException}});Object.defineProperty(Y,"MismatchedTokenException",{enumerable:!0,get:function(){return Du.MismatchedTokenException}});Object.defineProperty(Y,"NotAllInputParsedException",{enumerable:!0,get:function(){return Du.NotAllInputParsedException}});Object.defineProperty(Y,"NoViableAltException",{enumerable:!0,get:function(){return Du.NoViableAltException}});var rB=Wy();Object.defineProperty(Y,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return rB.defaultLexerErrorProvider}});var vi=Lr();Object.defineProperty(Y,"Alternation",{enumerable:!0,get:function(){return vi.Alternation}});Object.defineProperty(Y,"Alternative",{enumerable:!0,get:function(){return vi.Alternative}});Object.defineProperty(Y,"NonTerminal",{enumerable:!0,get:function(){return vi.NonTerminal}});Object.defineProperty(Y,"Option",{enumerable:!0,get:function(){return vi.Option}});Object.defineProperty(Y,"Repetition",{enumerable:!0,get:function(){return vi.Repetition}});Object.defineProperty(Y,"RepetitionMandatory",{enumerable:!0,get:function(){return vi.RepetitionMandatory}});Object.defineProperty(Y,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return vi.RepetitionMandatoryWithSeparator}});Object.defineProperty(Y,"RepetitionWithSeparator",{enumerable:!0,get:function(){return vi.RepetitionWithSeparator}});Object.defineProperty(Y,"Rule",{enumerable:!0,get:function(){return vi.Rule}});Object.defineProperty(Y,"Terminal",{enumerable:!0,get:function(){return vi.Terminal}});var Fw=Lr();Object.defineProperty(Y,"serializeGrammar",{enumerable:!0,get:function(){return Fw.serializeGrammar}});Object.defineProperty(Y,"serializeProduction",{enumerable:!0,get:function(){return Fw.serializeProduction}});var nB=Za();Object.defineProperty(Y,"GAstVisitor",{enumerable:!0,get:function(){return nB.GAstVisitor}});function iB(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
3735
3735
  It performs no action other than printing this message.
3736
- Please avoid using it as it will be completely removed in the future`)}Y.clearCache=oB;var aB=Mw();Object.defineProperty(Y,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return aB.createSyntaxDiagramsCode}});var sB=function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
3737
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t}();Y.Parser=sB});var Gw=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.RootCstNodeImpl=fn.CompositeCstNodeImpl=fn.LeafCstNodeImpl=fn.AbstractCstNode=fn.CstNodeBuilder=void 0;var qw=Ta(),uB=Pa(),jw=pt(),gv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new ld(e),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Iu;return r.feature=e,r.root=this.rootNode,this.current.children.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new Ou(e.startOffset,e.image.length,(0,jw.tokenToRange)(e),e.tokenType,!1);return n.feature=r,n.root=this.rootNode,this.current.children.push(n),n}removeNode(e){let r=e.parent;if(r){let n=r.children.indexOf(e);n>=0&&r.children.splice(n,1)}}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.element=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.children.length===0&&this.removeNode(n)}addHiddenTokens(e){if(e)for(let r of e){let n=new Ou(r.startOffset,r.image.length,(0,jw.tokenToRange)(r),r.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,r){let{offset:n,end:i}=r;for(let o=0;o<e.children.length;o++){let a=e.children[o],{offset:s,end:u}=a;if((0,uB.isCompositeCstNode)(a)&&n>s&&i<u){this.addHiddenToken(a,r);return}else if(i<=s){e.children.splice(o,0,r);return}}e.children.push(r)}};fn.CstNodeBuilder=gv;var Nu=class{get hidden(){return!1}get element(){var e,r;let n=typeof((e=this._element)===null||e===void 0?void 0:e.$type)=="string"?this._element:(r=this.parent)===null||r===void 0?void 0:r.element;if(!n)throw new Error("This node has no associated AST element");return n}set element(e){this._element=e}get text(){return this.root.fullText.substring(this.offset,this.end)}};fn.AbstractCstNode=Nu;var Ou=class extends Nu{constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}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}};fn.LeafCstNodeImpl=Ou;var Iu=class extends Nu{constructor(){super(...arguments),this.children=new $u(this)}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:qw.Position.create(0,0),end:qw.Position.create(0,0)}}get firstNonHiddenNode(){for(let e of this.children)if(!e.hidden)return e;return this.children[0]}get lastNonHiddenNode(){for(let e=this.children.length-1;e>=0;e--){let r=this.children[e];if(!r.hidden)return r}return this.children[this.children.length-1]}};fn.CompositeCstNodeImpl=Iu;var $u=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,$u.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.parent=this.parent}},ld=class extends Iu{constructor(e){super(),this._text="",this._text=e??""}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}};fn.RootCstNodeImpl=ld});var Lu=b(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.isTokenTypeDictionary=Nt.isIMultiModeLexerDefinition=Nt.isTokenTypeArray=Nt.LangiumCompletionParser=Nt.LangiumParserErrorMessageProvider=Nt.LangiumParser=Nt.AbstractLangiumParser=Nt.DatatypeSymbol=void 0;var fd=ud(),cd=ot(),Uw=ir(),Hw=Ie(),lB=Gw();Nt.DatatypeSymbol=Symbol("Datatype");function yv(t){return t.$type===Nt.DatatypeSymbol}var Mu=class{constructor(e,r){this._unorderedGroups=new Map,this.lexer=new fd.Lexer(Kw(r)?Object.values(r):r),this.wrapper=new Tv(r,e.parser.ParserConfig)}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}};Nt.AbstractLangiumParser=Mu;var vv=class extends Mu{constructor(e,r){super(e,r),this.nodeBuilder=new lB.CstNodeBuilder,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}get current(){return this.stack[this.stack.length-1]}rule(e,r){let n=e.fragment?void 0:(0,Uw.isDataTypeRule)(e)?Nt.DatatypeSymbol:(0,Uw.getTypeName)(e),i=this.wrapper.DEFINE_RULE(e.name,this.startImplementation(n,r).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;let n=this.mainRule.call(this.wrapper);return this.nodeBuilder.addHiddenTokens(r.groups.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:r.errors,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{if(!this.isRecording()){let o={$type:e};this.stack.push(o),e===Nt.DatatypeSymbol&&(o.value="")}let i;try{i=r(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()){let o=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,isCrossRef:s}=this.getAssignment(n),u=this.current;if(a){let l=(0,cd.isKeyword)(n)?i.image:this.converter.convert(i.image,o);this.assign(a.operator,a.feature,l,o,s)}else if(yv(u)){let l=i.image;(0,cd.isKeyword)(n)||(l=this.converter.convert(l,o).toString()),u.value+=l}}}subrule(e,r,n,i){let o;this.isRecording()||(o=this.nodeBuilder.buildCompositeNode(n));let a=this.wrapper.wrapSubrule(e,r,i);this.isRecording()||this.performSubruleAssignment(a,n,o)}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:o}=this.getAssignment(r);if(i&&n)this.assign(i.operator,i.feature,e,n,o);else if(!i){let a=this.current;if(yv(a))a.value+=e.toString();else{let s=e.$type,u=this.assignWithoutOverride(e,a);s&&(u.$type=s);let l=u;this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&r.feature&&r.operator){n=this.construct(!1);let o=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(o)}let i={$type:e};this.stack.pop(),this.stack.push(i),r.feature&&r.operator&&this.assign(r.operator,r.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let r=this.current;return(0,Hw.linkContentToContainer)(r),this.nodeBuilder.construct(r),e&&this.stack.pop(),yv(r)?this.converter.convert(r.value,r.$cstNode):(this.assignMandatoryProperties(r),r)}assignMandatoryProperties(e){let r=this.astReflection.getTypeMetaData(e.$type);for(let n of r.mandatory){let i=e[n.name];n.type==="array"&&!Array.isArray(i)?e[n.name]=[]:n.type==="boolean"&&i===void 0&&(e[n.name]=!1)}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=(0,Hw.getContainerOfType)(e,cd.isAssignment);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?(0,cd.isCrossReference)(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let a=this.current,s;switch(o&&typeof n=="string"?s=this.linker.buildReference(a,r,i,n):s=n,e){case"=":{a[r]=s;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(s)}}assignWithoutOverride(e,r){for(let[n,i]of Object.entries(r))e[n]===void 0&&(e[n]=i);return e}get definitionErrors(){return this.wrapper.definitionErrors}};Nt.LangiumParser=vv;var dd=class{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}buildNoViableAltMessage(e){return fd.defaultParserErrorProvider.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return fd.defaultParserErrorProvider.buildEarlyExitMessage(e)}};Nt.LangiumParserErrorMessageProvider=dd;var _v=class extends Mu{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e);return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(e.name,this.startImplementation(r).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,r,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}};Nt.LangiumCompletionParser=_v;var cB={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new dd},Tv=class extends fd.EmbeddedActionsParser{constructor(e,r){super(e,Object.assign(Object.assign({},cB),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}};function Bw(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}Nt.isTokenTypeArray=Bw;function Ww(t){return t&&"modes"in t&&"defaultMode"in t}Nt.isIMultiModeLexerDefinition=Ww;function Kw(t){return!Bw(t)&&!Ww(t)}Nt.isTokenTypeDictionary=Kw});var zw=b(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.assertUnreachable=os.ErrorWithLocation=void 0;var Rv=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};os.ErrorWithLocation=Rv;function fB(t){throw new Error("Error! The input value was not handled.")}os.assertUnreachable=fB});var Av=b(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.createParser=void 0;var Vw=ud(),et=ot(),Yw=Lu(),Fu=zw(),dB=Bt(),Xw=ir(),Zw=Wt();function pB(t,e,r){let n=bB(r);return hB({parser:e,tokens:n,rules:new Map,ruleNames:new Map},t),e}hd.createParser=pB;function hB(t,e){let r=(0,Zw.getAllReachableRules)(e,!1),n=(0,dB.stream)(e.rules).filter(et.isParserRule).filter(i=>r.has(i));for(let i of n){let o=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});o.rules.set(i.name,t.parser.rule(i,Yo(o,i.definition)))}}function Yo(t,e,r=!1){let n;if((0,et.isKeyword)(e))n=RB(t,e);else if((0,et.isAction)(e))n=mB(t,e);else if((0,et.isAssignment)(e))n=Yo(t,e.terminal);else if((0,et.isCrossReference)(e))n=Jw(t,e);else if((0,et.isRuleCall)(e))n=gB(t,e);else if((0,et.isAlternatives)(e))n=vB(t,e);else if((0,et.isUnorderedGroup)(e))n=_B(t,e);else if((0,et.isGroup)(e))n=TB(t,e);else throw new Fu.ErrorWithLocation(e.$cstNode,`Unexpected element type: ${e.$type}`);return eS(t,r?void 0:pd(e),n,e.cardinality)}function mB(t,e){let r=(0,Xw.getTypeName)(e);return()=>t.parser.action(r,e)}function gB(t,e){let r=e.rule.ref;if((0,et.isParserRule)(r)){let n=t.subrule++,i=e.arguments.length>0?yB(r,e.arguments):()=>({});return o=>t.parser.subrule(n,tS(t,r),e,i(o))}else if((0,et.isTerminalRule)(r)){let n=t.consume++,i=bv(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)(0,Fu.assertUnreachable)(r);else throw new Fu.ErrorWithLocation(e.$cstNode,`Undefined rule type: ${e.$type}`)}function yB(t,e){let r=e.map(n=>Ui(n.value));return n=>{let i={};for(let o=0;o<r.length;o++){let a=t.parameters[o],s=r[o];i[a.name]=s(n)}return i}}function Ui(t){if((0,et.isDisjunction)(t)){let e=Ui(t.left),r=Ui(t.right);return n=>e(n)||r(n)}else if((0,et.isConjunction)(t)){let e=Ui(t.left),r=Ui(t.right);return n=>e(n)&&r(n)}else if((0,et.isNegation)(t)){let e=Ui(t.value);return r=>!e(r)}else if((0,et.isParameterReference)(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if((0,et.isLiteralCondition)(t)){let e=!!t.true;return()=>e}(0,Fu.assertUnreachable)(t)}function vB(t,e){if(e.elements.length===1)return Yo(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Yo(t,i,!0)},a=pd(i);a&&(o.GATE=Ui(a)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let a={ALT:()=>o.ALT(i)},s=o.GATE;return s&&(a.GATE=()=>s(i)),a}))}}function _B(t,e){if(e.elements.length===1)return Yo(t,e.elements[0]);let r=[];for(let s of e.elements){let u={ALT:Yo(t,s,!0)},l=pd(s);l&&(u.GATE=Ui(l)),r.push(u)}let n=t.or++,i=(s,u)=>{let l=u.getRuleStack().join("-");return`uGroup_${s}_${l}`},o=s=>t.parser.alternatives(n,r.map((u,l)=>{let c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(u.ALT(s),!f.isRecording()){let h=i(n,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);let d=f.unorderedGroups.get(h);typeof d?.[l]>"u"&&(d[l]=!0)}};let p=u.GATE;return p?c.GATE=()=>p(s):c.GATE=()=>{let h=f.unorderedGroups.get(i(n,f));return!h?.[l]},c})),a=eS(t,pd(e),o,"*");return s=>{a(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function TB(t,e){let r=e.elements.map(n=>Yo(t,n));return n=>r.forEach(i=>i(n))}function pd(t){if((0,et.isGroup)(t))return t.guardCondition}function Jw(t,e,r=e.terminal){if(r)if((0,et.isRuleCall)(r)&&(0,et.isParserRule)(r.rule.ref)){let n=t.subrule++;return i=>t.parser.subrule(n,tS(t,r.rule.ref),e,i)}else if((0,et.isRuleCall)(r)&&(0,et.isTerminalRule)(r.rule.ref)){let n=t.consume++,i=bv(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if((0,et.isKeyword)(r)){let n=t.consume++,i=bv(t,r.value);return i.name=Qw(i.name),()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=(0,Zw.findNameAssignment)(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+(0,Xw.getTypeName)(e.type.ref));return Jw(t,e,i)}}var Qw=t=>t.endsWith(":KW")?t:t+":KW";function RB(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return n.name=Qw(n.name),()=>t.parser.consume(r,n,e)}function eS(t,e,r,n){let i=e&&Ui(e);if(!n)if(i){let o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>r(a),GATE:()=>i(a)},{ALT:(0,Vw.EMPTY_ALT)(),GATE:()=>!i(a)}])}else return r;if(n==="*"){let o=t.many++;return a=>t.parser.many(o,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else if(n==="+"){let o=t.many++;if(i){let a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(s)}),GATE:()=>i(s)},{ALT:(0,Vw.EMPTY_ALT)(),GATE:()=>!i(s)}])}else return a=>t.parser.atLeastOne(o,{DEF:()=>r(a)})}else if(n==="?"){let o=t.optional++;return a=>t.parser.optional(o,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else(0,Fu.assertUnreachable)(n)}function bB(t){if((0,Yw.isTokenTypeDictionary)(t))return t;let e=(0,Yw.isIMultiModeLexerDefinition)(t)?Object.values(t.modes).flat():t,r={};return e.forEach(n=>r[n.name]=n),r}function tS(t,e){let r=AB(t,e),n=t.rules.get(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function AB(t,e){if((0,et.isParserRule)(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!(0,et.isParserRule)(n);)((0,et.isGroup)(n)||(0,et.isAlternatives)(n)||(0,et.isUnorderedGroup)(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function bv(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}});var rS=b(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.createCompletionParser=void 0;var EB=Lu(),CB=Av();function xB(t){let e=t.Grammar,r=t.parser.TokenBuilder.buildTokens(e,{caseInsensitive:t.LanguageMetaData.caseInsensitive}),n=new EB.LangiumCompletionParser(t,r);return(0,CB.createParser)(e,n,r),n.finalize(),n}md.createCompletionParser=xB});var Ev=b(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.prepareLangiumParser=as.createLangiumParser=void 0;var wB=Lu(),SB=Av();function kB(t){let e=nS(t);return e.finalize(),e}as.createLangiumParser=kB;function nS(t){let e=t.Grammar,r=t.parser.TokenBuilder.buildTokens(e,{caseInsensitive:t.LanguageMetaData.caseInsensitive}),n=new wB.LangiumParser(t,r);return(0,SB.createParser)(e,n,r)}as.prepareLangiumParser=nS});var wv=b(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.DefaultTokenBuilder=void 0;var PB=ud(),Cv=ot(),DB=ir(),NB=Ie(),OB=Wt(),gd=Fa(),IB=Bt(),xv=class{buildTokens(e,r){let n=(0,IB.stream)((0,OB.getAllReachableRules)(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return i.forEach(a=>{let s=a.PATTERN;typeof s=="object"&&s&&"test"in s&&(0,gd.isWhitespaceRegExp)(s)?o.unshift(a):o.push(a)}),o}buildTerminalTokens(e){return e.filter(Cv.isTerminalRule).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=(0,DB.terminalRegex)(e),n={name:e.name,PATTERN:new RegExp(r)};return e.hidden&&(n.GROUP=(0,gd.isWhitespaceRegExp)(r)?PB.Lexer.SKIPPED:"hidden"),n}buildKeywordTokens(e,r,n){return e.filter(Cv.isParserRule).flatMap(i=>(0,NB.streamAllContents)(i).filter(Cv.isKeyword)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,r)}}buildKeywordPattern(e,r){return r?new RegExp((0,gd.getCaseInsensitivePattern)(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&(0,gd.partialMatches)("^"+o.source+"$",e.value)&&n.push(i),n},[])}};yd.DefaultTokenBuilder=xv});var Pv=b(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.convertBoolean=Xt.convertNumber=Xt.convertDate=Xt.convertBigint=Xt.convertInt=Xt.convertID=Xt.convertString=Xt.DefaultValueConverter=void 0;var iS=ot(),$B=ir(),MB=Wt(),Sv=class{convert(e,r){let n=r.feature;if((0,iS.isCrossReference)(n)&&(n=(0,MB.getCrossReferenceTerminal)(n)),(0,iS.isRuleCall)(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return aS(r);case"STRING":return kv(r);case"ID":return oS(r);case"REGEXLITERAL":return kv(r)}switch((i=(0,$B.getRuleType)(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return lS(r);case"boolean":return cS(r);case"bigint":return sS(r);case"date":return uS(r);default:return r}}};Xt.DefaultValueConverter=Sv;function kv(t){return t.substring(1,t.length-1)}Xt.convertString=kv;function oS(t){return t.charAt(0)==="^"?t.substring(1):t}Xt.convertID=oS;function aS(t){return parseInt(t)}Xt.convertInt=aS;function sS(t){return BigInt(t)}Xt.convertBigint=sS;function uS(t){return new Date(t)}Xt.convertDate=uS;function lS(t){return Number(t)}Xt.convertNumber=lS;function cS(t){return t.toLowerCase()==="true"}Xt.convertBoolean=cS});var Nv=b(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.DefaultLinker=void 0;var LB=Xe(),Hi=Ie(),FB=In(),fS=Ho(),Dv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=LB.CancellationToken.None){for(let n of(0,Hi.streamAst)(e.parseResult.value))await(0,FB.interruptAndCheck)(r),(0,Hi.streamReferences)(n).forEach(i=>this.doLink(i,e));e.state=fS.DocumentState.Linked}doLink(e,r){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if((0,Hi.isLinkingError)(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}r.references.push(n)}unlink(e){for(let r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,a={$refNode:n,$refText:i,get ref(){var s;if((0,Hi.isAstNode)(this._ref))return this._ref;if((0,Hi.isAstNodeDescription)(this._nodeDescription)){let u=o.loadAstNode(this._nodeDescription);this._ref=u??o.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){let u=o.getLinkedNode({reference:a,container:e,property:r});this._ref=(s=u.node)!==null&&s!==void 0?s:u.error,this._nodeDescription=u.descr}return(0,Hi.isAstNode)(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return(0,Hi.isLinkingError)(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){try{let r=this.getCandidate(e);if((0,Hi.isLinkingError)(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getOrCreateDocument(e.documentUri);return this.astNodeLocator.getAstNode(r,e.path)}createLinkingError(e,r){let n=(0,Hi.getDocument)(e.container);n.state<fS.DocumentState.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}};vd.DefaultLinker=Dv});var Iv=b(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.DefaultJsonSerializer=void 0;var _d=Ie(),Ov=class{constructor(e){this.ignoreProperties=["$container","$containerProperty","$containerIndex","$document","$cstNode"],this.linker=e.references.Linker}serialize(e,r){return JSON.stringify(this.decycle(e,this.ignoreProperties),void 0,r)}deserialize(e){return this.revive(JSON.parse(e))}decycle(e,r){let n=new Set,i=o=>{if(typeof o=="object"&&o!==null){if(n.has(o))throw new Error("Cycle in ast detected.");if(n.add(o),(0,_d.isReference)(o))return{$refText:o.$refText};let a;if(Array.isArray(o)){a=[];for(let s=0;s<o.length;s++)a[s]=i(o[s])}else{a={};for(let[s,u]of Object.entries(o))r.includes(s)||(a[s]=i(u))}return a}return o};return i(e)}revive(e){let r=(n,i,o)=>{if(Array.isArray(n))for(let a=0;a<n.length;a++){let s=n[a];if((0,_d.isReference)(s)&&(0,_d.isAstNode)(i)){let u=this.linker.buildReference(i,o,s.$refNode,s.$refText);n[a]=u}else typeof s=="object"&&s!==null&&(r(s),s.$container=i,s.$containerProperty=o,s.$containerIndex=a)}else if(typeof n=="object"&&n!==null){for(let[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null)if((0,_d.isReference)(s)){let u=this.linker.buildReference(n,a,s.$refNode,s.$refText);n[a]=u}else Array.isArray(s)?r(s,n,a):(r(s),s.$container=n,s.$containerProperty=a)}};return r(e),e}};Td.DefaultJsonSerializer=Ov});var Mv=b(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.DefaultServiceRegistry=void 0;var qB=$n(),$v=class{register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let r of this.singleton.LanguageMetaData.fileExtensions)this.map[r]=this.singleton;this.singleton=void 0}for(let r of e.LanguageMetaData.fileExtensions)this.map[r]!==void 0&&this.map[r]!==e&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[r]=e}getServices(e){if(this.singleton!==void 0)return this.singleton;if(this.map===void 0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=qB.Utils.extname(e),n=this.map[r];if(!n)throw new Error(`The service registry contains no services for the extension '${r}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}};Rd.DefaultServiceRegistry=$v});var qv=b(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.DefaultReferenceDescriptionProvider=ss.DefaultAstNodeDescriptionProvider=void 0;var jB=Xe(),qu=Ie(),GB=pt(),UB=In(),HB=uo(),Lv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator}createDescription(e,r,n=(0,qu.getDocument)(e)){return{node:e,name:r,type:e.$type,documentUri:n.uri,path:this.astNodeLocator.getAstNodePath(e)}}createDescriptions(){throw new Error("Deprecated: This method has been moved to the `ScopeComputation` service and renamed to `computeExports`.")}};ss.DefaultAstNodeDescriptionProvider=Lv;var Fv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=jB.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of(0,qu.streamAst)(i))await(0,UB.interruptAndCheck)(r),(0,qu.streamReferences)(o).filter(a=>!(0,qu.isLinkingError)(a)).forEach(a=>{let s=a.reference.$nodeDescription;s&&n.push(this.createDescription(a,s))});return n}createDescription(e,r){let n=(0,qu.getDocument)(e.container).uri,i=e.reference.$refNode;return{sourceUri:n,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:(0,GB.toDocumentSegment)(i),local:(0,HB.equalURI)(r.documentUri,n)}}};ss.DefaultReferenceDescriptionProvider=Fv});var dS=b(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.DefaultAstNodeLocator=void 0;var jv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let a=o.indexOf(this.indexSeparator);if(a>0){let s=o.substring(0,a),u=parseInt(o.substring(a+1));return i[s][u]}return i[o]},e.parseResult.value)}};bd.DefaultAstNodeLocator=jv});var Uv=b(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.DefaultConfigurationProvider=void 0;var BB=Lt(),Gv=class{constructor(e){this.settings={},this.workspaceConfig=!1,this.initialized=!1,this.serviceRegistry=e.ServiceRegistry,this.connection=e.lsp.Connection,e.lsp.LanguageServer.onInitialize(r=>{var n,i;this.workspaceConfig=(i=(n=r.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&i!==void 0?i:!1}),e.lsp.LanguageServer.onInitialized(r=>{var n;let i=this.serviceRegistry.all;(n=e.lsp.Connection)===null||n===void 0||n.client.register(BB.DidChangeConfigurationNotification.type,{section:i.map(o=>this.toSectionName(o.LanguageMetaData.languageId))})})}async initialize(){if(this.workspaceConfig&&this.connection){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await this.connection.workspace.getConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}this.initialized=!0}updateConfiguration(e){!e.settings||Object.keys(e.settings).forEach(r=>{this.updateSectionConfiguration(r,e.settings[r])})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){this.initialized||await this.initialize();let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}};Ad.DefaultConfigurationProvider=Gv});var Wv=b(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.DefaultDocumentBuilder=void 0;var Ed=Xe(),WB=tn(),Hv=In(),Bi=Ho(),Bv=class{constructor(e){this.updateListeners=[],this.buildPhaseListeners=new WB.MultiMap,this.langiumDocuments=e.workspace.LangiumDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Ed.CancellationToken.None){await this.buildDocuments(e,r,n)}async update(e,r,n=Ed.CancellationToken.None){for(let s of r)this.langiumDocuments.invalidateDocument(s);this.indexManager.remove(r);for(let s of e)this.langiumDocuments.invalidateDocument(s);for(let s of this.updateListeners)s(e,r);await(0,Hv.interruptAndCheck)(n);let i=e.map(s=>this.langiumDocuments.getOrCreateDocument(s)),o=this.collectDocuments(i,r),a={validationChecks:"all"};await this.buildDocuments(o,a,n)}onUpdate(e){return this.updateListeners.push(e),Ed.Disposable.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}collectDocuments(e,r){let n=e.map(a=>a.uri).concat(r),i=this.indexManager.getAffectedDocuments(n).toArray();i.forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,Bi.DocumentState.ComputedScopes)});let o=new Set([...e,...i,...this.langiumDocuments.all.filter(a=>a.state<Bi.DocumentState.Validated)]);return Array.from(o)}async buildDocuments(e,r,n){await this.runCancelable(e,Bi.DocumentState.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,Bi.DocumentState.ComputedScopes,n,o=>this.computeScopes(o,n)),await this.runCancelable(e,Bi.DocumentState.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(e,Bi.DocumentState.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));let i=e.filter(o=>this.shouldValidate(o,r));await this.runCancelable(i,Bi.DocumentState.Validated,n,o=>this.validate(o,n))}async runCancelable(e,r,n,i){let o=e.filter(a=>a.state<r);for(let a of o)await(0,Hv.interruptAndCheck)(n),await i(a);await this.notifyBuildPhase(o,r,n)}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ed.Disposable.create(()=>{this.buildPhaseListeners.delete(e,r)})}async notifyBuildPhase(e,r,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(r);for(let o of i)await(0,Hv.interruptAndCheck)(n),await o(e,n)}async computeScopes(e,r){let n=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await n.computeLocalScopes(e,r),e.state=Bi.DocumentState.ComputedScopes}shouldValidate(e,r){return r.validationChecks==="all"}async validate(e,r){let i=await this.serviceRegistry.getServices(e.uri).validation.DocumentValidator.validateDocument(e,r);e.diagnostics=i,e.state=Bi.DocumentState.Validated}};Cd.DefaultDocumentBuilder=Bv});var Yv=b(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.DefaultIndexManager=void 0;var pS=Xe(),KB=Ie(),Kv=Bt(),zv=uo(),hS=Ho(),Vv=class{constructor(e){this.simpleIndex=new Map,this.referenceIndex=new Map,this.globalScopeCache=new Map,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection,this.langiumDocuments=()=>e.workspace.LangiumDocuments}findAllReferences(e,r){let n=(0,KB.getDocument)(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(a=>{(0,zv.equalURI)(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),(0,Kv.stream)(i)}allElements(e=""){this.globalScopeCache.has("")||this.globalScopeCache.set("",Array.from(this.simpleIndex.values()).flat());let r=this.globalScopeCache.get(e);if(r)return(0,Kv.stream)(r);{let n=this.globalScopeCache.get("").filter(i=>this.astReflection.isSubtype(i.type,e));return this.globalScopeCache.set(e,n),(0,Kv.stream)(n)}}remove(e){for(let r of e){let n=r.toString();this.simpleIndex.delete(n),this.referenceIndex.delete(n)}}async updateContent(e,r=pS.CancellationToken.None){this.globalScopeCache.clear();let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r);for(let o of i)o.node=void 0;this.simpleIndex.set(e.uri.toString(),i),e.state=hS.DocumentState.IndexedContent}async updateReferences(e,r=pS.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i),e.state=hS.DocumentState.IndexedReferences}getAffectedDocuments(e){return this.langiumDocuments().all.filter(r=>{if(e.some(n=>(0,zv.equalURI)(r.uri,n)))return!1;for(let n of e)if(this.isAffected(r,n))return!0;return!1})}isAffected(e,r){let n=r.toString(),i=e.uri.toString();if(e.references.some(a=>a.error!==void 0))return!0;let o=this.referenceIndex.get(i);return o?o.filter(a=>!a.local).some(a=>(0,zv.equalURI)(a.targetUri,n)):!1}};xd.DefaultIndexManager=Vv});var Jv=b(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.DefaultWorkspaceManager=void 0;var zB=Xe(),Xv=$n(),VB=In(),Zv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.MutexLock,e.lsp.LanguageServer.onInitialize(r=>{var n;this.folders=(n=r.workspaceFolders)!==null&&n!==void 0?n:void 0}),e.lsp.LanguageServer.onInitialized(r=>{this.mutex.lock(n=>{var i;return this.initializeWorkspace((i=this.folders)!==null&&i!==void 0?i:[],n)})})}async initializeWorkspace(e,r=zB.CancellationToken.None){let n=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),i=[],o=a=>{i.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,o),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,n,o))),await(0,VB.interruptAndCheck)(r),await this.documentBuilder.build(i,void 0,r)}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Xv.URI.parse(e.uri)}async traverseFolder(e,r,n,i){let o=await this.fileSystemProvider.readDirectory(r);await Promise.all(o.map(async a=>{if(this.includeEntry(e,a,n)){if(a.isDirectory)await this.traverseFolder(e,a.uri,n,i);else if(a.isFile){let s=this.langiumDocuments.getOrCreateDocument(a.uri);i(s)}}}))}includeEntry(e,r,n){let i=Xv.Utils.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){let o=Xv.Utils.extname(r.uri);return n.includes(o)}return!1}};wd.DefaultWorkspaceManager=Zv});var Af=b(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.createDefaultSharedModule=us.createDefaultModule=void 0;var YB=Xe(),XB=_c(),ZB=fC(),JB=rS(),QB=Zg(),e2=Qg(),t2=ty(),r2=Vc(),n2=iy(),i2=ay(),o2=gy(),a2=vy(),s2=Ty(),u2=Ev(),l2=wv(),c2=Pv(),f2=Nv(),d2=Ua(),p2=Hg(),h2=Pc(),m2=Nc(),g2=Iv(),y2=Mv(),v2=In(),_2=Kc(),T2=qc(),mS=qv(),R2=dS(),b2=Uv(),A2=Wv(),Qv=Ho(),E2=Yv(),C2=Jv();function x2(t){return{parser:{GrammarConfig:e=>(0,ZB.createGrammarConfig)(e),LangiumParser:e=>(0,u2.createLangiumParser)(e),CompletionParser:e=>(0,JB.createCompletionParser)(e),ValueConverter:()=>new c2.DefaultValueConverter,TokenBuilder:()=>new l2.DefaultTokenBuilder},lsp:{CompletionProvider:e=>new QB.DefaultCompletionProvider(e),DocumentSymbolProvider:e=>new t2.DefaultDocumentSymbolProvider(e),HoverProvider:e=>new i2.MultilineCommentHoverProvider(e),FoldingRangeProvider:e=>new r2.DefaultFoldingRangeProvider(e),ReferencesProvider:e=>new a2.DefaultReferencesProvider(e),DefinitionProvider:e=>new n2.DefaultDefinitionProvider(e),DocumentHighlightProvider:e=>new e2.DefaultDocumentHighlightProvider(e),RenameProvider:e=>new s2.DefaultRenameProvider(e)},workspace:{AstNodeLocator:()=>new R2.DefaultAstNodeLocator,AstNodeDescriptionProvider:e=>new mS.DefaultAstNodeDescriptionProvider(e),ReferenceDescriptionProvider:e=>new mS.DefaultReferenceDescriptionProvider(e)},references:{Linker:e=>new f2.DefaultLinker(e),NameProvider:()=>new d2.DefaultNameProvider,ScopeProvider:e=>new m2.DefaultScopeProvider(e),ScopeComputation:e=>new h2.DefaultScopeComputation(e),References:e=>new p2.DefaultReferences(e)},serializer:{JsonSerializer:e=>new g2.DefaultJsonSerializer(e)},validation:{DocumentValidator:e=>new _2.DefaultDocumentValidator(e),ValidationRegistry:e=>new T2.ValidationRegistry(e)},shared:()=>t.shared}}us.createDefaultModule=x2;function w2(t){return{ServiceRegistry:()=>new y2.DefaultServiceRegistry,lsp:{Connection:()=>t.connection,LanguageServer:e=>new o2.DefaultLanguageServer(e)},workspace:{LangiumDocuments:e=>new Qv.DefaultLangiumDocuments(e),LangiumDocumentFactory:e=>new Qv.DefaultLangiumDocumentFactory(e),DocumentBuilder:e=>new A2.DefaultDocumentBuilder(e),TextDocuments:()=>new YB.TextDocuments(XB.TextDocument),TextDocumentFactory:e=>new Qv.DefaultTextDocumentFactory(e),IndexManager:e=>new E2.DefaultIndexManager(e),WorkspaceManager:e=>new C2.DefaultWorkspaceManager(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new v2.MutexLock,ConfigurationProvider:e=>new b2.DefaultConfigurationProvider(e)}}}us.createDefaultSharedModule=w2});var gS=b(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.s=void 0;var S2=/^(s*\n)+/,k2=/\n/g,P2=/\S|$/;function D2(t,...e){let r=e.reduce((i,o,a)=>i+N2(String(o),i)+t[a+1],t[0]).split(`
3738
- `).map(i=>i.trimRight()),n=O2(r);return r.map(i=>i.slice(n).trimRight()).join(`
3739
- `).trimRight().replace(S2,"")}Sd.s=D2;function N2(t,e){let r=Math.max(0,e.length-e.lastIndexOf(`
3740
- `)-1),n=" ".repeat(r);return t.replace(k2,`
3741
- `+n)}function O2(t){let e=t.filter(n=>n.length>0).map(n=>n.search(P2)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}});var vS=b(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0})});var TS=b(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0})});var bS=b(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0})});var go=b(se=>{"use strict";var AS=se&&se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),I2=se&&se.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ye=se&&se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AS(e,t,r)},$2=se&&se.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AS(e,t,r);return I2(e,t),e};Object.defineProperty(se,"__esModule",{value:!0});se.GrammarAST=void 0;ye(Af(),se);ye(eu(),se);ye($c(),se);ye(Ym(),se);ye(gS(),se);ye(Py(),se);ye(bf(),se);ye(vS(),se);ye(by(),se);ye(Lu(),se);ye(Ev(),se);ye(TS(),se);ye(wv(),se);ye(Pv(),se);ye(Nv(),se);ye(Ua(),se);ye(Pc(),se);ye(Nc(),se);ye(Iv(),se);ye(Mv(),se);ye(bS(),se);ye(Pa(),se);ye(Ie(),se);ye(tn(),se);ye(pt(),se);ye(Wt(),se);ye(In(),se);ye(uo(),se);ye(Fa(),se);ye(Bt(),se);ye(Kc(),se);ye(qc(),se);ye(qv(),se);ye(Wv(),se);ye(Ho(),se);ye(Yv(),se);ye(Ec(),se);ye(Jv(),se);ye(Uv(),se);var M2=$2(ot());se.GrammarAST=M2});var e_=b(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.isGenerator=E.Generator=E.isFunctionParamType=E.FunctionParamType=E.isFunctionParam=E.FunctionParam=E.isFunction=E.Function=E.isEnumField=E.EnumField=E.isEnum=E.Enum=E.isDataSourceField=E.DataSourceField=E.isDataSource=E.DataSource=E.isDataModelFieldType=E.DataModelFieldType=E.isDataModelFieldAttribute=E.DataModelFieldAttribute=E.isDataModelField=E.DataModelField=E.isDataModelAttribute=E.DataModelAttribute=E.isDataModel=E.DataModel=E.isBinaryExpr=E.BinaryExpr=E.isAttributeParamType=E.AttributeParamType=E.isAttributeParam=E.AttributeParam=E.isAttributeAttribute=E.AttributeAttribute=E.isAttributeArg=E.AttributeArg=E.isAttribute=E.Attribute=E.isArrayExpr=E.ArrayExpr=E.isArgument=E.Argument=E.isTypeDeclaration=E.TypeDeclaration=E.isReferenceTarget=E.ReferenceTarget=E.isExpression=E.Expression=E.isAbstractDeclaration=E.AbstractDeclaration=void 0;E.reflection=E.ZModelAstReflection=E.isUnaryExpr=E.UnaryExpr=E.isThisExpr=E.ThisExpr=E.isReferenceExpr=E.ReferenceExpr=E.isReferenceArg=E.ReferenceArg=E.isPluginField=E.PluginField=E.isPlugin=E.Plugin=E.isNullExpr=E.NullExpr=E.isModel=E.Model=E.isMemberAccessExpr=E.MemberAccessExpr=E.isLiteralExpr=E.LiteralExpr=E.isInvocationExpr=E.InvocationExpr=E.isGeneratorField=E.GeneratorField=void 0;var L2=go();E.AbstractDeclaration="AbstractDeclaration";function F2(t){return E.reflection.isInstance(t,E.AbstractDeclaration)}E.isAbstractDeclaration=F2;E.Expression="Expression";function q2(t){return E.reflection.isInstance(t,E.Expression)}E.isExpression=q2;E.ReferenceTarget="ReferenceTarget";function j2(t){return E.reflection.isInstance(t,E.ReferenceTarget)}E.isReferenceTarget=j2;E.TypeDeclaration="TypeDeclaration";function G2(t){return E.reflection.isInstance(t,E.TypeDeclaration)}E.isTypeDeclaration=G2;E.Argument="Argument";function U2(t){return E.reflection.isInstance(t,E.Argument)}E.isArgument=U2;E.ArrayExpr="ArrayExpr";function H2(t){return E.reflection.isInstance(t,E.ArrayExpr)}E.isArrayExpr=H2;E.Attribute="Attribute";function B2(t){return E.reflection.isInstance(t,E.Attribute)}E.isAttribute=B2;E.AttributeArg="AttributeArg";function W2(t){return E.reflection.isInstance(t,E.AttributeArg)}E.isAttributeArg=W2;E.AttributeAttribute="AttributeAttribute";function K2(t){return E.reflection.isInstance(t,E.AttributeAttribute)}E.isAttributeAttribute=K2;E.AttributeParam="AttributeParam";function z2(t){return E.reflection.isInstance(t,E.AttributeParam)}E.isAttributeParam=z2;E.AttributeParamType="AttributeParamType";function V2(t){return E.reflection.isInstance(t,E.AttributeParamType)}E.isAttributeParamType=V2;E.BinaryExpr="BinaryExpr";function Y2(t){return E.reflection.isInstance(t,E.BinaryExpr)}E.isBinaryExpr=Y2;E.DataModel="DataModel";function X2(t){return E.reflection.isInstance(t,E.DataModel)}E.isDataModel=X2;E.DataModelAttribute="DataModelAttribute";function Z2(t){return E.reflection.isInstance(t,E.DataModelAttribute)}E.isDataModelAttribute=Z2;E.DataModelField="DataModelField";function J2(t){return E.reflection.isInstance(t,E.DataModelField)}E.isDataModelField=J2;E.DataModelFieldAttribute="DataModelFieldAttribute";function Q2(t){return E.reflection.isInstance(t,E.DataModelFieldAttribute)}E.isDataModelFieldAttribute=Q2;E.DataModelFieldType="DataModelFieldType";function eW(t){return E.reflection.isInstance(t,E.DataModelFieldType)}E.isDataModelFieldType=eW;E.DataSource="DataSource";function tW(t){return E.reflection.isInstance(t,E.DataSource)}E.isDataSource=tW;E.DataSourceField="DataSourceField";function rW(t){return E.reflection.isInstance(t,E.DataSourceField)}E.isDataSourceField=rW;E.Enum="Enum";function nW(t){return E.reflection.isInstance(t,E.Enum)}E.isEnum=nW;E.EnumField="EnumField";function iW(t){return E.reflection.isInstance(t,E.EnumField)}E.isEnumField=iW;E.Function="Function";function oW(t){return E.reflection.isInstance(t,E.Function)}E.isFunction=oW;E.FunctionParam="FunctionParam";function aW(t){return E.reflection.isInstance(t,E.FunctionParam)}E.isFunctionParam=aW;E.FunctionParamType="FunctionParamType";function sW(t){return E.reflection.isInstance(t,E.FunctionParamType)}E.isFunctionParamType=sW;E.Generator="Generator";function uW(t){return E.reflection.isInstance(t,E.Generator)}E.isGenerator=uW;E.GeneratorField="GeneratorField";function lW(t){return E.reflection.isInstance(t,E.GeneratorField)}E.isGeneratorField=lW;E.InvocationExpr="InvocationExpr";function cW(t){return E.reflection.isInstance(t,E.InvocationExpr)}E.isInvocationExpr=cW;E.LiteralExpr="LiteralExpr";function fW(t){return E.reflection.isInstance(t,E.LiteralExpr)}E.isLiteralExpr=fW;E.MemberAccessExpr="MemberAccessExpr";function dW(t){return E.reflection.isInstance(t,E.MemberAccessExpr)}E.isMemberAccessExpr=dW;E.Model="Model";function pW(t){return E.reflection.isInstance(t,E.Model)}E.isModel=pW;E.NullExpr="NullExpr";function hW(t){return E.reflection.isInstance(t,E.NullExpr)}E.isNullExpr=hW;E.Plugin="Plugin";function mW(t){return E.reflection.isInstance(t,E.Plugin)}E.isPlugin=mW;E.PluginField="PluginField";function gW(t){return E.reflection.isInstance(t,E.PluginField)}E.isPluginField=gW;E.ReferenceArg="ReferenceArg";function yW(t){return E.reflection.isInstance(t,E.ReferenceArg)}E.isReferenceArg=yW;E.ReferenceExpr="ReferenceExpr";function vW(t){return E.reflection.isInstance(t,E.ReferenceExpr)}E.isReferenceExpr=vW;E.ThisExpr="ThisExpr";function _W(t){return E.reflection.isInstance(t,E.ThisExpr)}E.isThisExpr=_W;E.UnaryExpr="UnaryExpr";function TW(t){return E.reflection.isInstance(t,E.UnaryExpr)}E.isUnaryExpr=TW;var kd=class{getAllTypes(){return["AbstractDeclaration","Argument","ArrayExpr","Attribute","AttributeArg","AttributeAttribute","AttributeParam","AttributeParamType","BinaryExpr","DataModel","DataModelAttribute","DataModelField","DataModelFieldAttribute","DataModelFieldType","DataSource","DataSourceField","Enum","EnumField","Expression","Function","FunctionParam","FunctionParamType","Generator","GeneratorField","InvocationExpr","LiteralExpr","MemberAccessExpr","Model","NullExpr","Plugin","PluginField","ReferenceArg","ReferenceExpr","ReferenceTarget","ThisExpr","TypeDeclaration","UnaryExpr"]}isInstance(e,r){return(0,L2.isAstNode)(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;switch(e){case E.ArrayExpr:case E.BinaryExpr:case E.InvocationExpr:case E.LiteralExpr:case E.MemberAccessExpr:case E.NullExpr:case E.ReferenceExpr:case E.ThisExpr:case E.UnaryExpr:return this.isSubtype(E.Expression,r);case E.Attribute:case E.DataSource:case E.Function:case E.Generator:case E.Plugin:return this.isSubtype(E.AbstractDeclaration,r);case E.DataModel:case E.Enum:return this.isSubtype(E.AbstractDeclaration,r)||this.isSubtype(E.TypeDeclaration,r);case E.DataModelField:case E.EnumField:case E.FunctionParam:return this.isSubtype(E.ReferenceTarget,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"AttributeAttribute:decl":return E.Attribute;case"AttributeParamType:reference":return E.TypeDeclaration;case"DataModelAttribute:decl":return E.Attribute;case"DataModelFieldAttribute:decl":return E.Attribute;case"DataModelFieldType:reference":return E.TypeDeclaration;case"FunctionParamType:reference":return E.TypeDeclaration;case"InvocationExpr:function":return E.Function;case"MemberAccessExpr:member":return E.DataModelField;case"ReferenceExpr:target":return E.ReferenceTarget;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"ArrayExpr":return{name:"ArrayExpr",mandatory:[{name:"items",type:"array"}]};case"Attribute":return{name:"Attribute",mandatory:[{name:"attributes",type:"array"},{name:"params",type:"array"}]};case"AttributeAttribute":return{name:"AttributeAttribute",mandatory:[{name:"args",type:"array"}]};case"AttributeParam":return{name:"AttributeParam",mandatory:[{name:"default",type:"boolean"}]};case"AttributeParamType":return{name:"AttributeParamType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataModel":return{name:"DataModel",mandatory:[{name:"attributes",type:"array"},{name:"fields",type:"array"}]};case"DataModelAttribute":return{name:"DataModelAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelField":return{name:"DataModelField",mandatory:[{name:"attributes",type:"array"}]};case"DataModelFieldAttribute":return{name:"DataModelFieldAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelFieldType":return{name:"DataModelFieldType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataSource":return{name:"DataSource",mandatory:[{name:"fields",type:"array"}]};case"Enum":return{name:"Enum",mandatory:[{name:"fields",type:"array"}]};case"Function":return{name:"Function",mandatory:[{name:"params",type:"array"}]};case"FunctionParamType":return{name:"FunctionParamType",mandatory:[{name:"array",type:"boolean"}]};case"Generator":return{name:"Generator",mandatory:[{name:"fields",type:"array"}]};case"InvocationExpr":return{name:"InvocationExpr",mandatory:[{name:"args",type:"array"}]};case"Model":return{name:"Model",mandatory:[{name:"declarations",type:"array"}]};case"Plugin":return{name:"Plugin",mandatory:[{name:"fields",type:"array"}]};case"ReferenceExpr":return{name:"ReferenceExpr",mandatory:[{name:"args",type:"array"}]};default:return{name:e,mandatory:[]}}}};E.ZModelAstReflection=kd;E.reflection=new kd});var ES=b(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.ZModelGrammar=void 0;var RW=go(),Pd,bW=()=>Pd!=null?Pd:Pd=(0,RW.loadGrammarFromJson)(`{
3736
+ Please avoid using it as it will be completely removed in the future`)}Y.clearCache=iB;var oB=Mw();Object.defineProperty(Y,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return oB.createSyntaxDiagramsCode}});var aB=function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
3737
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t}();Y.Parser=aB});var Gw=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.RootCstNodeImpl=fn.CompositeCstNodeImpl=fn.LeafCstNodeImpl=fn.AbstractCstNode=fn.CstNodeBuilder=void 0;var qw=Ta(),sB=Pa(),jw=pt(),gv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new ld(e),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Iu;return r.feature=e,r.root=this.rootNode,this.current.children.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new Ou(e.startOffset,e.image.length,(0,jw.tokenToRange)(e),e.tokenType,!1);return n.feature=r,n.root=this.rootNode,this.current.children.push(n),n}removeNode(e){let r=e.parent;if(r){let n=r.children.indexOf(e);n>=0&&r.children.splice(n,1)}}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.element=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.children.length===0&&this.removeNode(n)}addHiddenTokens(e){if(e)for(let r of e){let n=new Ou(r.startOffset,r.image.length,(0,jw.tokenToRange)(r),r.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,r){let{offset:n,end:i}=r;for(let o=0;o<e.children.length;o++){let a=e.children[o],{offset:s,end:u}=a;if((0,sB.isCompositeCstNode)(a)&&n>s&&i<u){this.addHiddenToken(a,r);return}else if(i<=s){e.children.splice(o,0,r);return}}e.children.push(r)}};fn.CstNodeBuilder=gv;var Nu=class{get hidden(){return!1}get element(){var e,r;let n=typeof((e=this._element)===null||e===void 0?void 0:e.$type)=="string"?this._element:(r=this.parent)===null||r===void 0?void 0:r.element;if(!n)throw new Error("This node has no associated AST element");return n}set element(e){this._element=e}get text(){return this.root.fullText.substring(this.offset,this.end)}};fn.AbstractCstNode=Nu;var Ou=class extends Nu{constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}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}};fn.LeafCstNodeImpl=Ou;var Iu=class extends Nu{constructor(){super(...arguments),this.children=new $u(this)}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:qw.Position.create(0,0),end:qw.Position.create(0,0)}}get firstNonHiddenNode(){for(let e of this.children)if(!e.hidden)return e;return this.children[0]}get lastNonHiddenNode(){for(let e=this.children.length-1;e>=0;e--){let r=this.children[e];if(!r.hidden)return r}return this.children[this.children.length-1]}};fn.CompositeCstNodeImpl=Iu;var $u=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,$u.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.parent=this.parent}},ld=class extends Iu{constructor(e){super(),this._text="",this._text=e??""}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}};fn.RootCstNodeImpl=ld});var Lu=b(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.isTokenTypeDictionary=Nt.isIMultiModeLexerDefinition=Nt.isTokenTypeArray=Nt.LangiumCompletionParser=Nt.LangiumParserErrorMessageProvider=Nt.LangiumParser=Nt.AbstractLangiumParser=Nt.DatatypeSymbol=void 0;var fd=ud(),cd=ot(),Uw=ir(),Hw=Ie(),uB=Gw();Nt.DatatypeSymbol=Symbol("Datatype");function yv(t){return t.$type===Nt.DatatypeSymbol}var Mu=class{constructor(e,r){this._unorderedGroups=new Map,this.lexer=new fd.Lexer(Kw(r)?Object.values(r):r),this.wrapper=new Tv(r,e.parser.ParserConfig)}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}};Nt.AbstractLangiumParser=Mu;var vv=class extends Mu{constructor(e,r){super(e,r),this.nodeBuilder=new uB.CstNodeBuilder,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}get current(){return this.stack[this.stack.length-1]}rule(e,r){let n=e.fragment?void 0:(0,Uw.isDataTypeRule)(e)?Nt.DatatypeSymbol:(0,Uw.getTypeName)(e),i=this.wrapper.DEFINE_RULE(e.name,this.startImplementation(n,r).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;let n=this.mainRule.call(this.wrapper);return this.nodeBuilder.addHiddenTokens(r.groups.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:r.errors,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{if(!this.isRecording()){let o={$type:e};this.stack.push(o),e===Nt.DatatypeSymbol&&(o.value="")}let i;try{i=r(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()){let o=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,isCrossRef:s}=this.getAssignment(n),u=this.current;if(a){let l=(0,cd.isKeyword)(n)?i.image:this.converter.convert(i.image,o);this.assign(a.operator,a.feature,l,o,s)}else if(yv(u)){let l=i.image;(0,cd.isKeyword)(n)||(l=this.converter.convert(l,o).toString()),u.value+=l}}}subrule(e,r,n,i){let o;this.isRecording()||(o=this.nodeBuilder.buildCompositeNode(n));let a=this.wrapper.wrapSubrule(e,r,i);this.isRecording()||this.performSubruleAssignment(a,n,o)}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:o}=this.getAssignment(r);if(i&&n)this.assign(i.operator,i.feature,e,n,o);else if(!i){let a=this.current;if(yv(a))a.value+=e.toString();else{let s=e.$type,u=this.assignWithoutOverride(e,a);s&&(u.$type=s);let l=u;this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&r.feature&&r.operator){n=this.construct(!1);let o=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(o)}let i={$type:e};this.stack.pop(),this.stack.push(i),r.feature&&r.operator&&this.assign(r.operator,r.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let r=this.current;return(0,Hw.linkContentToContainer)(r),this.nodeBuilder.construct(r),e&&this.stack.pop(),yv(r)?this.converter.convert(r.value,r.$cstNode):(this.assignMandatoryProperties(r),r)}assignMandatoryProperties(e){let r=this.astReflection.getTypeMetaData(e.$type);for(let n of r.mandatory){let i=e[n.name];n.type==="array"&&!Array.isArray(i)?e[n.name]=[]:n.type==="boolean"&&i===void 0&&(e[n.name]=!1)}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=(0,Hw.getContainerOfType)(e,cd.isAssignment);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?(0,cd.isCrossReference)(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let a=this.current,s;switch(o&&typeof n=="string"?s=this.linker.buildReference(a,r,i,n):s=n,e){case"=":{a[r]=s;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(s)}}assignWithoutOverride(e,r){for(let[n,i]of Object.entries(r))e[n]===void 0&&(e[n]=i);return e}get definitionErrors(){return this.wrapper.definitionErrors}};Nt.LangiumParser=vv;var dd=class{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}buildNoViableAltMessage(e){return fd.defaultParserErrorProvider.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return fd.defaultParserErrorProvider.buildEarlyExitMessage(e)}};Nt.LangiumParserErrorMessageProvider=dd;var _v=class extends Mu{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e);return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(e.name,this.startImplementation(r).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,r,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}};Nt.LangiumCompletionParser=_v;var lB={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new dd},Tv=class extends fd.EmbeddedActionsParser{constructor(e,r){super(e,Object.assign(Object.assign({},lB),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}};function Bw(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}Nt.isTokenTypeArray=Bw;function Ww(t){return t&&"modes"in t&&"defaultMode"in t}Nt.isIMultiModeLexerDefinition=Ww;function Kw(t){return!Bw(t)&&!Ww(t)}Nt.isTokenTypeDictionary=Kw});var zw=b(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.assertUnreachable=os.ErrorWithLocation=void 0;var Rv=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};os.ErrorWithLocation=Rv;function cB(t){throw new Error("Error! The input value was not handled.")}os.assertUnreachable=cB});var Av=b(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.createParser=void 0;var Vw=ud(),et=ot(),Yw=Lu(),Fu=zw(),fB=Bt(),Xw=ir(),Zw=Wt();function dB(t,e,r){let n=RB(r);return pB({parser:e,tokens:n,rules:new Map,ruleNames:new Map},t),e}hd.createParser=dB;function pB(t,e){let r=(0,Zw.getAllReachableRules)(e,!1),n=(0,fB.stream)(e.rules).filter(et.isParserRule).filter(i=>r.has(i));for(let i of n){let o=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});o.rules.set(i.name,t.parser.rule(i,Yo(o,i.definition)))}}function Yo(t,e,r=!1){let n;if((0,et.isKeyword)(e))n=TB(t,e);else if((0,et.isAction)(e))n=hB(t,e);else if((0,et.isAssignment)(e))n=Yo(t,e.terminal);else if((0,et.isCrossReference)(e))n=Jw(t,e);else if((0,et.isRuleCall)(e))n=mB(t,e);else if((0,et.isAlternatives)(e))n=yB(t,e);else if((0,et.isUnorderedGroup)(e))n=vB(t,e);else if((0,et.isGroup)(e))n=_B(t,e);else throw new Fu.ErrorWithLocation(e.$cstNode,`Unexpected element type: ${e.$type}`);return eS(t,r?void 0:pd(e),n,e.cardinality)}function hB(t,e){let r=(0,Xw.getTypeName)(e);return()=>t.parser.action(r,e)}function mB(t,e){let r=e.rule.ref;if((0,et.isParserRule)(r)){let n=t.subrule++,i=e.arguments.length>0?gB(r,e.arguments):()=>({});return o=>t.parser.subrule(n,tS(t,r),e,i(o))}else if((0,et.isTerminalRule)(r)){let n=t.consume++,i=bv(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)(0,Fu.assertUnreachable)(r);else throw new Fu.ErrorWithLocation(e.$cstNode,`Undefined rule type: ${e.$type}`)}function gB(t,e){let r=e.map(n=>Ui(n.value));return n=>{let i={};for(let o=0;o<r.length;o++){let a=t.parameters[o],s=r[o];i[a.name]=s(n)}return i}}function Ui(t){if((0,et.isDisjunction)(t)){let e=Ui(t.left),r=Ui(t.right);return n=>e(n)||r(n)}else if((0,et.isConjunction)(t)){let e=Ui(t.left),r=Ui(t.right);return n=>e(n)&&r(n)}else if((0,et.isNegation)(t)){let e=Ui(t.value);return r=>!e(r)}else if((0,et.isParameterReference)(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if((0,et.isLiteralCondition)(t)){let e=!!t.true;return()=>e}(0,Fu.assertUnreachable)(t)}function yB(t,e){if(e.elements.length===1)return Yo(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Yo(t,i,!0)},a=pd(i);a&&(o.GATE=Ui(a)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let a={ALT:()=>o.ALT(i)},s=o.GATE;return s&&(a.GATE=()=>s(i)),a}))}}function vB(t,e){if(e.elements.length===1)return Yo(t,e.elements[0]);let r=[];for(let s of e.elements){let u={ALT:Yo(t,s,!0)},l=pd(s);l&&(u.GATE=Ui(l)),r.push(u)}let n=t.or++,i=(s,u)=>{let l=u.getRuleStack().join("-");return`uGroup_${s}_${l}`},o=s=>t.parser.alternatives(n,r.map((u,l)=>{let c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(u.ALT(s),!f.isRecording()){let h=i(n,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);let d=f.unorderedGroups.get(h);typeof d?.[l]>"u"&&(d[l]=!0)}};let p=u.GATE;return p?c.GATE=()=>p(s):c.GATE=()=>{let h=f.unorderedGroups.get(i(n,f));return!h?.[l]},c})),a=eS(t,pd(e),o,"*");return s=>{a(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function _B(t,e){let r=e.elements.map(n=>Yo(t,n));return n=>r.forEach(i=>i(n))}function pd(t){if((0,et.isGroup)(t))return t.guardCondition}function Jw(t,e,r=e.terminal){if(r)if((0,et.isRuleCall)(r)&&(0,et.isParserRule)(r.rule.ref)){let n=t.subrule++;return i=>t.parser.subrule(n,tS(t,r.rule.ref),e,i)}else if((0,et.isRuleCall)(r)&&(0,et.isTerminalRule)(r.rule.ref)){let n=t.consume++,i=bv(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if((0,et.isKeyword)(r)){let n=t.consume++,i=bv(t,r.value);return i.name=Qw(i.name),()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=(0,Zw.findNameAssignment)(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+(0,Xw.getTypeName)(e.type.ref));return Jw(t,e,i)}}var Qw=t=>t.endsWith(":KW")?t:t+":KW";function TB(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return n.name=Qw(n.name),()=>t.parser.consume(r,n,e)}function eS(t,e,r,n){let i=e&&Ui(e);if(!n)if(i){let o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>r(a),GATE:()=>i(a)},{ALT:(0,Vw.EMPTY_ALT)(),GATE:()=>!i(a)}])}else return r;if(n==="*"){let o=t.many++;return a=>t.parser.many(o,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else if(n==="+"){let o=t.many++;if(i){let a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(s)}),GATE:()=>i(s)},{ALT:(0,Vw.EMPTY_ALT)(),GATE:()=>!i(s)}])}else return a=>t.parser.atLeastOne(o,{DEF:()=>r(a)})}else if(n==="?"){let o=t.optional++;return a=>t.parser.optional(o,{DEF:()=>r(a),GATE:i?()=>i(a):void 0})}else(0,Fu.assertUnreachable)(n)}function RB(t){if((0,Yw.isTokenTypeDictionary)(t))return t;let e=(0,Yw.isIMultiModeLexerDefinition)(t)?Object.values(t.modes).flat():t,r={};return e.forEach(n=>r[n.name]=n),r}function tS(t,e){let r=bB(t,e),n=t.rules.get(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function bB(t,e){if((0,et.isParserRule)(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!(0,et.isParserRule)(n);)((0,et.isGroup)(n)||(0,et.isAlternatives)(n)||(0,et.isUnorderedGroup)(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function bv(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}});var rS=b(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.createCompletionParser=void 0;var AB=Lu(),EB=Av();function CB(t){let e=t.Grammar,r=t.parser.TokenBuilder.buildTokens(e,{caseInsensitive:t.LanguageMetaData.caseInsensitive}),n=new AB.LangiumCompletionParser(t,r);return(0,EB.createParser)(e,n,r),n.finalize(),n}md.createCompletionParser=CB});var Ev=b(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.prepareLangiumParser=as.createLangiumParser=void 0;var xB=Lu(),wB=Av();function SB(t){let e=nS(t);return e.finalize(),e}as.createLangiumParser=SB;function nS(t){let e=t.Grammar,r=t.parser.TokenBuilder.buildTokens(e,{caseInsensitive:t.LanguageMetaData.caseInsensitive}),n=new xB.LangiumParser(t,r);return(0,wB.createParser)(e,n,r)}as.prepareLangiumParser=nS});var wv=b(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.DefaultTokenBuilder=void 0;var kB=ud(),Cv=ot(),PB=ir(),DB=Ie(),NB=Wt(),gd=Fa(),OB=Bt(),xv=class{buildTokens(e,r){let n=(0,OB.stream)((0,NB.getAllReachableRules)(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return i.forEach(a=>{let s=a.PATTERN;typeof s=="object"&&s&&"test"in s&&(0,gd.isWhitespaceRegExp)(s)?o.unshift(a):o.push(a)}),o}buildTerminalTokens(e){return e.filter(Cv.isTerminalRule).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=(0,PB.terminalRegex)(e),n={name:e.name,PATTERN:new RegExp(r)};return e.hidden&&(n.GROUP=(0,gd.isWhitespaceRegExp)(r)?kB.Lexer.SKIPPED:"hidden"),n}buildKeywordTokens(e,r,n){return e.filter(Cv.isParserRule).flatMap(i=>(0,DB.streamAllContents)(i).filter(Cv.isKeyword)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,r)}}buildKeywordPattern(e,r){return r?new RegExp((0,gd.getCaseInsensitivePattern)(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&(0,gd.partialMatches)("^"+o.source+"$",e.value)&&n.push(i),n},[])}};yd.DefaultTokenBuilder=xv});var Pv=b(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.convertBoolean=Xt.convertNumber=Xt.convertDate=Xt.convertBigint=Xt.convertInt=Xt.convertID=Xt.convertString=Xt.DefaultValueConverter=void 0;var iS=ot(),IB=ir(),$B=Wt(),Sv=class{convert(e,r){let n=r.feature;if((0,iS.isCrossReference)(n)&&(n=(0,$B.getCrossReferenceTerminal)(n)),(0,iS.isRuleCall)(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return aS(r);case"STRING":return kv(r);case"ID":return oS(r);case"REGEXLITERAL":return kv(r)}switch((i=(0,IB.getRuleType)(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return lS(r);case"boolean":return cS(r);case"bigint":return sS(r);case"date":return uS(r);default:return r}}};Xt.DefaultValueConverter=Sv;function kv(t){return t.substring(1,t.length-1)}Xt.convertString=kv;function oS(t){return t.charAt(0)==="^"?t.substring(1):t}Xt.convertID=oS;function aS(t){return parseInt(t)}Xt.convertInt=aS;function sS(t){return BigInt(t)}Xt.convertBigint=sS;function uS(t){return new Date(t)}Xt.convertDate=uS;function lS(t){return Number(t)}Xt.convertNumber=lS;function cS(t){return t.toLowerCase()==="true"}Xt.convertBoolean=cS});var Nv=b(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.DefaultLinker=void 0;var MB=Xe(),Hi=Ie(),LB=In(),fS=Ho(),Dv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=MB.CancellationToken.None){for(let n of(0,Hi.streamAst)(e.parseResult.value))await(0,LB.interruptAndCheck)(r),(0,Hi.streamReferences)(n).forEach(i=>this.doLink(i,e));e.state=fS.DocumentState.Linked}doLink(e,r){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if((0,Hi.isLinkingError)(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}r.references.push(n)}unlink(e){for(let r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,a={$refNode:n,$refText:i,get ref(){var s;if((0,Hi.isAstNode)(this._ref))return this._ref;if((0,Hi.isAstNodeDescription)(this._nodeDescription)){let u=o.loadAstNode(this._nodeDescription);this._ref=u??o.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){let u=o.getLinkedNode({reference:a,container:e,property:r});this._ref=(s=u.node)!==null&&s!==void 0?s:u.error,this._nodeDescription=u.descr}return(0,Hi.isAstNode)(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return(0,Hi.isLinkingError)(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){try{let r=this.getCandidate(e);if((0,Hi.isLinkingError)(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getOrCreateDocument(e.documentUri);return this.astNodeLocator.getAstNode(r,e.path)}createLinkingError(e,r){let n=(0,Hi.getDocument)(e.container);n.state<fS.DocumentState.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}};vd.DefaultLinker=Dv});var Iv=b(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.DefaultJsonSerializer=void 0;var _d=Ie(),Ov=class{constructor(e){this.ignoreProperties=["$container","$containerProperty","$containerIndex","$document","$cstNode"],this.linker=e.references.Linker}serialize(e,r){return JSON.stringify(this.decycle(e,this.ignoreProperties),void 0,r)}deserialize(e){return this.revive(JSON.parse(e))}decycle(e,r){let n=new Set,i=o=>{if(typeof o=="object"&&o!==null){if(n.has(o))throw new Error("Cycle in ast detected.");if(n.add(o),(0,_d.isReference)(o))return{$refText:o.$refText};let a;if(Array.isArray(o)){a=[];for(let s=0;s<o.length;s++)a[s]=i(o[s])}else{a={};for(let[s,u]of Object.entries(o))r.includes(s)||(a[s]=i(u))}return a}return o};return i(e)}revive(e){let r=(n,i,o)=>{if(Array.isArray(n))for(let a=0;a<n.length;a++){let s=n[a];if((0,_d.isReference)(s)&&(0,_d.isAstNode)(i)){let u=this.linker.buildReference(i,o,s.$refNode,s.$refText);n[a]=u}else typeof s=="object"&&s!==null&&(r(s),s.$container=i,s.$containerProperty=o,s.$containerIndex=a)}else if(typeof n=="object"&&n!==null){for(let[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null)if((0,_d.isReference)(s)){let u=this.linker.buildReference(n,a,s.$refNode,s.$refText);n[a]=u}else Array.isArray(s)?r(s,n,a):(r(s),s.$container=n,s.$containerProperty=a)}};return r(e),e}};Td.DefaultJsonSerializer=Ov});var Mv=b(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.DefaultServiceRegistry=void 0;var FB=$n(),$v=class{register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let r of this.singleton.LanguageMetaData.fileExtensions)this.map[r]=this.singleton;this.singleton=void 0}for(let r of e.LanguageMetaData.fileExtensions)this.map[r]!==void 0&&this.map[r]!==e&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[r]=e}getServices(e){if(this.singleton!==void 0)return this.singleton;if(this.map===void 0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=FB.Utils.extname(e),n=this.map[r];if(!n)throw new Error(`The service registry contains no services for the extension '${r}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}};Rd.DefaultServiceRegistry=$v});var qv=b(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.DefaultReferenceDescriptionProvider=ss.DefaultAstNodeDescriptionProvider=void 0;var qB=Xe(),qu=Ie(),jB=pt(),GB=In(),UB=uo(),Lv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator}createDescription(e,r,n=(0,qu.getDocument)(e)){return{node:e,name:r,type:e.$type,documentUri:n.uri,path:this.astNodeLocator.getAstNodePath(e)}}createDescriptions(){throw new Error("Deprecated: This method has been moved to the `ScopeComputation` service and renamed to `computeExports`.")}};ss.DefaultAstNodeDescriptionProvider=Lv;var Fv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=qB.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of(0,qu.streamAst)(i))await(0,GB.interruptAndCheck)(r),(0,qu.streamReferences)(o).filter(a=>!(0,qu.isLinkingError)(a)).forEach(a=>{let s=a.reference.$nodeDescription;s&&n.push(this.createDescription(a,s))});return n}createDescription(e,r){let n=(0,qu.getDocument)(e.container).uri,i=e.reference.$refNode;return{sourceUri:n,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:(0,jB.toDocumentSegment)(i),local:(0,UB.equalURI)(r.documentUri,n)}}};ss.DefaultReferenceDescriptionProvider=Fv});var dS=b(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.DefaultAstNodeLocator=void 0;var jv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let a=o.indexOf(this.indexSeparator);if(a>0){let s=o.substring(0,a),u=parseInt(o.substring(a+1));return i[s][u]}return i[o]},e.parseResult.value)}};bd.DefaultAstNodeLocator=jv});var Uv=b(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.DefaultConfigurationProvider=void 0;var HB=Lt(),Gv=class{constructor(e){this.settings={},this.workspaceConfig=!1,this.initialized=!1,this.serviceRegistry=e.ServiceRegistry,this.connection=e.lsp.Connection,e.lsp.LanguageServer.onInitialize(r=>{var n,i;this.workspaceConfig=(i=(n=r.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&i!==void 0?i:!1}),e.lsp.LanguageServer.onInitialized(r=>{var n;let i=this.serviceRegistry.all;(n=e.lsp.Connection)===null||n===void 0||n.client.register(HB.DidChangeConfigurationNotification.type,{section:i.map(o=>this.toSectionName(o.LanguageMetaData.languageId))})})}async initialize(){if(this.workspaceConfig&&this.connection){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await this.connection.workspace.getConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}this.initialized=!0}updateConfiguration(e){!e.settings||Object.keys(e.settings).forEach(r=>{this.updateSectionConfiguration(r,e.settings[r])})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){this.initialized||await this.initialize();let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}};Ad.DefaultConfigurationProvider=Gv});var Wv=b(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.DefaultDocumentBuilder=void 0;var Ed=Xe(),BB=tn(),Hv=In(),Bi=Ho(),Bv=class{constructor(e){this.updateListeners=[],this.buildPhaseListeners=new BB.MultiMap,this.langiumDocuments=e.workspace.LangiumDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Ed.CancellationToken.None){await this.buildDocuments(e,r,n)}async update(e,r,n=Ed.CancellationToken.None){for(let s of r)this.langiumDocuments.invalidateDocument(s);this.indexManager.remove(r);for(let s of e)this.langiumDocuments.invalidateDocument(s);for(let s of this.updateListeners)s(e,r);await(0,Hv.interruptAndCheck)(n);let i=e.map(s=>this.langiumDocuments.getOrCreateDocument(s)),o=this.collectDocuments(i,r),a={validationChecks:"all"};await this.buildDocuments(o,a,n)}onUpdate(e){return this.updateListeners.push(e),Ed.Disposable.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}collectDocuments(e,r){let n=e.map(a=>a.uri).concat(r),i=this.indexManager.getAffectedDocuments(n).toArray();i.forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,Bi.DocumentState.ComputedScopes)});let o=new Set([...e,...i,...this.langiumDocuments.all.filter(a=>a.state<Bi.DocumentState.Validated)]);return Array.from(o)}async buildDocuments(e,r,n){await this.runCancelable(e,Bi.DocumentState.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,Bi.DocumentState.ComputedScopes,n,o=>this.computeScopes(o,n)),await this.runCancelable(e,Bi.DocumentState.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(e,Bi.DocumentState.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));let i=e.filter(o=>this.shouldValidate(o,r));await this.runCancelable(i,Bi.DocumentState.Validated,n,o=>this.validate(o,n))}async runCancelable(e,r,n,i){let o=e.filter(a=>a.state<r);for(let a of o)await(0,Hv.interruptAndCheck)(n),await i(a);await this.notifyBuildPhase(o,r,n)}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ed.Disposable.create(()=>{this.buildPhaseListeners.delete(e,r)})}async notifyBuildPhase(e,r,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(r);for(let o of i)await(0,Hv.interruptAndCheck)(n),await o(e,n)}async computeScopes(e,r){let n=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await n.computeLocalScopes(e,r),e.state=Bi.DocumentState.ComputedScopes}shouldValidate(e,r){return r.validationChecks==="all"}async validate(e,r){let i=await this.serviceRegistry.getServices(e.uri).validation.DocumentValidator.validateDocument(e,r);e.diagnostics=i,e.state=Bi.DocumentState.Validated}};Cd.DefaultDocumentBuilder=Bv});var Yv=b(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.DefaultIndexManager=void 0;var pS=Xe(),WB=Ie(),Kv=Bt(),zv=uo(),hS=Ho(),Vv=class{constructor(e){this.simpleIndex=new Map,this.referenceIndex=new Map,this.globalScopeCache=new Map,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection,this.langiumDocuments=()=>e.workspace.LangiumDocuments}findAllReferences(e,r){let n=(0,WB.getDocument)(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(a=>{(0,zv.equalURI)(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),(0,Kv.stream)(i)}allElements(e=""){this.globalScopeCache.has("")||this.globalScopeCache.set("",Array.from(this.simpleIndex.values()).flat());let r=this.globalScopeCache.get(e);if(r)return(0,Kv.stream)(r);{let n=this.globalScopeCache.get("").filter(i=>this.astReflection.isSubtype(i.type,e));return this.globalScopeCache.set(e,n),(0,Kv.stream)(n)}}remove(e){for(let r of e){let n=r.toString();this.simpleIndex.delete(n),this.referenceIndex.delete(n)}}async updateContent(e,r=pS.CancellationToken.None){this.globalScopeCache.clear();let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r);for(let o of i)o.node=void 0;this.simpleIndex.set(e.uri.toString(),i),e.state=hS.DocumentState.IndexedContent}async updateReferences(e,r=pS.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i),e.state=hS.DocumentState.IndexedReferences}getAffectedDocuments(e){return this.langiumDocuments().all.filter(r=>{if(e.some(n=>(0,zv.equalURI)(r.uri,n)))return!1;for(let n of e)if(this.isAffected(r,n))return!0;return!1})}isAffected(e,r){let n=r.toString(),i=e.uri.toString();if(e.references.some(a=>a.error!==void 0))return!0;let o=this.referenceIndex.get(i);return o?o.filter(a=>!a.local).some(a=>(0,zv.equalURI)(a.targetUri,n)):!1}};xd.DefaultIndexManager=Vv});var Jv=b(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.DefaultWorkspaceManager=void 0;var KB=Xe(),Xv=$n(),zB=In(),Zv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.MutexLock,e.lsp.LanguageServer.onInitialize(r=>{var n;this.folders=(n=r.workspaceFolders)!==null&&n!==void 0?n:void 0}),e.lsp.LanguageServer.onInitialized(r=>{this.mutex.lock(n=>{var i;return this.initializeWorkspace((i=this.folders)!==null&&i!==void 0?i:[],n)})})}async initializeWorkspace(e,r=KB.CancellationToken.None){let n=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),i=[],o=a=>{i.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,o),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,n,o))),await(0,zB.interruptAndCheck)(r),await this.documentBuilder.build(i,void 0,r)}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Xv.URI.parse(e.uri)}async traverseFolder(e,r,n,i){let o=await this.fileSystemProvider.readDirectory(r);await Promise.all(o.map(async a=>{if(this.includeEntry(e,a,n)){if(a.isDirectory)await this.traverseFolder(e,a.uri,n,i);else if(a.isFile){let s=this.langiumDocuments.getOrCreateDocument(a.uri);i(s)}}}))}includeEntry(e,r,n){let i=Xv.Utils.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){let o=Xv.Utils.extname(r.uri);return n.includes(o)}return!1}};wd.DefaultWorkspaceManager=Zv});var Af=b(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.createDefaultSharedModule=us.createDefaultModule=void 0;var VB=Xe(),YB=_c(),XB=fC(),ZB=rS(),JB=Zg(),QB=Qg(),e2=ty(),t2=Vc(),r2=iy(),n2=ay(),i2=gy(),o2=vy(),a2=Ty(),s2=Ev(),u2=wv(),l2=Pv(),c2=Nv(),f2=Ua(),d2=Hg(),p2=Pc(),h2=Nc(),m2=Iv(),g2=Mv(),y2=In(),v2=Kc(),_2=qc(),mS=qv(),T2=dS(),R2=Uv(),b2=Wv(),Qv=Ho(),A2=Yv(),E2=Jv();function C2(t){return{parser:{GrammarConfig:e=>(0,XB.createGrammarConfig)(e),LangiumParser:e=>(0,s2.createLangiumParser)(e),CompletionParser:e=>(0,ZB.createCompletionParser)(e),ValueConverter:()=>new l2.DefaultValueConverter,TokenBuilder:()=>new u2.DefaultTokenBuilder},lsp:{CompletionProvider:e=>new JB.DefaultCompletionProvider(e),DocumentSymbolProvider:e=>new e2.DefaultDocumentSymbolProvider(e),HoverProvider:e=>new n2.MultilineCommentHoverProvider(e),FoldingRangeProvider:e=>new t2.DefaultFoldingRangeProvider(e),ReferencesProvider:e=>new o2.DefaultReferencesProvider(e),DefinitionProvider:e=>new r2.DefaultDefinitionProvider(e),DocumentHighlightProvider:e=>new QB.DefaultDocumentHighlightProvider(e),RenameProvider:e=>new a2.DefaultRenameProvider(e)},workspace:{AstNodeLocator:()=>new T2.DefaultAstNodeLocator,AstNodeDescriptionProvider:e=>new mS.DefaultAstNodeDescriptionProvider(e),ReferenceDescriptionProvider:e=>new mS.DefaultReferenceDescriptionProvider(e)},references:{Linker:e=>new c2.DefaultLinker(e),NameProvider:()=>new f2.DefaultNameProvider,ScopeProvider:e=>new h2.DefaultScopeProvider(e),ScopeComputation:e=>new p2.DefaultScopeComputation(e),References:e=>new d2.DefaultReferences(e)},serializer:{JsonSerializer:e=>new m2.DefaultJsonSerializer(e)},validation:{DocumentValidator:e=>new v2.DefaultDocumentValidator(e),ValidationRegistry:e=>new _2.ValidationRegistry(e)},shared:()=>t.shared}}us.createDefaultModule=C2;function x2(t){return{ServiceRegistry:()=>new g2.DefaultServiceRegistry,lsp:{Connection:()=>t.connection,LanguageServer:e=>new i2.DefaultLanguageServer(e)},workspace:{LangiumDocuments:e=>new Qv.DefaultLangiumDocuments(e),LangiumDocumentFactory:e=>new Qv.DefaultLangiumDocumentFactory(e),DocumentBuilder:e=>new b2.DefaultDocumentBuilder(e),TextDocuments:()=>new VB.TextDocuments(YB.TextDocument),TextDocumentFactory:e=>new Qv.DefaultTextDocumentFactory(e),IndexManager:e=>new A2.DefaultIndexManager(e),WorkspaceManager:e=>new E2.DefaultWorkspaceManager(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new y2.MutexLock,ConfigurationProvider:e=>new R2.DefaultConfigurationProvider(e)}}}us.createDefaultSharedModule=x2});var gS=b(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.s=void 0;var w2=/^(s*\n)+/,S2=/\n/g,k2=/\S|$/;function P2(t,...e){let r=e.reduce((i,o,a)=>i+D2(String(o),i)+t[a+1],t[0]).split(`
3738
+ `).map(i=>i.trimRight()),n=N2(r);return r.map(i=>i.slice(n).trimRight()).join(`
3739
+ `).trimRight().replace(w2,"")}Sd.s=P2;function D2(t,e){let r=Math.max(0,e.length-e.lastIndexOf(`
3740
+ `)-1),n=" ".repeat(r);return t.replace(S2,`
3741
+ `+n)}function N2(t){let e=t.filter(n=>n.length>0).map(n=>n.search(k2)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}});var vS=b(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0})});var TS=b(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0})});var bS=b(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0})});var go=b(se=>{"use strict";var AS=se&&se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),O2=se&&se.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ye=se&&se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AS(e,t,r)},I2=se&&se.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AS(e,t,r);return O2(e,t),e};Object.defineProperty(se,"__esModule",{value:!0});se.GrammarAST=void 0;ye(Af(),se);ye(eu(),se);ye($c(),se);ye(Ym(),se);ye(gS(),se);ye(Py(),se);ye(bf(),se);ye(vS(),se);ye(by(),se);ye(Lu(),se);ye(Ev(),se);ye(TS(),se);ye(wv(),se);ye(Pv(),se);ye(Nv(),se);ye(Ua(),se);ye(Pc(),se);ye(Nc(),se);ye(Iv(),se);ye(Mv(),se);ye(bS(),se);ye(Pa(),se);ye(Ie(),se);ye(tn(),se);ye(pt(),se);ye(Wt(),se);ye(In(),se);ye(uo(),se);ye(Fa(),se);ye(Bt(),se);ye(Kc(),se);ye(qc(),se);ye(qv(),se);ye(Wv(),se);ye(Ho(),se);ye(Yv(),se);ye(Ec(),se);ye(Jv(),se);ye(Uv(),se);var $2=I2(ot());se.GrammarAST=$2});var e_=b(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.isGenerator=E.Generator=E.isFunctionParamType=E.FunctionParamType=E.isFunctionParam=E.FunctionParam=E.isFunction=E.Function=E.isEnumField=E.EnumField=E.isEnum=E.Enum=E.isDataSourceField=E.DataSourceField=E.isDataSource=E.DataSource=E.isDataModelFieldType=E.DataModelFieldType=E.isDataModelFieldAttribute=E.DataModelFieldAttribute=E.isDataModelField=E.DataModelField=E.isDataModelAttribute=E.DataModelAttribute=E.isDataModel=E.DataModel=E.isBinaryExpr=E.BinaryExpr=E.isAttributeParamType=E.AttributeParamType=E.isAttributeParam=E.AttributeParam=E.isAttributeAttribute=E.AttributeAttribute=E.isAttributeArg=E.AttributeArg=E.isAttribute=E.Attribute=E.isArrayExpr=E.ArrayExpr=E.isArgument=E.Argument=E.isTypeDeclaration=E.TypeDeclaration=E.isReferenceTarget=E.ReferenceTarget=E.isExpression=E.Expression=E.isAbstractDeclaration=E.AbstractDeclaration=void 0;E.reflection=E.ZModelAstReflection=E.isUnaryExpr=E.UnaryExpr=E.isThisExpr=E.ThisExpr=E.isReferenceExpr=E.ReferenceExpr=E.isReferenceArg=E.ReferenceArg=E.isPluginField=E.PluginField=E.isPlugin=E.Plugin=E.isNullExpr=E.NullExpr=E.isModel=E.Model=E.isMemberAccessExpr=E.MemberAccessExpr=E.isLiteralExpr=E.LiteralExpr=E.isInvocationExpr=E.InvocationExpr=E.isGeneratorField=E.GeneratorField=void 0;var M2=go();E.AbstractDeclaration="AbstractDeclaration";function L2(t){return E.reflection.isInstance(t,E.AbstractDeclaration)}E.isAbstractDeclaration=L2;E.Expression="Expression";function F2(t){return E.reflection.isInstance(t,E.Expression)}E.isExpression=F2;E.ReferenceTarget="ReferenceTarget";function q2(t){return E.reflection.isInstance(t,E.ReferenceTarget)}E.isReferenceTarget=q2;E.TypeDeclaration="TypeDeclaration";function j2(t){return E.reflection.isInstance(t,E.TypeDeclaration)}E.isTypeDeclaration=j2;E.Argument="Argument";function G2(t){return E.reflection.isInstance(t,E.Argument)}E.isArgument=G2;E.ArrayExpr="ArrayExpr";function U2(t){return E.reflection.isInstance(t,E.ArrayExpr)}E.isArrayExpr=U2;E.Attribute="Attribute";function H2(t){return E.reflection.isInstance(t,E.Attribute)}E.isAttribute=H2;E.AttributeArg="AttributeArg";function B2(t){return E.reflection.isInstance(t,E.AttributeArg)}E.isAttributeArg=B2;E.AttributeAttribute="AttributeAttribute";function W2(t){return E.reflection.isInstance(t,E.AttributeAttribute)}E.isAttributeAttribute=W2;E.AttributeParam="AttributeParam";function K2(t){return E.reflection.isInstance(t,E.AttributeParam)}E.isAttributeParam=K2;E.AttributeParamType="AttributeParamType";function z2(t){return E.reflection.isInstance(t,E.AttributeParamType)}E.isAttributeParamType=z2;E.BinaryExpr="BinaryExpr";function V2(t){return E.reflection.isInstance(t,E.BinaryExpr)}E.isBinaryExpr=V2;E.DataModel="DataModel";function Y2(t){return E.reflection.isInstance(t,E.DataModel)}E.isDataModel=Y2;E.DataModelAttribute="DataModelAttribute";function X2(t){return E.reflection.isInstance(t,E.DataModelAttribute)}E.isDataModelAttribute=X2;E.DataModelField="DataModelField";function Z2(t){return E.reflection.isInstance(t,E.DataModelField)}E.isDataModelField=Z2;E.DataModelFieldAttribute="DataModelFieldAttribute";function J2(t){return E.reflection.isInstance(t,E.DataModelFieldAttribute)}E.isDataModelFieldAttribute=J2;E.DataModelFieldType="DataModelFieldType";function Q2(t){return E.reflection.isInstance(t,E.DataModelFieldType)}E.isDataModelFieldType=Q2;E.DataSource="DataSource";function eW(t){return E.reflection.isInstance(t,E.DataSource)}E.isDataSource=eW;E.DataSourceField="DataSourceField";function tW(t){return E.reflection.isInstance(t,E.DataSourceField)}E.isDataSourceField=tW;E.Enum="Enum";function rW(t){return E.reflection.isInstance(t,E.Enum)}E.isEnum=rW;E.EnumField="EnumField";function nW(t){return E.reflection.isInstance(t,E.EnumField)}E.isEnumField=nW;E.Function="Function";function iW(t){return E.reflection.isInstance(t,E.Function)}E.isFunction=iW;E.FunctionParam="FunctionParam";function oW(t){return E.reflection.isInstance(t,E.FunctionParam)}E.isFunctionParam=oW;E.FunctionParamType="FunctionParamType";function aW(t){return E.reflection.isInstance(t,E.FunctionParamType)}E.isFunctionParamType=aW;E.Generator="Generator";function sW(t){return E.reflection.isInstance(t,E.Generator)}E.isGenerator=sW;E.GeneratorField="GeneratorField";function uW(t){return E.reflection.isInstance(t,E.GeneratorField)}E.isGeneratorField=uW;E.InvocationExpr="InvocationExpr";function lW(t){return E.reflection.isInstance(t,E.InvocationExpr)}E.isInvocationExpr=lW;E.LiteralExpr="LiteralExpr";function cW(t){return E.reflection.isInstance(t,E.LiteralExpr)}E.isLiteralExpr=cW;E.MemberAccessExpr="MemberAccessExpr";function fW(t){return E.reflection.isInstance(t,E.MemberAccessExpr)}E.isMemberAccessExpr=fW;E.Model="Model";function dW(t){return E.reflection.isInstance(t,E.Model)}E.isModel=dW;E.NullExpr="NullExpr";function pW(t){return E.reflection.isInstance(t,E.NullExpr)}E.isNullExpr=pW;E.Plugin="Plugin";function hW(t){return E.reflection.isInstance(t,E.Plugin)}E.isPlugin=hW;E.PluginField="PluginField";function mW(t){return E.reflection.isInstance(t,E.PluginField)}E.isPluginField=mW;E.ReferenceArg="ReferenceArg";function gW(t){return E.reflection.isInstance(t,E.ReferenceArg)}E.isReferenceArg=gW;E.ReferenceExpr="ReferenceExpr";function yW(t){return E.reflection.isInstance(t,E.ReferenceExpr)}E.isReferenceExpr=yW;E.ThisExpr="ThisExpr";function vW(t){return E.reflection.isInstance(t,E.ThisExpr)}E.isThisExpr=vW;E.UnaryExpr="UnaryExpr";function _W(t){return E.reflection.isInstance(t,E.UnaryExpr)}E.isUnaryExpr=_W;var kd=class{getAllTypes(){return["AbstractDeclaration","Argument","ArrayExpr","Attribute","AttributeArg","AttributeAttribute","AttributeParam","AttributeParamType","BinaryExpr","DataModel","DataModelAttribute","DataModelField","DataModelFieldAttribute","DataModelFieldType","DataSource","DataSourceField","Enum","EnumField","Expression","Function","FunctionParam","FunctionParamType","Generator","GeneratorField","InvocationExpr","LiteralExpr","MemberAccessExpr","Model","NullExpr","Plugin","PluginField","ReferenceArg","ReferenceExpr","ReferenceTarget","ThisExpr","TypeDeclaration","UnaryExpr"]}isInstance(e,r){return(0,M2.isAstNode)(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;switch(e){case E.ArrayExpr:case E.BinaryExpr:case E.InvocationExpr:case E.LiteralExpr:case E.MemberAccessExpr:case E.NullExpr:case E.ReferenceExpr:case E.ThisExpr:case E.UnaryExpr:return this.isSubtype(E.Expression,r);case E.Attribute:case E.DataSource:case E.Function:case E.Generator:case E.Plugin:return this.isSubtype(E.AbstractDeclaration,r);case E.DataModel:case E.Enum:return this.isSubtype(E.AbstractDeclaration,r)||this.isSubtype(E.TypeDeclaration,r);case E.DataModelField:case E.EnumField:case E.FunctionParam:return this.isSubtype(E.ReferenceTarget,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"AttributeAttribute:decl":return E.Attribute;case"AttributeParamType:reference":return E.TypeDeclaration;case"DataModelAttribute:decl":return E.Attribute;case"DataModelFieldAttribute:decl":return E.Attribute;case"DataModelFieldType:reference":return E.TypeDeclaration;case"FunctionParamType:reference":return E.TypeDeclaration;case"InvocationExpr:function":return E.Function;case"MemberAccessExpr:member":return E.DataModelField;case"ReferenceExpr:target":return E.ReferenceTarget;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"ArrayExpr":return{name:"ArrayExpr",mandatory:[{name:"items",type:"array"}]};case"Attribute":return{name:"Attribute",mandatory:[{name:"attributes",type:"array"},{name:"params",type:"array"}]};case"AttributeAttribute":return{name:"AttributeAttribute",mandatory:[{name:"args",type:"array"}]};case"AttributeParam":return{name:"AttributeParam",mandatory:[{name:"default",type:"boolean"}]};case"AttributeParamType":return{name:"AttributeParamType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataModel":return{name:"DataModel",mandatory:[{name:"attributes",type:"array"},{name:"fields",type:"array"}]};case"DataModelAttribute":return{name:"DataModelAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelField":return{name:"DataModelField",mandatory:[{name:"attributes",type:"array"}]};case"DataModelFieldAttribute":return{name:"DataModelFieldAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelFieldType":return{name:"DataModelFieldType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataSource":return{name:"DataSource",mandatory:[{name:"fields",type:"array"}]};case"Enum":return{name:"Enum",mandatory:[{name:"fields",type:"array"}]};case"Function":return{name:"Function",mandatory:[{name:"params",type:"array"}]};case"FunctionParamType":return{name:"FunctionParamType",mandatory:[{name:"array",type:"boolean"}]};case"Generator":return{name:"Generator",mandatory:[{name:"fields",type:"array"}]};case"InvocationExpr":return{name:"InvocationExpr",mandatory:[{name:"args",type:"array"}]};case"Model":return{name:"Model",mandatory:[{name:"declarations",type:"array"}]};case"Plugin":return{name:"Plugin",mandatory:[{name:"fields",type:"array"}]};case"ReferenceExpr":return{name:"ReferenceExpr",mandatory:[{name:"args",type:"array"}]};default:return{name:e,mandatory:[]}}}};E.ZModelAstReflection=kd;E.reflection=new kd});var ES=b(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.ZModelGrammar=void 0;var TW=go(),Pd,RW=()=>Pd!=null?Pd:Pd=(0,TW.loadGrammarFromJson)(`{
3742
3742
  "$type": "Grammar",
3743
3743
  "isDeclared": true,
3744
3744
  "name": "ZModel",
@@ -6449,30 +6449,30 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t}
6449
6449
  "imports": [],
6450
6450
  "interfaces": [],
6451
6451
  "usedGrammars": []
6452
- }`);Dd.ZModelGrammar=bW});var CS=b(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.ZModelGeneratedModule=Wi.ZModelGeneratedSharedModule=Wi.ZModelLanguageMetaData=void 0;var AW=e_(),EW=ES();Wi.ZModelLanguageMetaData={languageId:"zmodel",fileExtensions:[".zmodel"],caseInsensitive:!1};Wi.ZModelGeneratedSharedModule={AstReflection:()=>new AW.ZModelAstReflection};Wi.ZModelGeneratedModule={Grammar:()=>(0,EW.ZModelGrammar)(),LanguageMetaData:()=>Wi.ZModelLanguageMetaData,parser:{}}});var t_=b(Xo=>{"use strict";var CW=Xo&&Xo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xW=Xo&&Xo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CW(e,t,r)};Object.defineProperty(Xo,"__esModule",{value:!0});xW(CS(),Xo)});var wS=b((F8,xS)=>{var ls=1e3,cs=ls*60,fs=cs*60,Zo=fs*24,wW=Zo*7,SW=Zo*365.25;xS.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return kW(t);if(r==="number"&&isFinite(t))return e.long?DW(t):PW(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function kW(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*SW;case"weeks":case"week":case"w":return r*wW;case"days":case"day":case"d":return r*Zo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*fs;case"minutes":case"minute":case"mins":case"min":case"m":return r*cs;case"seconds":case"second":case"secs":case"sec":case"s":return r*ls;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function PW(t){var e=Math.abs(t);return e>=Zo?Math.round(t/Zo)+"d":e>=fs?Math.round(t/fs)+"h":e>=cs?Math.round(t/cs)+"m":e>=ls?Math.round(t/ls)+"s":t+"ms"}function DW(t){var e=Math.abs(t);return e>=Zo?Nd(t,e,Zo,"day"):e>=fs?Nd(t,e,fs,"hour"):e>=cs?Nd(t,e,cs,"minute"):e>=ls?Nd(t,e,ls,"second"):t+" ms"}function Nd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var r_=b((q8,SS)=>{function NW(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=wS(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let p=0;p<c.length;p++)f=(f<<5)-f+c.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,p=null,h,d;function g(...C){if(!g.enabled)return;let x=g,T=Number(new Date),v=T-(f||T);x.diff=v,x.prev=f,x.curr=T,f=T,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let k=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(O,$)=>{if(O==="%%")return"%";k++;let X=r.formatters[$];if(typeof X=="function"){let J=C[k];O=X.call(x,J),C.splice(k,1),k--}return O}),r.formatArgs.call(x,C),(x.log||r.log).apply(x,C)}return g.namespace=c,g.useColors=r.useColors(),g.color=r.selectColor(c),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,d=r.enabled(c)),d),set:C=>{p=C}}),typeof r.init=="function"&&r.init(g),g}function n(c,f){let p=r(this.namespace+(typeof f>"u"?":":f)+c);return p.log=this.log,p}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f,p=(typeof c=="string"?c:"").split(/[\s,]+/),h=p.length;for(f=0;f<h;f++)!p[f]||(c=p[f].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){let c=[...r.names.map(s),...r.skips.map(s).map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){if(c[c.length-1]==="*")return!0;let f,p;for(f=0,p=r.skips.length;f<p;f++)if(r.skips[f].test(c))return!1;for(f=0,p=r.names.length;f<p;f++)if(r.names[f].test(c))return!0;return!1}function s(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}SS.exports=NW});var kS=b((Vr,Od)=>{Vr.formatArgs=IW;Vr.save=$W;Vr.load=MW;Vr.useColors=OW;Vr.storage=LW();Vr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Vr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function OW(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function IW(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Od.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}Vr.log=console.debug||console.log||(()=>{});function $W(t){try{t?Vr.storage.setItem("debug",t):Vr.storage.removeItem("debug")}catch{}}function MW(){let t;try{t=Vr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function LW(){try{return localStorage}catch{}}Od.exports=r_()(Vr);var{formatters:FW}=Od.exports;FW.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var DS=b((j8,PS)=>{"use strict";PS.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var IS=b((G8,OS)=>{"use strict";var qW=require("os"),NS=require("tty"),dn=DS(),{env:Zt}=process,Id;dn("no-color")||dn("no-colors")||dn("color=false")||dn("color=never")?Id=0:(dn("color")||dn("colors")||dn("color=true")||dn("color=always"))&&(Id=1);function jW(){if("FORCE_COLOR"in Zt)return Zt.FORCE_COLOR==="true"?1:Zt.FORCE_COLOR==="false"?0:Zt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Zt.FORCE_COLOR,10),3)}function GW(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function UW(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=jW();n!==void 0&&(Id=n);let i=r?Id:n;if(i===0)return 0;if(r){if(dn("color=16m")||dn("color=full")||dn("color=truecolor"))return 3;if(dn("color=256"))return 2}if(t&&!e&&i===void 0)return 0;let o=i||0;if(Zt.TERM==="dumb")return o;if(process.platform==="win32"){let a=qW.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Zt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Zt)||Zt.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Zt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Zt.TEAMCITY_VERSION)?1:0;if(Zt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Zt){let a=Number.parseInt((Zt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Zt.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Zt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Zt.TERM)||"COLORTERM"in Zt?1:o}function n_(t,e={}){let r=UW(t,{streamIsTTY:t&&t.isTTY,...e});return GW(r)}OS.exports={supportsColor:n_,stdout:n_({isTTY:NS.isatty(1)}),stderr:n_({isTTY:NS.isatty(2)})}});var MS=b((lr,Md)=>{var HW=require("tty"),$d=require("util");lr.init=XW;lr.log=zW;lr.formatArgs=WW;lr.save=VW;lr.load=YW;lr.useColors=BW;lr.destroy=$d.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");lr.colors=[6,2,3,4,5,1];try{let t=IS();t&&(t.stderr||t).level>=2&&(lr.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}lr.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function BW(){return"colors"in lr.inspectOpts?Boolean(lr.inspectOpts.colors):HW.isatty(process.stderr.fd)}function WW(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
6452
+ }`);Dd.ZModelGrammar=RW});var CS=b(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.ZModelGeneratedModule=Wi.ZModelGeneratedSharedModule=Wi.ZModelLanguageMetaData=void 0;var bW=e_(),AW=ES();Wi.ZModelLanguageMetaData={languageId:"zmodel",fileExtensions:[".zmodel"],caseInsensitive:!1};Wi.ZModelGeneratedSharedModule={AstReflection:()=>new bW.ZModelAstReflection};Wi.ZModelGeneratedModule={Grammar:()=>(0,AW.ZModelGrammar)(),LanguageMetaData:()=>Wi.ZModelLanguageMetaData,parser:{}}});var t_=b(Xo=>{"use strict";var EW=Xo&&Xo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),CW=Xo&&Xo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EW(e,t,r)};Object.defineProperty(Xo,"__esModule",{value:!0});CW(CS(),Xo)});var wS=b((L8,xS)=>{var ls=1e3,cs=ls*60,fs=cs*60,Zo=fs*24,xW=Zo*7,wW=Zo*365.25;xS.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return SW(t);if(r==="number"&&isFinite(t))return e.long?PW(t):kW(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function SW(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*wW;case"weeks":case"week":case"w":return r*xW;case"days":case"day":case"d":return r*Zo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*fs;case"minutes":case"minute":case"mins":case"min":case"m":return r*cs;case"seconds":case"second":case"secs":case"sec":case"s":return r*ls;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function kW(t){var e=Math.abs(t);return e>=Zo?Math.round(t/Zo)+"d":e>=fs?Math.round(t/fs)+"h":e>=cs?Math.round(t/cs)+"m":e>=ls?Math.round(t/ls)+"s":t+"ms"}function PW(t){var e=Math.abs(t);return e>=Zo?Nd(t,e,Zo,"day"):e>=fs?Nd(t,e,fs,"hour"):e>=cs?Nd(t,e,cs,"minute"):e>=ls?Nd(t,e,ls,"second"):t+" ms"}function Nd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var r_=b((F8,SS)=>{function DW(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=wS(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let p=0;p<c.length;p++)f=(f<<5)-f+c.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,p=null,h,d;function g(...C){if(!g.enabled)return;let x=g,T=Number(new Date),v=T-(f||T);x.diff=v,x.prev=f,x.curr=T,f=T,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let k=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(O,$)=>{if(O==="%%")return"%";k++;let X=r.formatters[$];if(typeof X=="function"){let J=C[k];O=X.call(x,J),C.splice(k,1),k--}return O}),r.formatArgs.call(x,C),(x.log||r.log).apply(x,C)}return g.namespace=c,g.useColors=r.useColors(),g.color=r.selectColor(c),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,d=r.enabled(c)),d),set:C=>{p=C}}),typeof r.init=="function"&&r.init(g),g}function n(c,f){let p=r(this.namespace+(typeof f>"u"?":":f)+c);return p.log=this.log,p}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f,p=(typeof c=="string"?c:"").split(/[\s,]+/),h=p.length;for(f=0;f<h;f++)!p[f]||(c=p[f].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){let c=[...r.names.map(s),...r.skips.map(s).map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){if(c[c.length-1]==="*")return!0;let f,p;for(f=0,p=r.skips.length;f<p;f++)if(r.skips[f].test(c))return!1;for(f=0,p=r.names.length;f<p;f++)if(r.names[f].test(c))return!0;return!1}function s(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}SS.exports=DW});var kS=b((Vr,Od)=>{Vr.formatArgs=OW;Vr.save=IW;Vr.load=$W;Vr.useColors=NW;Vr.storage=MW();Vr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Vr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function NW(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function OW(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Od.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}Vr.log=console.debug||console.log||(()=>{});function IW(t){try{t?Vr.storage.setItem("debug",t):Vr.storage.removeItem("debug")}catch{}}function $W(){let t;try{t=Vr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function MW(){try{return localStorage}catch{}}Od.exports=r_()(Vr);var{formatters:LW}=Od.exports;LW.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var DS=b((q8,PS)=>{"use strict";PS.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var IS=b((j8,OS)=>{"use strict";var FW=require("os"),NS=require("tty"),dn=DS(),{env:Zt}=process,Id;dn("no-color")||dn("no-colors")||dn("color=false")||dn("color=never")?Id=0:(dn("color")||dn("colors")||dn("color=true")||dn("color=always"))&&(Id=1);function qW(){if("FORCE_COLOR"in Zt)return Zt.FORCE_COLOR==="true"?1:Zt.FORCE_COLOR==="false"?0:Zt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Zt.FORCE_COLOR,10),3)}function jW(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function GW(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=qW();n!==void 0&&(Id=n);let i=r?Id:n;if(i===0)return 0;if(r){if(dn("color=16m")||dn("color=full")||dn("color=truecolor"))return 3;if(dn("color=256"))return 2}if(t&&!e&&i===void 0)return 0;let o=i||0;if(Zt.TERM==="dumb")return o;if(process.platform==="win32"){let a=FW.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Zt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Zt)||Zt.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Zt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Zt.TEAMCITY_VERSION)?1:0;if(Zt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Zt){let a=Number.parseInt((Zt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Zt.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Zt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Zt.TERM)||"COLORTERM"in Zt?1:o}function n_(t,e={}){let r=GW(t,{streamIsTTY:t&&t.isTTY,...e});return jW(r)}OS.exports={supportsColor:n_,stdout:n_({isTTY:NS.isatty(1)}),stderr:n_({isTTY:NS.isatty(2)})}});var MS=b((lr,Md)=>{var UW=require("tty"),$d=require("util");lr.init=YW;lr.log=KW;lr.formatArgs=BW;lr.save=zW;lr.load=VW;lr.useColors=HW;lr.destroy=$d.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");lr.colors=[6,2,3,4,5,1];try{let t=IS();t&&(t.stderr||t).level>=2&&(lr.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}lr.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function HW(){return"colors"in lr.inspectOpts?Boolean(lr.inspectOpts.colors):UW.isatty(process.stderr.fd)}function BW(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
6453
6453
  `).join(`
6454
- `+o),t.push(i+"m+"+Md.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=KW()+e+" "+t[0]}function KW(){return lr.inspectOpts.hideDate?"":new Date().toISOString()+" "}function zW(...t){return process.stderr.write($d.format(...t)+`
6455
- `)}function VW(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function YW(){return process.env.DEBUG}function XW(t){t.inspectOpts={};let e=Object.keys(lr.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=lr.inspectOpts[e[r]]}Md.exports=r_()(lr);var{formatters:$S}=Md.exports;$S.o=function(t){return this.inspectOpts.colors=this.useColors,$d.inspect(t,this.inspectOpts).split(`
6456
- `).map(e=>e.trim()).join(" ")};$S.O=function(t){return this.inspectOpts.colors=this.useColors,$d.inspect(t,this.inspectOpts)}});var Ld=b((U8,i_)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?i_.exports=kS():i_.exports=MS()});var LS=b(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});function ZW(t){return function(e,r){return new Promise((n,i)=>{t.call(this,e,r,(o,a)=>{o?i(o):n(a)})})}}o_.default=ZW});var jS=b((s_,qS)=>{"use strict";var FS=s_&&s_.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},JW=require("events"),QW=FS(Ld()),e3=FS(LS()),ju=QW.default("agent-base");function t3(t){return Boolean(t)&&typeof t.addRequest=="function"}function a_(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
6457
- `).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Fd(t,e){return new Fd.Agent(t,e)}(function(t){class e extends JW.EventEmitter{constructor(n,i){super();let o=i;typeof n=="function"?this.callback=n:n&&(o=n),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:a_()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:a_()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,i,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,i){let o=Object.assign({},i);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=a_()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,n._last=!0,n.shouldKeepAlive=!1;let a=!1,s=null,u=o.timeout||this.timeout,l=h=>{n._hadError||(n.emit("error",h),n._hadError=!0)},c=()=>{s=null,a=!0;let h=new Error(`A "socket" was not created for HTTP request before ${u}ms`);h.code="ETIMEOUT",l(h)},f=h=>{a||(s!==null&&(clearTimeout(s),s=null),l(h))},p=h=>{if(a)return;if(s!=null&&(clearTimeout(s),s=null),t3(h)){ju("Callback returned another Agent instance %o",h.constructor.name),h.addRequest(n,o);return}if(h){h.once("free",()=>{this.freeSocket(h,o)}),n.onSocket(h);return}let d=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);l(d)};if(typeof this.callback!="function"){l(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ju("Converting legacy callback function to promise"),this.promisifiedCallback=e3.default(this.callback)):this.promisifiedCallback=this.callback),typeof u=="number"&&u>0&&(s=setTimeout(c,u)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{ju("Resolving socket for %o request: %o",o.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,o)).then(p,f)}catch(h){Promise.reject(h).catch(f)}}freeSocket(n,i){ju("Freeing socket %o %o",n.constructor.name,i),n.destroy()}destroy(){ju("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(Fd||(Fd={}));qS.exports=Fd});var GS=b(Uu=>{"use strict";var r3=Uu&&Uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uu,"__esModule",{value:!0});var n3=r3(Ld()),Gu=n3.default("https-proxy-agent:parse-proxy-response");function i3(t){return new Promise((e,r)=>{let n=0,i=[];function o(){let f=t.read();f?c(f):t.once("readable",o)}function a(){t.removeListener("end",u),t.removeListener("error",l),t.removeListener("close",s),t.removeListener("readable",o)}function s(f){Gu("onclose had error %o",f)}function u(){Gu("onend")}function l(f){a(),Gu("onerror %o",f),r(f)}function c(f){i.push(f),n+=f.length;let p=Buffer.concat(i,n);if(p.indexOf(`\r
6454
+ `+o),t.push(i+"m+"+Md.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=WW()+e+" "+t[0]}function WW(){return lr.inspectOpts.hideDate?"":new Date().toISOString()+" "}function KW(...t){return process.stderr.write($d.format(...t)+`
6455
+ `)}function zW(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function VW(){return process.env.DEBUG}function YW(t){t.inspectOpts={};let e=Object.keys(lr.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=lr.inspectOpts[e[r]]}Md.exports=r_()(lr);var{formatters:$S}=Md.exports;$S.o=function(t){return this.inspectOpts.colors=this.useColors,$d.inspect(t,this.inspectOpts).split(`
6456
+ `).map(e=>e.trim()).join(" ")};$S.O=function(t){return this.inspectOpts.colors=this.useColors,$d.inspect(t,this.inspectOpts)}});var Ld=b((G8,i_)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?i_.exports=kS():i_.exports=MS()});var LS=b(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});function XW(t){return function(e,r){return new Promise((n,i)=>{t.call(this,e,r,(o,a)=>{o?i(o):n(a)})})}}o_.default=XW});var jS=b((s_,qS)=>{"use strict";var FS=s_&&s_.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ZW=require("events"),JW=FS(Ld()),QW=FS(LS()),ju=JW.default("agent-base");function e3(t){return Boolean(t)&&typeof t.addRequest=="function"}function a_(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
6457
+ `).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Fd(t,e){return new Fd.Agent(t,e)}(function(t){class e extends ZW.EventEmitter{constructor(n,i){super();let o=i;typeof n=="function"?this.callback=n:n&&(o=n),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:a_()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:a_()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,i,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,i){let o=Object.assign({},i);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=a_()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,n._last=!0,n.shouldKeepAlive=!1;let a=!1,s=null,u=o.timeout||this.timeout,l=h=>{n._hadError||(n.emit("error",h),n._hadError=!0)},c=()=>{s=null,a=!0;let h=new Error(`A "socket" was not created for HTTP request before ${u}ms`);h.code="ETIMEOUT",l(h)},f=h=>{a||(s!==null&&(clearTimeout(s),s=null),l(h))},p=h=>{if(a)return;if(s!=null&&(clearTimeout(s),s=null),e3(h)){ju("Callback returned another Agent instance %o",h.constructor.name),h.addRequest(n,o);return}if(h){h.once("free",()=>{this.freeSocket(h,o)}),n.onSocket(h);return}let d=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);l(d)};if(typeof this.callback!="function"){l(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ju("Converting legacy callback function to promise"),this.promisifiedCallback=QW.default(this.callback)):this.promisifiedCallback=this.callback),typeof u=="number"&&u>0&&(s=setTimeout(c,u)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{ju("Resolving socket for %o request: %o",o.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,o)).then(p,f)}catch(h){Promise.reject(h).catch(f)}}freeSocket(n,i){ju("Freeing socket %o %o",n.constructor.name,i),n.destroy()}destroy(){ju("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(Fd||(Fd={}));qS.exports=Fd});var GS=b(Uu=>{"use strict";var t3=Uu&&Uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uu,"__esModule",{value:!0});var r3=t3(Ld()),Gu=r3.default("https-proxy-agent:parse-proxy-response");function n3(t){return new Promise((e,r)=>{let n=0,i=[];function o(){let f=t.read();f?c(f):t.once("readable",o)}function a(){t.removeListener("end",u),t.removeListener("error",l),t.removeListener("close",s),t.removeListener("readable",o)}function s(f){Gu("onclose had error %o",f)}function u(){Gu("onend")}function l(f){a(),Gu("onerror %o",f),r(f)}function c(f){i.push(f),n+=f.length;let p=Buffer.concat(i,n);if(p.indexOf(`\r
6458
6458
  \r
6459
6459
  `)===-1){Gu("have not received end of HTTP headers yet..."),o();return}let d=p.toString("ascii",0,p.indexOf(`\r
6460
- `)),g=+d.split(" ")[1];Gu("got proxy server response: %o",d),e({statusCode:g,buffered:p})}t.on("error",l),t.on("close",s),t.on("end",u),o()})}Uu.default=i3});var BS=b(Jo=>{"use strict";var o3=Jo&&Jo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},ds=Jo&&Jo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jo,"__esModule",{value:!0});var US=ds(require("net")),HS=ds(require("tls")),a3=ds(require("url")),s3=ds(require("assert")),u3=ds(Ld()),l3=jS(),c3=ds(GS()),Hu=u3.default("https-proxy-agent:agent"),u_=class extends l3.Agent{constructor(e){let r;if(typeof e=="string"?r=a3.default.parse(e):r=e,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Hu("creating new HttpsProxyAgent instance: %o",r),super(r);let n=Object.assign({},r);this.secureProxy=r.secureProxy||p3(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,r){return o3(this,void 0,void 0,function*(){let{proxy:n,secureProxy:i}=this,o;i?(Hu("Creating `tls.Socket`: %o",n),o=HS.default.connect(n)):(Hu("Creating `net.Socket`: %o",n),o=US.default.connect(n));let a=Object.assign({},n.headers),u=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
6461
- `;n.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:l,port:c,secureEndpoint:f}=r;d3(c,f)||(l+=`:${c}`),a.Host=l,a.Connection="close";for(let C of Object.keys(a))u+=`${C}: ${a[C]}\r
6462
- `;let p=c3.default(o);o.write(`${u}\r
6463
- `);let{statusCode:h,buffered:d}=yield p;if(h===200){if(e.once("socket",f3),r.secureEndpoint){let C=r.servername||r.host;if(!C)throw new Error('Could not determine "servername"');return Hu("Upgrading socket connection to TLS"),HS.default.connect(Object.assign(Object.assign({},h3(r,"host","hostname","path","port")),{socket:o,servername:C}))}return o}o.destroy();let g=new US.default.Socket;return g.readable=!0,e.once("socket",C=>{Hu("replaying proxy buffer for failed request"),s3.default(C.listenerCount("data")>0),C.push(d),C.push(null)}),g})}};Jo.default=u_;function f3(t){t.resume()}function d3(t,e){return Boolean(!e&&t===80||e&&t===443)}function p3(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function h3(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}});var KS=b((f_,WS)=>{"use strict";var m3=f_&&f_.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},l_=m3(BS());function c_(t){return new l_.default(t)}(function(t){t.HttpsProxyAgent=l_.default,t.prototype=l_.default.prototype})(c_||(c_={}));WS.exports=c_});var zS=b((K8,g3)=>{g3.exports={name:"mixpanel",description:"A simple server-side API for mixpanel",keywords:["mixpanel","analytics","api","stats"],version:"0.17.0",homepage:"https://github.com/mixpanel/mixpanel-node",author:"Carl Sverre",license:"MIT",main:"lib/mixpanel-node",directories:{lib:"lib"},repository:{type:"git",url:"http://github.com/mixpanel/mixpanel-node.git"},engines:{node:">=10.0"},scripts:{test:"nodeunit"},types:"./lib/mixpanel-node.d.ts",devDependencies:{nodeunit:"^0.11.3",proxyquire:"^1.7.11",sinon:"^7.1.1"},dependencies:{"https-proxy-agent":"5.0.0"}}});var p_=b(d_=>{d_.async_all=function(t,e,r){var n=t.length,i=null,o=[],a=function(l,c){l&&(i=i||[],i.push(l)),o.push(c),--n===0&&r(i,o)};if(n===0)r(i,o);else for(var s=0,u=t.length;s<u;s++)e(t[s],a)};d_.ensure_timestamp=function(t){if(!(t instanceof Date||typeof t=="number"))throw new Error("`time` property must be a Date or Unix timestamp and is only required for `import` endpoint");return t instanceof Date?t.getTime():t}});var m_=b(h_=>{var qd=require("util"),{ensure_timestamp:y3}=p_();function ps(t,e){return e&&(e.$ignore_alias&&(t.$ignore_alias=e.$ignore_alias),e.$ignore_time&&(t.$ignore_time=e.$ignore_time),e.hasOwnProperty("$ip")&&(t.$ip=e.$ip),e.hasOwnProperty("$time")&&(t.$time=y3(e.$time)),e.hasOwnProperty("$latitude")&&e.hasOwnProperty("$longitude")&&(t.$latitude=e.$latitude,t.$longitude=e.$longitude)),t}h_.merge_modifiers=ps;h_.ProfileHelpers=(t=Object)=>class extends t{get token(){return this.mixpanel.token}get config(){return this.mixpanel.config}_set(e,r,n,i,{identifiers:o,set_once:a=!1}){let s={};typeof e=="object"?(typeof r=="object"?(i=n,n=r):i=r,s=e):(s[e]=r,(typeof n=="function"||!n)&&(i=n));let u={$token:this.token,...o},l=a?"$set_once":"$set";u[l]=s,"ip"in s&&(u.$ip=s.ip,delete s.ip),s.$ignore_time&&(u.$ignore_time=s.$ignore_time,delete s.$ignore_time),u=ps(u,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(u)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:u},i)}_delete_profile({identifiers:e,modifiers:r,callback:n}){let i={$delete:"",$token:this.token,...e};typeof r=="function"&&(n=r),i=ps(i,r),this.config.debug&&console.log(`Deleting profile ${JSON.stringify(e)}`),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:i},n)}_remove({identifiers:e,data:r,modifiers:n,callback:i}){let o={};if(typeof r!="object"||qd.isArray(r)){this.config.debug&&console.error("Invalid value passed to #remove - data must be an object with scalar values");return}for(let[a,s]of Object.entries(r))if(typeof s=="string"||typeof s=="number")o[a]=s;else{this.config.debug&&(console.error("Invalid argument passed to #remove - values must be scalar"),console.error("Passed "+a+":",s));return}Object.keys(o).length!==0&&(r={$remove:o,$token:this.token,...e},typeof n=="function"&&(i=n),r=ps(r,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(r)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:r},i))}_union({identifiers:e,data:r,modifiers:n,callback:i}){let o={};if(typeof r!="object"||qd.isArray(r)){this.config.debug&&console.error("Invalid value passed to #union - data must be an object with scalar or array values");return}for(let[s,u]of Object.entries(r))if(qd.isArray(u)){var a=u.filter(function(l){return typeof l=="string"||typeof l=="number"});a.length>0&&(o[s]=a)}else typeof u=="string"||typeof u=="number"?o[s]=[u]:this.config.debug&&(console.error("Invalid argument passed to #union - values must be a scalar value or array"),console.error("Passed "+s+":",u));Object.keys(o).length!==0&&(r={$union:o,$token:this.token,...e},typeof n=="function"&&(i=n),r=ps(r,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(r)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:r},i))}_unset({identifiers:e,prop:r,modifiers:n,callback:i}){let o=[];if(qd.isArray(r))o=r;else if(typeof r=="string")o=[r];else{this.config.debug&&(console.error("Invalid argument passed to #unset - must be a string or array"),console.error("Passed: "+r));return}let a={$unset:o,$token:this.token,...e};typeof n=="function"&&(i=n),a=ps(a,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(a)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:a},i)}}});var YS=b(VS=>{var{ProfileHelpers:v3}=m_(),g_=class extends v3(){constructor(e){super(),this.mixpanel=e,this.endpoint="/groups"}set_once(e,r,n,i,o,a){let s={$group_key:e,$group_id:r};this._set(n,i,o,a,{identifiers:s,set_once:!0})}set(e,r,n,i,o,a){let s={$group_key:e,$group_id:r};this._set(n,i,o,a,{identifiers:s})}delete_group(e,r,n,i){let o={$group_key:e,$group_id:r};this._delete_profile({identifiers:o,modifiers:n,callback:i})}remove(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._remove({identifiers:a,data:n,modifiers:i,callback:o})}union(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._union({identifiers:a,data:n,modifiers:i,callback:o})}unset(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._unset({identifiers:a,prop:n,modifiers:i,callback:o})}};VS.MixpanelGroups=g_});var ZS=b(XS=>{var{merge_modifiers:jd,ProfileHelpers:_3}=m_(),y_=class extends _3(){constructor(e){super(),this.mixpanel=e,this.endpoint="/engage"}set_once(e,r,n,i,o){let a={$distinct_id:e};this._set(r,n,i,o,{identifiers:a,set_once:!0})}set(e,r,n,i,o){let a={$distinct_id:e};this._set(r,n,i,o,{identifiers:a})}increment(e,r,n,i,o){var a={};if(typeof r=="object"){typeof n=="object"?(o=i,i=n):o=n;for(let[u,l]of Object.entries(r))isNaN(parseFloat(l))?this.mixpanel.config.debug&&(console.error("Invalid increment value passed to mixpanel.people.increment - must be a number"),console.error("Passed "+u+":"+l)):a[u]=l}else typeof n=="number"||!n?(n=n||1,a[r]=n,typeof i=="function"&&(o=i)):typeof n=="function"?(o=n,a[r]=1):(o=i,i=typeof n=="object"?n:{},a[r]=1);var s={$add:a,$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}append(e,r,n,i,o){var a={};typeof r=="object"?(typeof n=="object"?(o=i,i=n):o=n,Object.keys(r).forEach(function(u){a[u]=r[u]})):(a[r]=n,typeof i=="function"&&(o=i));var s={$append:a,$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}track_charge(e,r,n,i,o){if(typeof n=="function"||!n?(o=n||function(){},n={}):(typeof i=="function"||!i)&&(o=i||function(){},(n.$ignore_time||n.hasOwnProperty("$ip"))&&(i={},Object.keys(n).forEach(function(u){i[u]=n[u],delete n[u]}))),typeof r!="number"&&(r=parseFloat(r),isNaN(r))){console.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}if(n.$amount=r,n.hasOwnProperty("$time")){var a=n.$time;Object.prototype.toString.call(a)==="[object Date]"&&(n.$time=a.toISOString())}var s={$append:{$transactions:n},$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}clear_charges(e,r,n){var i={$set:{$transactions:[]},$token:this.mixpanel.token,$distinct_id:e};typeof r=="function"&&(n=r),i=jd(i,r),this.mixpanel.config.debug&&console.log("Clearing this user's charges:",e),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:i},n)}delete_user(e,r,n){let i={$distinct_id:e};this._delete_profile({identifiers:i,modifiers:r,callback:n})}remove(e,r,n,i){let o={$distinct_id:e};this._remove({identifiers:o,data:r,modifiers:n,callback:i})}union(e,r,n,i){let o={$distinct_id:e};this._union({identifiers:o,data:r,modifiers:n,callback:i})}unset(e,r,n,i){let o={$distinct_id:e};this._unset({identifiers:o,prop:r,modifiers:n,callback:i})}};XS.MixpanelPeople=y_});var tk=b((J8,ek)=>{var T3=require("querystring"),v_=require("buffer").Buffer,JS=require("http"),__=require("https"),R3=KS(),b3=require("url"),A3=zS(),{async_all:E3,ensure_timestamp:T_}=p_(),{MixpanelGroups:C3}=YS(),{MixpanelPeople:x3}=ZS(),w3={test:!1,debug:!1,verbose:!1,host:"api.mixpanel.com",protocol:"https",path:"",keepAlive:!0,geolocate:!1},QS=function(t,e){if(!t)throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`");let r={token:t,config:{...w3}},{keepAlive:n}=r.config,i=50,o={http:JS,https:__},a={http:new JS.Agent({keepAlive:n}),https:new __.Agent({keepAlive:n})},s=process.env.HTTPS_PROXY||process.env.HTTP_PROXY,u=s?new R3(Object.assign(b3.parse(s),{keepAlive:n})):null;r.send_request=function(f,p){p=p||function(){};let h=v_.from(JSON.stringify(f.data)).toString("base64"),d=f.endpoint,g=(f.method||"GET").toUpperCase(),C={ip:r.config.geolocate?1:0,verbose:r.config.verbose?1:0},x=r.config.key,T=r.config.secret,v=o[r.config.protocol],k={host:r.config.host,port:r.config.port,headers:{},method:g},j;if(!v)throw new Error("Mixpanel Initialization Error: Unsupported protocol "+r.config.protocol+". Supported protocols are: "+Object.keys(o));if(g==="POST"?(h="data="+h,k.headers["Content-Type"]="application/x-www-form-urlencoded",k.headers["Content-Length"]=v_.byteLength(h)):g==="GET"&&(C.data=h),T){if(v!==__)throw new Error("Must use HTTPS if authenticating with API Secret");let O=v_.from(T+":").toString("base64");k.headers.Authorization="Basic "+O}else if(x)C.api_key=x;else if(d==="/import")throw new Error("The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`");k.agent=u||a[r.config.protocol],r.config.test&&(C.test=1),k.path=r.config.path+d+"?"+T3.stringify(C),j=v.request(k,function(O){var $="";O.on("data",function(X){$+=X}),O.on("end",function(){var X;if(r.config.verbose)try{var J=JSON.parse($);J.status!=1&&(X=new Error("Mixpanel Server Error: "+J.error))}catch{X=new Error("Could not parse response from Mixpanel")}else X=$!=="1"?new Error("Mixpanel Server Error: "+$):void 0;p(X)})}),j.on("error",function(O){r.config.debug&&console.log("Got Error: "+O.message),p(O)}),g==="POST"&&j.write(h),j.end()},r.send_event_request=function(f,p,h,d){h.token=r.token,h.mp_lib="node",h.$lib_version=A3.version;var g={event:p,properties:h};r.config.debug&&console.log(`Sending the following event to Mixpanel:
6464
- `,g),r.send_request({method:"GET",endpoint:f,data:g},d)};var l=function(f,p){for(var h=[],d=0,g=f.length;d<g;)h.push(f.slice(d,d+=p));return h},c=function(f,p){var h=f.event_list,d=f.endpoint,g=f.max_batch_size?Math.min(i,f.max_batch_size):i,C=f.max_concurrent_requests||f.max_batch_size>i&&Math.ceil(f.max_batch_size/i),x=l(h,g),T=C?l(x,C):[x],v=x.length,k=T.length;function j($,X){$.length>0&&($=$.map(function(J){var le=J.properties;return(d==="/import"||J.properties.time)&&(J.properties.time=T_(J.properties.time)),J.properties.token=J.properties.token||r.token,J}),r.send_request({method:"POST",endpoint:d,data:$},X))}function O($){var X=T[$],J=function(le,pe){$+=1,$===k?p&&p(le,pe):O($)};E3(X,j,J)}O(0),r.config.debug&&console.log("Sending "+h.length+" events to Mixpanel in "+v+" batches of events and "+k+" batches of requests")};return r.track=function(f,p,h){(!p||typeof p=="function")&&(h=p,p={}),p.time&&(p.time=T_(p.time)),r.send_event_request("/track",f,p,h)},r.track_batch=function(f,p,h){p=p||{},typeof p=="function"&&(h=p,p={});var d={event_list:f,endpoint:"/track",max_concurrent_requests:p.max_concurrent_requests,max_batch_size:p.max_batch_size};c(d,h)},r.import=function(f,p,h,d){(!h||typeof h=="function")&&(d=h,h={}),h.time=T_(p),r.send_event_request("/import",f,h,d)},r.import_batch=function(f,p,h){var d;(typeof p=="function"||!p)&&(h=p,p={}),d={event_list:f,endpoint:"/import",max_concurrent_requests:p.max_concurrent_requests,max_batch_size:p.max_batch_size},c(d,h)},r.alias=function(f,p,h){var d={distinct_id:f,alias:p};r.track("$create_alias",d,h)},r.groups=new C3(r),r.people=new x3(r),r.set_config=function(f){if(Object.assign(r.config,f),f.host){let[p,h]=f.host.split(":");r.config.host=p,h&&(r.config.port=Number(h))}},e&&r.set_config(e),r};ek.exports={Client:function(t){return console.warn("The function `Client(token)` is deprecated. It is now called `init(token)`."),QS(t)},init:QS}});var nk=b((Bu,R_)=>{(function(t,e){typeof Bu=="object"&&typeof R_=="object"?R_.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Bu=="object"?Bu["electron-machine-id"]=e(require("child_process"),require("crypto")):t["electron-machine-id"]=e(t.child_process,t.crypto)})(Bu,function(t,e){return function(r){function n(o){if(i[o])return i[o].exports;var a=i[o]={exports:{},id:o,loaded:!1};return r[o].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var i={};return n.m=r,n.c=i,n.p="",n(0)}([function(r,n,i){r.exports=i(34)},function(r,n,i){var o=i(29)("wks"),a=i(33),s=i(2).Symbol,u=typeof s=="function",l=r.exports=function(c){return o[c]||(o[c]=u&&s[c]||(u?s:a)("Symbol."+c))};l.store=o},function(r,n){var i=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(r,n,i){var o=i(9);r.exports=function(a){if(!o(a))throw TypeError(a+" is not an object!");return a}},function(r,n,i){r.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,n,i){var o=i(12),a=i(17);r.exports=i(4)?function(s,u,l){return o.f(s,u,a(1,l))}:function(s,u,l){return s[u]=l,s}},function(r,n){var i=r.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(r,n,i){var o=i(14);r.exports=function(a,s,u){if(o(a),s===void 0)return a;switch(u){case 1:return function(l){return a.call(s,l)};case 2:return function(l,c){return a.call(s,l,c)};case 3:return function(l,c,f){return a.call(s,l,c,f)}}return function(){return a.apply(s,arguments)}}},function(r,n){var i={}.hasOwnProperty;r.exports=function(o,a){return i.call(o,a)}},function(r,n){r.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(r,n){r.exports={}},function(r,n){var i={}.toString;r.exports=function(o){return i.call(o).slice(8,-1)}},function(r,n,i){var o=i(3),a=i(26),s=i(32),u=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,c,f){if(o(l),c=s(c,!0),o(f),a)try{return u(l,c,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[c]=f.value),l}},function(r,n,i){var o=i(42),a=i(15);r.exports=function(s){return o(a(s))}},function(r,n){r.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(r,n){r.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(r,n,i){var o=i(9),a=i(2).document,s=o(a)&&o(a.createElement);r.exports=function(u){return s?a.createElement(u):{}}},function(r,n){r.exports=function(i,o){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:o}}},function(r,n,i){var o=i(12).f,a=i(8),s=i(1)("toStringTag");r.exports=function(u,l,c){u&&!a(u=c?u:u.prototype,s)&&o(u,s,{configurable:!0,value:l})}},function(r,n,i){var o=i(29)("keys"),a=i(33);r.exports=function(s){return o[s]||(o[s]=a(s))}},function(r,n){var i=Math.ceil,o=Math.floor;r.exports=function(a){return isNaN(a=+a)?0:(a>0?o:i)(a)}},function(r,n,i){var o=i(11),a=i(1)("toStringTag"),s=o(function(){return arguments}())=="Arguments",u=function(l,c){try{return l[c]}catch{}};r.exports=function(l){var c,f,p;return l===void 0?"Undefined":l===null?"Null":typeof(f=u(c=Object(l),a))=="string"?f:s?o(c):(p=o(c))=="Object"&&typeof c.callee=="function"?"Arguments":p}},function(r,n){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,n,i){var o=i(2),a=i(6),s=i(7),u=i(5),l="prototype",c=function(f,p,h){var d,g,C,x=f&c.F,T=f&c.G,v=f&c.S,k=f&c.P,j=f&c.B,O=f&c.W,$=T?a:a[p]||(a[p]={}),X=$[l],J=T?o:v?o[p]:(o[p]||{})[l];T&&(h=p);for(d in h)g=!x&&J&&J[d]!==void 0,g&&d in $||(C=g?J[d]:h[d],$[d]=T&&typeof J[d]!="function"?h[d]:j&&g?s(C,o):O&&J[d]==C?function(le){var pe=function(G,I,U){if(this instanceof le){switch(arguments.length){case 0:return new le;case 1:return new le(G);case 2:return new le(G,I)}return new le(G,I,U)}return le.apply(this,arguments)};return pe[l]=le[l],pe}(C):k&&typeof C=="function"?s(Function.call,C):C,k&&(($.virtual||($.virtual={}))[d]=C,f&c.R&&X&&!X[d]&&u(X,d,C)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,r.exports=c},function(r,n){r.exports=function(i){try{return!!i()}catch{return!0}}},function(r,n,i){r.exports=i(2).document&&document.documentElement},function(r,n,i){r.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(r,n,i){"use strict";var o=i(28),a=i(23),s=i(57),u=i(5),l=i(8),c=i(10),f=i(45),p=i(18),h=i(52),d=i(1)("iterator"),g=!([].keys&&"next"in[].keys()),C="@@iterator",x="keys",T="values",v=function(){return this};r.exports=function(k,j,O,$,X,J,le){f(O,j,$);var pe,G,I,U=function(K){if(!g&&K in re)return re[K];switch(K){case x:return function(){return new O(this,K)};case T:return function(){return new O(this,K)}}return function(){return new O(this,K)}},z=j+" Iterator",de=X==T,ie=!1,re=k.prototype,he=re[d]||re[C]||X&&re[X],me=he||U(X),ze=X?de?U("entries"):me:void 0,H=j=="Array"&&re.entries||he;if(H&&(I=h(H.call(new k)),I!==Object.prototype&&(p(I,z,!0),o||l(I,d)||u(I,d,v))),de&&he&&he.name!==T&&(ie=!0,me=function(){return he.call(this)}),o&&!le||!g&&!ie&&re[d]||u(re,d,me),c[j]=me,c[z]=v,X)if(pe={values:de?me:U(T),keys:J?me:U(x),entries:ze},le)for(G in pe)G in re||s(re,G,pe[G]);else a(a.P+a.F*(g||ie),j,pe);return pe}},function(r,n){r.exports=!0},function(r,n,i){var o=i(2),a="__core-js_shared__",s=o[a]||(o[a]={});r.exports=function(u){return s[u]||(s[u]={})}},function(r,n,i){var o,a,s,u=i(7),l=i(41),c=i(25),f=i(16),p=i(2),h=p.process,d=p.setImmediate,g=p.clearImmediate,C=p.MessageChannel,x=0,T={},v="onreadystatechange",k=function(){var O=+this;if(T.hasOwnProperty(O)){var $=T[O];delete T[O],$()}},j=function(O){k.call(O.data)};d&&g||(d=function(O){for(var $=[],X=1;arguments.length>X;)$.push(arguments[X++]);return T[++x]=function(){l(typeof O=="function"?O:Function(O),$)},o(x),x},g=function(O){delete T[O]},i(11)(h)=="process"?o=function(O){h.nextTick(u(k,O,1))}:C?(a=new C,s=a.port2,a.port1.onmessage=j,o=u(s.postMessage,s,1)):p.addEventListener&&typeof postMessage=="function"&&!p.importScripts?(o=function(O){p.postMessage(O+"","*")},p.addEventListener("message",j,!1)):o=v in f("script")?function(O){c.appendChild(f("script"))[v]=function(){c.removeChild(this),k.call(O)}}:function(O){setTimeout(u(k,O,1),0)}),r.exports={set:d,clear:g}},function(r,n,i){var o=i(20),a=Math.min;r.exports=function(s){return s>0?a(o(s),9007199254740991):0}},function(r,n,i){var o=i(9);r.exports=function(a,s){if(!o(a))return a;var u,l;if(s&&typeof(u=a.toString)=="function"&&!o(l=u.call(a))||typeof(u=a.valueOf)=="function"&&!o(l=u.call(a))||!s&&typeof(u=a.toString)=="function"&&!o(l=u.call(a)))return l;throw TypeError("Can't convert object to primitive value")}},function(r,n){var i=0,o=Math.random();r.exports=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++i+o).toString(36))}},function(r,n,i){"use strict";function o(v){return v&&v.__esModule?v:{default:v}}function a(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function s(v){return(0,d.createHash)("sha256").update(v).digest("hex")}function u(v){switch(C){case"darwin":return v.split("IOPlatformUUID")[1].split(`
6465
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return v.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return v.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return v.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(v){var k=u((0,h.execSync)(T[C]).toString());return v?k:s(k)}function c(v){return new p.default(function(k,j){return(0,h.exec)(T[C],{},function(O,$,X){if(O)return j(new Error("Error while obtaining machine id: "+O.stack));var J=u($.toString());return k(v?J:s(J))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),p=o(f);n.machineIdSync=l,n.machineId=c;var h=i(70),d=i(71),g=process,C=g.platform,x={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},T={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:x[a()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(r,n,i){r.exports={default:i(36),__esModule:!0}},function(r,n,i){i(66),i(68),i(69),i(67),r.exports=i(6).Promise},function(r,n){r.exports=function(){}},function(r,n){r.exports=function(i,o,a,s){if(!(i instanceof o)||s!==void 0&&s in i)throw TypeError(a+": incorrect invocation!");return i}},function(r,n,i){var o=i(13),a=i(31),s=i(62);r.exports=function(u){return function(l,c,f){var p,h=o(l),d=a(h.length),g=s(f,d);if(u&&c!=c){for(;d>g;)if(p=h[g++],p!=p)return!0}else for(;d>g;g++)if((u||g in h)&&h[g]===c)return u||g||0;return!u&&-1}}},function(r,h,i){var o=i(7),a=i(44),s=i(43),u=i(3),l=i(31),c=i(64),f={},p={},h=r.exports=function(d,g,C,x,T){var v,k,j,O,$=T?function(){return d}:c(d),X=o(C,x,g?2:1),J=0;if(typeof $!="function")throw TypeError(d+" is not iterable!");if(s($)){for(v=l(d.length);v>J;J++)if(O=g?X(u(k=d[J])[0],k[1]):X(d[J]),O===f||O===p)return O}else for(j=$.call(d);!(k=j.next()).done;)if(O=a(j,X,k.value,g),O===f||O===p)return O};h.BREAK=f,h.RETURN=p},function(r,n){r.exports=function(i,o,a){var s=a===void 0;switch(o.length){case 0:return s?i():i.call(a);case 1:return s?i(o[0]):i.call(a,o[0]);case 2:return s?i(o[0],o[1]):i.call(a,o[0],o[1]);case 3:return s?i(o[0],o[1],o[2]):i.call(a,o[0],o[1],o[2]);case 4:return s?i(o[0],o[1],o[2],o[3]):i.call(a,o[0],o[1],o[2],o[3])}return i.apply(a,o)}},function(r,n,i){var o=i(11);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return o(a)=="String"?a.split(""):Object(a)}},function(r,n,i){var o=i(10),a=i(1)("iterator"),s=Array.prototype;r.exports=function(u){return u!==void 0&&(o.Array===u||s[a]===u)}},function(r,n,i){var o=i(3);r.exports=function(a,s,u,l){try{return l?s(o(u)[0],u[1]):s(u)}catch(f){var c=a.return;throw c!==void 0&&o(c.call(a)),f}}},function(r,n,i){"use strict";var o=i(49),a=i(17),s=i(18),u={};i(5)(u,i(1)("iterator"),function(){return this}),r.exports=function(l,c,f){l.prototype=o(u,{next:a(1,f)}),s(l,c+" Iterator")}},function(r,n,i){var o=i(1)("iterator"),a=!1;try{var s=[7][o]();s.return=function(){a=!0},Array.from(s,function(){throw 2})}catch{}r.exports=function(u,l){if(!l&&!a)return!1;var c=!1;try{var f=[7],p=f[o]();p.next=function(){return{done:c=!0}},f[o]=function(){return p},u(f)}catch{}return c}},function(r,n){r.exports=function(i,o){return{value:o,done:!!i}}},function(r,n,i){var o=i(2),a=i(30).set,s=o.MutationObserver||o.WebKitMutationObserver,u=o.process,l=o.Promise,c=i(11)(u)=="process";r.exports=function(){var f,p,h,d=function(){var T,v;for(c&&(T=u.domain)&&T.exit();f;){v=f.fn,f=f.next;try{v()}catch(k){throw f?h():p=void 0,k}}p=void 0,T&&T.enter()};if(c)h=function(){u.nextTick(d)};else if(s){var g=!0,C=document.createTextNode("");new s(d).observe(C,{characterData:!0}),h=function(){C.data=g=!g}}else if(l&&l.resolve){var x=l.resolve();h=function(){x.then(d)}}else h=function(){a.call(o,d)};return function(T){var v={fn:T,next:void 0};p&&(p.next=v),f||(f=v,h()),p=v}}},function(r,n,i){var o=i(3),a=i(50),s=i(22),u=i(19)("IE_PROTO"),l=function(){},c="prototype",f=function(){var p,h=i(16)("iframe"),d=s.length,g=">";for(h.style.display="none",i(25).appendChild(h),h.src="javascript:",p=h.contentWindow.document,p.open(),p.write("<script>document.F=Object<\/script"+g),p.close(),f=p.F;d--;)delete f[c][s[d]];return f()};r.exports=Object.create||function(p,h){var d;return p!==null?(l[c]=o(p),d=new l,l[c]=null,d[u]=p):d=f(),h===void 0?d:a(d,h)}},function(r,n,i){var o=i(12),a=i(3),s=i(54);r.exports=i(4)?Object.defineProperties:function(u,l){a(u);for(var c,f=s(l),p=f.length,h=0;p>h;)o.f(u,c=f[h++],l[c]);return u}},function(r,n,i){var o=i(55),a=i(17),s=i(13),u=i(32),l=i(8),c=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(p,h){if(p=s(p),h=u(h,!0),c)try{return f(p,h)}catch{}if(l(p,h))return a(!o.f.call(p,h),p[h])}},function(r,n,i){var o=i(8),a=i(63),s=i(19)("IE_PROTO"),u=Object.prototype;r.exports=Object.getPrototypeOf||function(l){return l=a(l),o(l,s)?l[s]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?u:null}},function(r,n,i){var o=i(8),a=i(13),s=i(39)(!1),u=i(19)("IE_PROTO");r.exports=function(l,c){var f,p=a(l),h=0,d=[];for(f in p)f!=u&&o(p,f)&&d.push(f);for(;c.length>h;)o(p,f=c[h++])&&(~s(d,f)||d.push(f));return d}},function(r,n,i){var o=i(53),a=i(22);r.exports=Object.keys||function(s){return o(s,a)}},function(r,n){n.f={}.propertyIsEnumerable},function(r,n,i){var o=i(5);r.exports=function(a,s,u){for(var l in s)u&&a[l]?a[l]=s[l]:o(a,l,s[l]);return a}},function(r,n,i){r.exports=i(5)},function(r,n,i){var o=i(9),a=i(3),s=function(u,l){if(a(u),!o(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};r.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(u,l,c){try{c=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),c(u,[]),l=!(u instanceof Array)}catch{l=!0}return function(f,p){return s(f,p),l?f.__proto__=p:c(f,p),f}}({},!1):void 0),check:s}},function(r,n,i){"use strict";var o=i(2),a=i(6),s=i(12),u=i(4),l=i(1)("species");r.exports=function(c){var f=typeof a[c]=="function"?a[c]:o[c];u&&f&&!f[l]&&s.f(f,l,{configurable:!0,get:function(){return this}})}},function(r,n,i){var o=i(3),a=i(14),s=i(1)("species");r.exports=function(u,l){var c,f=o(u).constructor;return f===void 0||(c=o(f)[s])==null?l:a(c)}},function(r,n,i){var o=i(20),a=i(15);r.exports=function(s){return function(u,l){var c,f,p=String(a(u)),h=o(l),d=p.length;return h<0||h>=d?s?"":void 0:(c=p.charCodeAt(h),c<55296||c>56319||h+1===d||(f=p.charCodeAt(h+1))<56320||f>57343?s?p.charAt(h):c:s?p.slice(h,h+2):(c-55296<<10)+(f-56320)+65536)}}},function(r,n,i){var o=i(20),a=Math.max,s=Math.min;r.exports=function(u,l){return u=o(u),u<0?a(u+l,0):s(u,l)}},function(r,n,i){var o=i(15);r.exports=function(a){return Object(o(a))}},function(r,n,i){var o=i(21),a=i(1)("iterator"),s=i(10);r.exports=i(6).getIteratorMethod=function(u){if(u!=null)return u[a]||u["@@iterator"]||s[o(u)]}},function(r,n,i){"use strict";var o=i(37),a=i(47),s=i(10),u=i(13);r.exports=i(27)(Array,"Array",function(l,c){this._t=u(l),this._i=0,this._k=c},function(){var l=this._t,c=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,a(1)):c=="keys"?a(0,f):c=="values"?a(0,l[f]):a(0,[f,l[f]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(r,n){},function(r,n,i){"use strict";var o,a,s,u=i(28),l=i(2),c=i(7),f=i(21),p=i(23),h=i(9),d=(i(3),i(14)),g=i(38),C=i(40),x=(i(58).set,i(60)),T=i(30).set,v=i(48)(),k="Promise",j=l.TypeError,$=l.process,O=l[k],$=l.process,X=f($)=="process",J=function(){},le=!!function(){try{var H=O.resolve(1),K=(H.constructor={})[i(1)("species")]=function(ne){ne(J,J)};return(X||typeof PromiseRejectionEvent=="function")&&H.then(J)instanceof K}catch{}}(),pe=function(H,K){return H===K||H===O&&K===s},G=function(H){var K;return!(!h(H)||typeof(K=H.then)!="function")&&K},I=function(H){return pe(O,H)?new U(H):new a(H)},U=a=function(H){var K,ne;this.promise=new H(function(Me,Ne){if(K!==void 0||ne!==void 0)throw j("Bad Promise constructor");K=Me,ne=Ne}),this.resolve=d(K),this.reject=d(ne)},z=function(H){try{H()}catch(K){return{error:K}}},de=function(H,K){if(!H._n){H._n=!0;var ne=H._c;v(function(){for(var Me=H._v,Ne=H._s==1,Nr=0,Ur=function(Or){var _t,Tt,vn=Ne?Or.ok:Or.fail,Hr=Or.resolve,Qt=Or.reject,Br=Or.domain;try{vn?(Ne||(H._h==2&&he(H),H._h=1),vn===!0?_t=Me:(Br&&Br.enter(),_t=vn(Me),Br&&Br.exit()),_t===Or.promise?Qt(j("Promise-chain cycle")):(Tt=G(_t))?Tt.call(_t,Hr,Qt):Hr(_t)):Qt(Me)}catch(_n){Qt(_n)}};ne.length>Nr;)Ur(ne[Nr++]);H._c=[],H._n=!1,K&&!H._h&&ie(H)})}},ie=function(H){T.call(l,function(){var K,ne,Me,Ne=H._v;if(re(H)&&(K=z(function(){X?$.emit("unhandledRejection",Ne,H):(ne=l.onunhandledrejection)?ne({promise:H,reason:Ne}):(Me=l.console)&&Me.error&&Me.error("Unhandled promise rejection",Ne)}),H._h=X||re(H)?2:1),H._a=void 0,K)throw K.error})},re=function(H){if(H._h==1)return!1;for(var K,ne=H._a||H._c,Me=0;ne.length>Me;)if(K=ne[Me++],K.fail||!re(K.promise))return!1;return!0},he=function(H){T.call(l,function(){var K;X?$.emit("rejectionHandled",H):(K=l.onrejectionhandled)&&K({promise:H,reason:H._v})})},me=function(H){var K=this;K._d||(K._d=!0,K=K._w||K,K._v=H,K._s=2,K._a||(K._a=K._c.slice()),de(K,!0))},ze=function(H){var K,ne=this;if(!ne._d){ne._d=!0,ne=ne._w||ne;try{if(ne===H)throw j("Promise can't be resolved itself");(K=G(H))?v(function(){var Me={_w:ne,_d:!1};try{K.call(H,c(ze,Me,1),c(me,Me,1))}catch(Ne){me.call(Me,Ne)}}):(ne._v=H,ne._s=1,de(ne,!1))}catch(Me){me.call({_w:ne,_d:!1},Me)}}};le||(O=function(H){g(this,O,k,"_h"),d(H),o.call(this);try{H(c(ze,this,1),c(me,this,1))}catch(K){me.call(this,K)}},o=function(H){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},o.prototype=i(56)(O.prototype,{then:function(H,K){var ne=I(x(this,O));return ne.ok=typeof H!="function"||H,ne.fail=typeof K=="function"&&K,ne.domain=X?$.domain:void 0,this._c.push(ne),this._a&&this._a.push(ne),this._s&&de(this,!1),ne.promise},catch:function(H){return this.then(void 0,H)}}),U=function(){var H=new o;this.promise=H,this.resolve=c(ze,H,1),this.reject=c(me,H,1)}),p(p.G+p.W+p.F*!le,{Promise:O}),i(18)(O,k),i(59)(k),s=i(6)[k],p(p.S+p.F*!le,k,{reject:function(H){var K=I(this),ne=K.reject;return ne(H),K.promise}}),p(p.S+p.F*(u||!le),k,{resolve:function(H){if(H instanceof O&&pe(H.constructor,this))return H;var K=I(this),ne=K.resolve;return ne(H),K.promise}}),p(p.S+p.F*!(le&&i(46)(function(H){O.all(H).catch(J)})),k,{all:function(H){var K=this,ne=I(K),Me=ne.resolve,Ne=ne.reject,Nr=z(function(){var Ur=[],Or=0,_t=1;C(H,!1,function(Tt){var vn=Or++,Hr=!1;Ur.push(void 0),_t++,K.resolve(Tt).then(function(Qt){Hr||(Hr=!0,Ur[vn]=Qt,--_t||Me(Ur))},Ne)}),--_t||Me(Ur)});return Nr&&Ne(Nr.error),ne.promise},race:function(H){var K=this,ne=I(K),Me=ne.reject,Ne=z(function(){C(H,!1,function(Nr){K.resolve(Nr).then(ne.resolve,Me)})});return Ne&&Me(Ne.error),ne.promise}})},function(r,n,i){"use strict";var o=i(61)(!0);i(27)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,s=this._t,u=this._i;return u>=s.length?{value:void 0,done:!0}:(a=o(s,u),this._i+=a.length,{value:a,done:!1})})},function(r,n,i){i(65);for(var o=i(2),a=i(5),s=i(10),u=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var f=l[c],p=o[f],h=p&&p.prototype;h&&!h[u]&&a(h,u,f),s[f]=s.Array}},function(r,n){r.exports=require("child_process")},function(r,n){r.exports=require("crypto")}])})});var b_=b((e5,ik)=>{ik.exports=function(e,r){var n="000000000"+e;return n.substr(n.length-r)}});var lk=b((t5,uk)=>{var ok=b_(),k3=require("os"),ak=2,P3=ok(process.pid.toString(36),ak),sk=k3.hostname(),D3=sk.length,N3=ok(sk.split("").reduce(function(t,e){return+t+e.charCodeAt(0)},+D3+36).toString(36),ak);uk.exports=function(){return P3+N3}});var fk=b((r5,ck)=>{var O3=require("crypto"),I3=Math.pow(2,32)-1;ck.exports=function(){return Math.abs(O3.randomBytes(4).readInt32BE()/I3)}});var gk=b((n5,mk)=>{var Gd=lk(),dk=b_(),$3=fk(),Wu=0,E_=4,Ud=36,pk=Math.pow(Ud,E_);function A_(){return dk(($3()*pk<<0).toString(Ud),E_)}function hk(){return Wu=Wu<pk?Wu:0,Wu++,Wu-1}function Ku(){var t="c",e=new Date().getTime().toString(Ud),r=dk(hk().toString(Ud),E_),n=Gd(),i=A_()+A_();return t+e+r+n+i}Ku.slug=function(){var e=new Date().getTime().toString(36),r=hk().toString(36).slice(-4),n=Gd().slice(0,1)+Gd().slice(-1),i=A_().slice(-2);return e.slice(-2)+r+n+i};Ku.isCuid=function(e){return typeof e!="string"?!1:!!e.startsWith("c")};Ku.isSlug=function(e){if(typeof e!="string")return!1;var r=e.length;return r>=7&&r<=10};Ku.fingerprint=Gd;mk.exports=Ku});var vk=b((i5,yk)=>{"use strict";var M3=setTimeout;function L3(t,e){var r=e.useCachedSetTimeout?M3:setTimeout;return new Promise(function(n){r(n,t)})}yk.exports=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.useCachedSetTimeout,n=L3(t,{useCachedSetTimeout:r});function i(o){return n.then(function(){return o})}return i.then=function(){return n.then.apply(n,arguments)},i.catch=Promise.resolve().catch,i}});var bk=b((o5,Rk)=>{"use strict";var x_=[],Vu=[],_k=!1,C_=0,Tk=1e4,hs={},zu={};function w_(t,e,r){let n=!1;function i(){n||(n=!0,t===!0&&process.nextTick(process.exit.bind(null,e)))}function o(){process.nextTick(()=>{--C_===0&&i()})}function a(s,u,l){return t&&l.length>s?(C_++,u?l(u,o):l(o)):u?l(u):l()}_k||(_k=!0,r&&Vu.map(a.bind(null,1,r)),x_.map(a.bind(null,0,null)),C_?setTimeout(()=>{i()},Tk):i())}function Gr(t){x_.push(t),x_.length===1&&(Gr.hookEvent("exit"),Gr.hookEvent("beforeExit",0),Gr.hookEvent("SIGHUP",128+1),Gr.hookEvent("SIGINT",128+2),Gr.hookEvent("SIGTERM",128+15),Gr.hookEvent("SIGBREAK",128+21),Gr.hookEvent("message",0,function(e){if(e!=="shutdown")return!0}))}Gr.hookEvent=function(t,e,r){hs[t]=function(){let n=zu[t];for(let i=0;i<n.length;i++)if(n[i].apply(this,arguments))return;w_(e!=null,e)},zu[t]||(zu[t]=[]),r&&zu[t].push(r),process.on(t,hs[t])};Gr.unhookEvent=function(t){process.removeListener(t,hs[t]),delete hs[t],delete zu[t]};Gr.hookedEvents=function(){let t=[];for(let e in hs)({}).hasOwnProperty.call(hs,e)&&t.push(e);return t};Gr.uncaughtExceptionHandler=function(t){Vu.push(t),Vu.length===1&&process.once("uncaughtException",w_.bind(null,!0,1))};Gr.unhandledRejectionHandler=function(t){Vu.push(t),Vu.length===1&&process.once("unhandledRejection",w_.bind(null,!0,1))};Gr.forceExitTimeout=function(t){Tk=t};Rk.exports=Gr});var Hd=b((s5,F3)=>{F3.exports={name:"zenstack",publisher:"zenstack",displayName:"ZenStack Language Tools",description:"A toolkit for building secure CRUD apps with Next.js + Typescript",version:"0.6.0-pre.5",author:{name:"ZenStack Team"},homepage:"https://zenstack.dev",license:"MIT",keywords:["fullstack","react","typescript","data modeling"],preview:!0,icon:"asset/logo-256-bg.png",repository:{type:"git",url:"https://github.com/zenstackhq/zenstack"},publishConfig:{directory:"bundle",linkDirectory:!0},engines:{vscode:"^1.56.0"},categories:["Programming Languages"],contributes:{languages:[{id:"zmodel",aliases:["ZenStack Model","zmodel"],extensions:[".zmodel"],configuration:"./language-configuration.json",icon:{light:"./asset/logo-light-256.png",dark:"./asset/logo-dark-256.png"}}],grammars:[{language:"zmodel",scopeName:"source.zmodel",path:"./syntaxes/zmodel.tmLanguage.json"}]},activationEvents:["onLanguage:zmodel"],bin:{zenstack:"bin/cli"},main:"./extension.js",scripts:{"vscode:publish":"vsce publish --no-dependencies","vscode:prepublish":"cp ../../README.md ./ && pnpm lint && pnpm build","vscode:package":"vsce package --no-dependencies",clean:"rimraf bundle",build:"pnpm lint && pnpm bundle && tsc --emitDeclarationOnly --declaration ",bundle:"pnpm clean && node build/bundle.js --minify",watch:"node build/bundle.js --watch","ts:watch":"tsc --watch --noEmit","tsc-alias:watch":"tsc-alias --watch",lint:"eslint src --ext ts",test:"jest",prepublishOnly:"cp ../../README.md ./ && pnpm build","publish-dev":"pnpm publish --tag dev",postinstall:"node bin/post-install.js"},dependencies:{"@zenstackhq/language":"workspace:*","@zenstackhq/runtime":"workspace:*","@zenstackhq/sdk":"workspace:*","async-exit-hook":"^2.0.1","change-case":"^4.1.2",chevrotain:"^9.1.0",colors:"1.4.0",commander:"^8.3.0",cuid:"^2.1.8",langium:"^0.5.0",mixpanel:"^0.17.0","node-machine-id":"^1.1.12",ora:"^6.1.2",pluralize:"^8.0.0",prisma:"~4.7.0",promisify:"^0.0.3","sleep-promise":"^9.1.0","ts-morph":"^16.0.0",uuid:"^9.0.0","vscode-jsonrpc":"^8.0.2","vscode-languageclient":"^8.0.2","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.7","vscode-uri":"^3.0.6",zod:"^3.19.1"},devDependencies:{"@prisma/generator-helper":"^4.7.1","@prisma/internals":"~4.7.0","@types/async-exit-hook":"^2.0.0","@types/jest":"^29.2.0","@types/node":"^14.18.32","@types/pluralize":"^0.0.29","@types/tmp":"^0.2.3","@types/uuid":"^8.3.4","@types/vscode":"^1.56.0","@typescript-eslint/eslint-plugin":"^5.42.0","@typescript-eslint/parser":"^5.42.0",concurrently:"^7.4.0",dotenv:"^16.0.3",esbuild:"^0.15.12",eslint:"^8.27.0",jest:"^29.2.1","langium-cli":"^0.5.0",rimraf:"^3.0.2",tmp:"^0.2.1","ts-jest":"^29.0.3","ts-node":"^10.9.1","tsc-alias":"^1.7.0","tsconfig-paths-jest":"^0.0.1",typescript:"^4.8.4",vsce:"^2.13.0"}}});var Sk=b(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.TRANSACTION_FIELD_NAME=yo.GUARD_FIELD_NAME=yo.PluginError=void 0;var D_=class extends Error{constructor(e){super(e)}};yo.PluginError=D_;yo.GUARD_FIELD_NAME="zenstack_guard";yo.TRANSACTION_FIELD_NAME="zenstack_transaction"});var kk=b(vo=>{"use strict";var q3=vo&&vo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0});vo.NodeFileSystem=vo.NodeFileSystemProvider=void 0;var N_=q3(require("fs")),j3=$n(),Bd=class{constructor(){this.encoding="utf-8"}readFile(e){return N_.default.promises.readFile(e.fsPath,this.encoding)}readFileSync(e){return N_.default.readFileSync(e.fsPath,this.encoding)}async readDirectory(e){return(await N_.default.promises.readdir(e.fsPath,{withFileTypes:!0})).map(n=>({dirent:n,isFile:n.isFile(),isDirectory:n.isDirectory(),uri:j3.Utils.joinPath(e,n.name)}))}};vo.NodeFileSystemProvider=Bd;vo.NodeFileSystem={fileSystemProvider:()=>new Bd}});var Pk=b(Qo=>{"use strict";var G3=Qo&&Qo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U3=Qo&&Qo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G3(e,t,r)};Object.defineProperty(Qo,"__esModule",{value:!0});U3(kk(),Qo)});var Nk=b((g5,Dk)=>{Dk.exports=Pk()});var Wn=b(ea=>{"use strict";var H3=ea&&ea.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B3=ea&&ea.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&H3(e,t,r)};Object.defineProperty(ea,"__esModule",{value:!0});B3(e_(),ea)});var Lk=b(($_,M_)=>{(function(t,e){typeof require=="function"&&typeof $_=="object"&&typeof M_=="object"?M_.exports=e():typeof define=="function"&&define.amd?define(function(){return e()}):t.pluralize=e()})($_,function(){var t=[],e=[],r={},n={},i={};function o(h){return typeof h=="string"?new RegExp("^"+h+"$","i"):h}function a(h,d){return h===d?d:h===h.toLowerCase()?d.toLowerCase():h===h.toUpperCase()?d.toUpperCase():h[0]===h[0].toUpperCase()?d.charAt(0).toUpperCase()+d.substr(1).toLowerCase():d.toLowerCase()}function s(h,d){return h.replace(/\$(\d{1,2})/g,function(g,C){return d[C]||""})}function u(h,d){return h.replace(d[0],function(g,C){var x=s(d[1],arguments);return a(g===""?h[C-1]:g,x)})}function l(h,d,g){if(!h.length||r.hasOwnProperty(h))return d;for(var C=g.length;C--;){var x=g[C];if(x[0].test(d))return u(d,x)}return d}function c(h,d,g){return function(C){var x=C.toLowerCase();return d.hasOwnProperty(x)?a(C,x):h.hasOwnProperty(x)?a(C,h[x]):l(x,C,g)}}function f(h,d,g,C){return function(x){var T=x.toLowerCase();return d.hasOwnProperty(T)?!0:h.hasOwnProperty(T)?!1:l(T,T,g)===T}}function p(h,d,g){var C=d===1?p.singular(h):p.plural(h);return(g?d+" ":"")+C}return p.plural=c(i,n,t),p.isPlural=f(i,n,t),p.singular=c(n,i,e),p.isSingular=f(n,i,e),p.addPluralRule=function(h,d){t.push([o(h),d])},p.addSingularRule=function(h,d){e.push([o(h),d])},p.addUncountableRule=function(h){if(typeof h=="string"){r[h.toLowerCase()]=!0;return}p.addPluralRule(h,"$0"),p.addSingularRule(h,"$0")},p.addIrregularRule=function(h,d){d=d.toLowerCase(),h=h.toLowerCase(),i[h]=d,n[d]=h},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(h){return p.addIrregularRule(h[0],h[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(h){return p.addPluralRule(h[0],h[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(h){return p.addSingularRule(h[0],h[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p})});var Qk=b(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.getLiteralArray=_i.getArray=_i.getLiteral=_i.resolved=void 0;var Xk=Wn();function X3(t){if(!t.ref)throw new Error(`Reference not resolved: ${t.$refText}`);return t.ref}_i.resolved=X3;function Zk(t){if(!!(0,Xk.isLiteralExpr)(t))return t.value}_i.getLiteral=Zk;function Jk(t){return(0,Xk.isArrayExpr)(t)?t.items:void 0}_i.getArray=Jk;function Z3(t){let e=Jk(t);if(!!e)return e.map(r=>Zk(r))}_i.getLiteralArray=Z3});var hP=b((cY,K_)=>{"use strict";var pP=(t,e)=>{for(let r of Reflect.ownKeys(e))Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t};K_.exports=pP;K_.exports.default=pP});var gP=b((fY,ip)=>{"use strict";var cK=hP(),np=new WeakMap,mP=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,i=t.displayName||t.name||"<anonymous>",o=function(...a){if(np.set(o,++n),n===1)r=t.apply(this,a),t=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return cK(o,t),np.set(o,n),o};ip.exports=mP;ip.exports.default=mP;ip.exports.callCount=t=>{if(!np.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return np.get(t)}});var yP=b((dY,op)=>{op.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&op.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&op.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var bP=b((pY,bs)=>{var vt=global.process,ra=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};ra(vt)?(vP=require("assert"),Ts=yP(),_P=/^win/i.test(vt.platform),nl=require("events"),typeof nl!="function"&&(nl=nl.EventEmitter),vt.__signal_exit_emitter__?Jt=vt.__signal_exit_emitter__:(Jt=vt.__signal_exit_emitter__=new nl,Jt.count=0,Jt.emitted={}),Jt.infinite||(Jt.setMaxListeners(1/0),Jt.infinite=!0),bs.exports=function(t,e){if(!ra(global.process))return function(){};vP.equal(typeof t,"function","a callback must be provided for exit handler"),Rs===!1&&z_();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){Jt.removeListener(r,t),Jt.listeners("exit").length===0&&Jt.listeners("afterexit").length===0&&ap()};return Jt.on(r,t),n},ap=function(){!Rs||!ra(global.process)||(Rs=!1,Ts.forEach(function(e){try{vt.removeListener(e,sp[e])}catch{}}),vt.emit=up,vt.reallyExit=V_,Jt.count-=1)},bs.exports.unload=ap,na=function(e,r,n){Jt.emitted[e]||(Jt.emitted[e]=!0,Jt.emit(e,r,n))},sp={},Ts.forEach(function(t){sp[t]=function(){if(!!ra(global.process)){var r=vt.listeners(t);r.length===Jt.count&&(ap(),na("exit",null,t),na("afterexit",null,t),_P&&t==="SIGHUP"&&(t="SIGINT"),vt.kill(vt.pid,t))}}}),bs.exports.signals=function(){return Ts},Rs=!1,z_=function(){Rs||!ra(global.process)||(Rs=!0,Jt.count+=1,Ts=Ts.filter(function(e){try{return vt.on(e,sp[e]),!0}catch{return!1}}),vt.emit=RP,vt.reallyExit=TP)},bs.exports.load=z_,V_=vt.reallyExit,TP=function(e){!ra(global.process)||(vt.exitCode=e||0,na("exit",vt.exitCode,null),na("afterexit",vt.exitCode,null),V_.call(vt,vt.exitCode))},up=vt.emit,RP=function(e,r){if(e==="exit"&&ra(global.process)){r!==void 0&&(vt.exitCode=r);var n=up.apply(this,arguments);return na("exit",vt.exitCode,null),na("afterexit",vt.exitCode,null),n}else return up.apply(this,arguments)}):bs.exports=function(){return function(){}};var vP,Ts,_P,nl,Jt,ap,na,sp,Rs,z_,V_,TP,up,RP});var wP=b((yY,dK)=>{dK.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]}}});var PP=b((vY,kP)=>{"use strict";var cp=Object.assign({},wP()),SP=Object.keys(cp);Object.defineProperty(cp,"random",{get(){let t=Math.floor(Math.random()*SP.length),e=SP[t];return cp[e]}});kP.exports=cp});var DP=b((xY,fp)=>{var gK=function(){"use strict";function t(a,s,u,l){var c;typeof s=="object"&&(u=s.depth,l=s.prototype,c=s.filter,s=s.circular);var f=[],p=[],h=typeof Buffer<"u";typeof s>"u"&&(s=!0),typeof u>"u"&&(u=1/0);function d(g,C){if(g===null)return null;if(C==0)return g;var x,T;if(typeof g!="object")return g;if(t.__isArray(g))x=[];else if(t.__isRegExp(g))x=new RegExp(g.source,o(g)),g.lastIndex&&(x.lastIndex=g.lastIndex);else if(t.__isDate(g))x=new Date(g.getTime());else{if(h&&Buffer.isBuffer(g))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(g.length):x=new Buffer(g.length),g.copy(x),x;typeof l>"u"?(T=Object.getPrototypeOf(g),x=Object.create(T)):(x=Object.create(l),T=l)}if(s){var v=f.indexOf(g);if(v!=-1)return p[v];f.push(g),p.push(x)}for(var k in g){var j;T&&(j=Object.getOwnPropertyDescriptor(T,k)),!(j&&j.set==null)&&(x[k]=d(g[k],C-1))}return x}return d(a,u)}t.clonePrototype=function(s){if(s===null)return null;var u=function(){};return u.prototype=s,new u};function e(a){return Object.prototype.toString.call(a)}t.__objToStr=e;function r(a){return typeof a=="object"&&e(a)==="[object Date]"}t.__isDate=r;function n(a){return typeof a=="object"&&e(a)==="[object Array]"}t.__isArray=n;function i(a){return typeof a=="object"&&e(a)==="[object RegExp]"}t.__isRegExp=i;function o(a){var s="";return a.global&&(s+="g"),a.ignoreCase&&(s+="i"),a.multiline&&(s+="m"),s}return t.__getRegExpFlags=o,t}();typeof fp=="object"&&fp.exports&&(fp.exports=gK)});var OP=b((wY,NP)=>{var yK=DP();NP.exports=function(t,e){return t=t||{},Object.keys(e).forEach(function(r){typeof t[r]>"u"&&(t[r]=yK(e[r]))}),t}});var $P=b((SY,IP)=>{IP.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]});var qP=b((kY,Q_)=>{"use strict";var vK=OP(),al=$P(),LP={nul:0,control:0};Q_.exports=function(e){return FP(e,LP)};Q_.exports.config=function(t){return t=vK(t||{},LP),function(r){return FP(r,t)}};function FP(t,e){if(typeof t!="string")return MP(t,e);for(var r=0,n=0;n<t.length;n++){var i=MP(t.charCodeAt(n),e);if(i<0)return-1;r+=i}return r}function MP(t,e){return t===0?e.nul:t<32||t>=127&&t<160?e.control:_K(t)?0:1+(t>=4352&&(t<=4447||t==9001||t==9002||t>=11904&&t<=42191&&t!=12351||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=131072&&t<=196605||t>=196608&&t<=262141))}function _K(t){var e=0,r=al.length-1,n;if(t<al[0][0]||t>al[r][1])return!1;for(;r>=e;)if(n=Math.floor((e+r)/2),t>al[n][1])e=n+1;else if(t<al[n][0])r=n-1;else return!0;return!1}});var tT=b((DY,jP)=>{jP.exports=require("stream")});var BP=b((NY,HP)=>{"use strict";function GP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function TK(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GP(Object(r),!0).forEach(function(n){RK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RK(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function AK(t,e,r){return e&&UP(t.prototype,e),r&&UP(t,r),t}var EK=require("buffer"),dp=EK.Buffer,CK=require("util"),rT=CK.inspect,xK=rT&&rT.custom||"inspect";function wK(t,e,r){dp.prototype.copy.call(t,e,r)}HP.exports=function(){function t(){bK(this,t),this.head=null,this.tail=null,this.length=0}return AK(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return dp.alloc(0);for(var n=dp.allocUnsafe(r>>>0),i=this.head,o=0;i;)wK(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=dp.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,s),r-=s,r===0){s===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++o}return this.length-=o,n}},{key:xK,value:function(r,n){return rT(this,TK({},n,{depth:0,customInspect:!1}))}}]),t}()});var iT=b((OY,KP)=>{"use strict";function SK(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(nT,this,t)):process.nextTick(nT,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(pp,r):(r._writableState.errorEmitted=!0,process.nextTick(WP,r,o)):process.nextTick(WP,r,o):e?(process.nextTick(pp,r),e(o)):process.nextTick(pp,r)}),this)}function WP(t,e){nT(t,e),pp(t)}function pp(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function kK(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function nT(t,e){t.emit("error",e)}function PK(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}KP.exports={destroy:SK,undestroy:kK,errorOrDestroy:PK}});var Ro=b((IY,YP)=>{"use strict";var VP={};function mn(t,e,r){r||(r=Error);function n(o,a,s){return typeof e=="string"?e:e(o,a,s)}class i extends r{constructor(a,s,u){super(n(a,s,u))}}i.prototype.name=r.name,i.prototype.code=t,VP[t]=i}function zP(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function DK(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function NK(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function OK(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}mn("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);mn("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&DK(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(NK(t," argument"))i=`The ${t} ${n} ${zP(e,"type")}`;else{let o=OK(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${zP(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);mn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");mn("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});mn("ERR_STREAM_PREMATURE_CLOSE","Premature close");mn("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});mn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");mn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");mn("ERR_STREAM_WRITE_AFTER_END","write after end");mn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);mn("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);mn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");YP.exports.codes=VP});var oT=b(($Y,XP)=>{"use strict";var IK=Ro().codes.ERR_INVALID_OPT_VALUE;function $K(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function MK(t,e,r,n){var i=$K(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new IK(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}XP.exports={getHighWaterMark:MK}});var ZP=b((MY,aT)=>{typeof Object.create=="function"?aT.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:aT.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var ia=b((LY,uT)=>{try{if(sT=require("util"),typeof sT.inherits!="function")throw"";uT.exports=sT.inherits}catch{uT.exports=ZP()}var sT});var QP=b((FY,JP)=>{JP.exports=require("util").deprecate});var fT=b((qY,oD)=>{"use strict";oD.exports=Pt;function tD(t){var e=this;this.next=null,this.entry=null,this.finish=function(){lz(e,t)}}var Es;Pt.WritableState=ul;var LK={deprecate:QP()},rD=tT(),mp=require("buffer").Buffer,FK=global.Uint8Array||function(){};function qK(t){return mp.from(t)}function jK(t){return mp.isBuffer(t)||t instanceof FK}var cT=iT(),GK=oT(),UK=GK.getHighWaterMark,bo=Ro().codes,HK=bo.ERR_INVALID_ARG_TYPE,BK=bo.ERR_METHOD_NOT_IMPLEMENTED,WK=bo.ERR_MULTIPLE_CALLBACK,KK=bo.ERR_STREAM_CANNOT_PIPE,zK=bo.ERR_STREAM_DESTROYED,VK=bo.ERR_STREAM_NULL_VALUES,YK=bo.ERR_STREAM_WRITE_AFTER_END,XK=bo.ERR_UNKNOWN_ENCODING,Cs=cT.errorOrDestroy;ia()(Pt,rD);function ZK(){}function ul(t,e,r){Es=Es||oa(),t=t||{},typeof r!="boolean"&&(r=e instanceof Es),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=UK(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){iz(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tD(this)}ul.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(ul.prototype,"buffer",{get:LK.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var hp;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(hp=Function.prototype[Symbol.hasInstance],Object.defineProperty(Pt,Symbol.hasInstance,{value:function(e){return hp.call(this,e)?!0:this!==Pt?!1:e&&e._writableState instanceof ul}})):hp=function(e){return e instanceof this};function Pt(t){Es=Es||oa();var e=this instanceof Es;if(!e&&!hp.call(Pt,this))return new Pt(t);this._writableState=new ul(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),rD.call(this)}Pt.prototype.pipe=function(){Cs(this,new KK)};function JK(t,e){var r=new YK;Cs(t,r),process.nextTick(e,r)}function QK(t,e,r,n){var i;return r===null?i=new VK:typeof r!="string"&&!e.objectMode&&(i=new HK("chunk",["string","Buffer"],r)),i?(Cs(t,i),process.nextTick(n,i),!1):!0}Pt.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&jK(t);return o&&!mp.isBuffer(t)&&(t=qK(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=ZK),n.ending?JK(this,r):(o||QK(this,n,t,r))&&(n.pendingcb++,i=tz(this,n,o,t,e,r)),i};Pt.prototype.cork=function(){this._writableState.corked++};Pt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&nD(this,t))};Pt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new XK(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Pt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ez(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=mp.from(e,r)),e}Object.defineProperty(Pt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tz(t,e,r,n,i,o){if(!r){var a=ez(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else lT(t,e,!1,s,n,i,o);return u}function lT(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new zK("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function rz(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(sl,t,e),t._writableState.errorEmitted=!0,Cs(t,n)):(i(n),t._writableState.errorEmitted=!0,Cs(t,n),sl(t,e))}function nz(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function iz(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new WK;if(nz(r),e)rz(t,r,n,e,i);else{var o=iD(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&nD(t,r),n?process.nextTick(eD,t,r,o,i):eD(t,r,o,i)}}function eD(t,e,r,n){r||oz(t,e),e.pendingcb--,n(),sl(t,e)}function oz(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function nD(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,lT(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new tD(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if(lT(t,e,!1,f,u,l,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Pt.prototype._write=function(t,e,r){r(new BK("_write()"))};Pt.prototype._writev=null;Pt.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||uz(this,n,r),this};Object.defineProperty(Pt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function iD(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function az(t,e){t._final(function(r){e.pendingcb--,r&&Cs(t,r),e.prefinished=!0,t.emit("prefinish"),sl(t,e)})}function sz(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(az,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function sl(t,e){var r=iD(e);if(r&&(sz(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function uz(t,e,r){e.ending=!0,sl(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function lz(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Pt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});Pt.prototype.destroy=cT.destroy;Pt.prototype._undestroy=cT.undestroy;Pt.prototype._destroy=function(t,e){e(t)}});var oa=b((jY,sD)=>{"use strict";var cz=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};sD.exports=Ti;var aD=hT(),pT=fT();ia()(Ti,aD);for(dT=cz(pT.prototype),gp=0;gp<dT.length;gp++)yp=dT[gp],Ti.prototype[yp]||(Ti.prototype[yp]=pT.prototype[yp]);var dT,yp,gp;function Ti(t){if(!(this instanceof Ti))return new Ti(t);aD.call(this,t),pT.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",fz)))}Object.defineProperty(Ti.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ti.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ti.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fz(){this._writableState.ended||process.nextTick(dz,this)}function dz(t){t.end()}Object.defineProperty(Ti.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var cD=b((mT,lD)=>{var vp=require("buffer"),Ri=vp.Buffer;function uD(t,e){for(var r in t)e[r]=t[r]}Ri.from&&Ri.alloc&&Ri.allocUnsafe&&Ri.allocUnsafeSlow?lD.exports=vp:(uD(vp,mT),mT.Buffer=aa);function aa(t,e,r){return Ri(t,e,r)}aa.prototype=Object.create(Ri.prototype);uD(Ri,aa);aa.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ri(t,e,r)};aa.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Ri(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};aa.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ri(t)};aa.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return vp.SlowBuffer(t)}});var vT=b(dD=>{"use strict";var yT=cD().Buffer,fD=yT.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pz(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function hz(t){var e=pz(t);if(typeof e!="string"&&(yT.isEncoding===fD||!fD(t)))throw new Error("Unknown encoding: "+t);return e||t}dD.StringDecoder=ll;function ll(t){this.encoding=hz(t);var e;switch(this.encoding){case"utf16le":this.text=Tz,this.end=Rz,e=4;break;case"utf8":this.fillLast=yz,e=4;break;case"base64":this.text=bz,this.end=Az,e=3;break;default:this.write=Ez,this.end=Cz;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=yT.allocUnsafe(e)}ll.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};ll.prototype.end=_z;ll.prototype.text=vz;ll.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function gT(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function mz(t,e,r){var n=e.length-1;if(n<r)return 0;var i=gT(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=gT(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=gT(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function gz(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function yz(t){var e=this.lastTotal-this.lastNeed,r=gz(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function vz(t,e){var r=mz(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function _z(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Tz(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Rz(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function bz(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Az(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Ez(t){return t.toString(this.encoding)}function Cz(t){return t&&t.length?this.write(t):""}});var _p=b((UY,mD)=>{"use strict";var pD=Ro().codes.ERR_STREAM_PREMATURE_CLOSE;function xz(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function wz(){}function Sz(t){return t.setHeader&&typeof t.abort=="function"}function hD(t,e,r){if(typeof e=="function")return hD(t,null,e);e||(e={}),r=xz(r||wz);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||s()},a=t._writableState&&t._writableState.finished,s=function(){i=!1,a=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},c=function(d){r.call(t,d)},f=function(){var d;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(d=new pD),r.call(t,d);if(i&&!a)return(!t._writableState||!t._writableState.ended)&&(d=new pD),r.call(t,d)},p=function(){t.req.on("finish",s)};return Sz(t)?(t.on("complete",s),t.on("abort",f),t.req?p():t.on("request",p)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",s),e.error!==!1&&t.on("error",c),t.on("close",f),function(){t.removeListener("complete",s),t.removeListener("abort",f),t.removeListener("request",p),t.req&&t.req.removeListener("finish",s),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",s),t.removeListener("end",l),t.removeListener("error",c),t.removeListener("close",f)}}mD.exports=hD});var yD=b((HY,gD)=>{"use strict";var Tp;function Ao(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var kz=_p(),Eo=Symbol("lastResolve"),sa=Symbol("lastReject"),cl=Symbol("error"),Rp=Symbol("ended"),ua=Symbol("lastPromise"),_T=Symbol("handlePromise"),la=Symbol("stream");function Co(t,e){return{value:t,done:e}}function Pz(t){var e=t[Eo];if(e!==null){var r=t[la].read();r!==null&&(t[ua]=null,t[Eo]=null,t[sa]=null,e(Co(r,!1)))}}function Dz(t){process.nextTick(Pz,t)}function Nz(t,e){return function(r,n){t.then(function(){if(e[Rp]){r(Co(void 0,!0));return}e[_T](r,n)},n)}}var Oz=Object.getPrototypeOf(function(){}),Iz=Object.setPrototypeOf((Tp={get stream(){return this[la]},next:function(){var e=this,r=this[cl];if(r!==null)return Promise.reject(r);if(this[Rp])return Promise.resolve(Co(void 0,!0));if(this[la].destroyed)return new Promise(function(a,s){process.nextTick(function(){e[cl]?s(e[cl]):a(Co(void 0,!0))})});var n=this[ua],i;if(n)i=new Promise(Nz(n,this));else{var o=this[la].read();if(o!==null)return Promise.resolve(Co(o,!1));i=new Promise(this[_T])}return this[ua]=i,i}},Ao(Tp,Symbol.asyncIterator,function(){return this}),Ao(Tp,"return",function(){var e=this;return new Promise(function(r,n){e[la].destroy(null,function(i){if(i){n(i);return}r(Co(void 0,!0))})})}),Tp),Oz),$z=function(e){var r,n=Object.create(Iz,(r={},Ao(r,la,{value:e,writable:!0}),Ao(r,Eo,{value:null,writable:!0}),Ao(r,sa,{value:null,writable:!0}),Ao(r,cl,{value:null,writable:!0}),Ao(r,Rp,{value:e._readableState.endEmitted,writable:!0}),Ao(r,_T,{value:function(o,a){var s=n[la].read();s?(n[ua]=null,n[Eo]=null,n[sa]=null,o(Co(s,!1))):(n[Eo]=o,n[sa]=a)},writable:!0}),r));return n[ua]=null,kz(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[sa];o!==null&&(n[ua]=null,n[Eo]=null,n[sa]=null,o(i)),n[cl]=i;return}var a=n[Eo];a!==null&&(n[ua]=null,n[Eo]=null,n[sa]=null,a(Co(void 0,!0))),n[Rp]=!0}),e.on("readable",Dz.bind(null,n)),n};gD.exports=$z});var RD=b((BY,TD)=>{"use strict";function vD(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(l){r(l);return}s.done?e(u):Promise.resolve(u).then(n,i)}function Mz(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(u){vD(o,n,i,a,s,"next",u)}function s(u){vD(o,n,i,a,s,"throw",u)}a(void 0)})}}function _D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Lz(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_D(Object(r),!0).forEach(function(n){Fz(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_D(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fz(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var qz=Ro().codes.ERR_INVALID_ARG_TYPE;function jz(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new qz("iterable",["Iterable"],e);var i=new t(Lz({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,a())};function a(){return s.apply(this,arguments)}function s(){return s=Mz(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?a():o=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}TD.exports=jz});var hT=b((KY,DD)=>{"use strict";DD.exports=De;var xs;De.ReadableState=CD;var WY=require("events").EventEmitter,ED=function(e,r){return e.listeners(r).length},dl=tT(),bp=require("buffer").Buffer,Gz=global.Uint8Array||function(){};function Uz(t){return bp.from(t)}function Hz(t){return bp.isBuffer(t)||t instanceof Gz}var TT=require("util"),_e;TT&&TT.debuglog?_e=TT.debuglog("stream"):_e=function(){};var Bz=BP(),wT=iT(),Wz=oT(),Kz=Wz.getHighWaterMark,Ap=Ro().codes,zz=Ap.ERR_INVALID_ARG_TYPE,Vz=Ap.ERR_STREAM_PUSH_AFTER_EOF,Yz=Ap.ERR_METHOD_NOT_IMPLEMENTED,Xz=Ap.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ws,RT,bT;ia()(De,dl);var fl=wT.errorOrDestroy,AT=["error","close","destroy","pause","resume"];function Zz(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function CD(t,e,r){xs=xs||oa(),t=t||{},typeof r!="boolean"&&(r=e instanceof xs),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Kz(this,t,"readableHighWaterMark",r),this.buffer=new Bz,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ws||(ws=vT().StringDecoder),this.decoder=new ws(t.encoding),this.encoding=t.encoding)}function De(t){if(xs=xs||oa(),!(this instanceof De))return new De(t);var e=this instanceof xs;this._readableState=new CD(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),dl.call(this)}Object.defineProperty(De.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});De.prototype.destroy=wT.destroy;De.prototype._undestroy=wT.undestroy;De.prototype._destroy=function(t,e){e(t)};De.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=bp.from(t,e),e=""),n=!0),xD(this,t,e,!1,n)};De.prototype.unshift=function(t){return xD(this,t,null,!0,!1)};function xD(t,e,r,n,i){_e("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,eV(t,o);else{var a;if(i||(a=Jz(o,e)),a)fl(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==bp.prototype&&(e=Uz(e)),n)o.endEmitted?fl(t,new Xz):ET(t,o,e,!0);else if(o.ended)fl(t,new Vz);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?ET(t,o,e,!1):xT(t,o)):ET(t,o,e,!1)}else n||(o.reading=!1,xT(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function ET(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Ep(t)),xT(t,e)}function Jz(t,e){var r;return!Hz(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new zz("chunk",["string","Buffer","Uint8Array"],e)),r}De.prototype.isPaused=function(){return this._readableState.flowing===!1};De.prototype.setEncoding=function(t){ws||(ws=vT().StringDecoder);var e=new ws(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var bD=1073741824;function Qz(t){return t>=bD?t=bD:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function AD(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Qz(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}De.prototype.read=function(t){_e("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return _e("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?CT(this):Ep(this),null;if(t=AD(t,e),t===0&&e.ended)return e.length===0&&CT(this),null;var n=e.needReadable;_e("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,_e("length less than watermark",n)),e.ended||e.reading?(n=!1,_e("reading or ended",n)):n&&(_e("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=AD(r,e)));var i;return t>0?i=kD(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&CT(this)),i!==null&&this.emit("data",i),i};function eV(t,e){if(_e("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Ep(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,wD(t)))}}function Ep(t){var e=t._readableState;_e("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(_e("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(wD,t))}function wD(t){var e=t._readableState;_e("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,ST(t)}function xT(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(tV,t,e))}function tV(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(_e("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}De.prototype._read=function(t){fl(this,new Yz("_read()"))};De.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,_e("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?s:g;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(C,x){_e("onunpipe"),C===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,c())}function s(){_e("onend"),t.end()}var u=rV(r);t.on("drain",u);var l=!1;function c(){_e("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(C){_e("ondata");var x=t.write(C);_e("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&PD(n.pipes,t)!==-1)&&!l&&(_e("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(C){_e("onerror",C),g(),t.removeListener("error",p),ED(t,"error")===0&&fl(t,C)}Zz(t,"error",p);function h(){t.removeListener("finish",d),g()}t.once("close",h);function d(){_e("onfinish"),t.removeListener("close",h),g()}t.once("finish",d);function g(){_e("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(_e("pipe resume"),r.resume()),t};function rV(t){return function(){var r=t._readableState;_e("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&ED(t,"data")&&(r.flowing=!0,ST(t))}}De.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=PD(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};De.prototype.on=function(t,e){var r=dl.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,_e("on readable",n.length,n.reading),n.length?Ep(this):n.reading||process.nextTick(nV,this)),r};De.prototype.addListener=De.prototype.on;De.prototype.removeListener=function(t,e){var r=dl.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(SD,this),r};De.prototype.removeAllListeners=function(t){var e=dl.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(SD,this),e};function SD(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function nV(t){_e("readable nexttick read 0"),t.read(0)}De.prototype.resume=function(){var t=this._readableState;return t.flowing||(_e("resume"),t.flowing=!t.readableListening,iV(this,t)),t.paused=!1,this};function iV(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(oV,t,e))}function oV(t,e){_e("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),ST(t),e.flowing&&!e.reading&&t.read(0)}De.prototype.pause=function(){return _e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ST(t){var e=t._readableState;for(_e("flow",e.flowing);e.flowing&&t.read()!==null;);}De.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(_e("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(_e("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=e.push(a);s||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(s){return function(){return t[s].apply(t,arguments)}}(i));for(var o=0;o<AT.length;o++)t.on(AT[o],this.emit.bind(this,AT[o]));return this._read=function(a){_e("wrapped _read",a),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(De.prototype[Symbol.asyncIterator]=function(){return RT===void 0&&(RT=yD()),RT(this)});Object.defineProperty(De.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(De.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(De.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});De._fromList=kD;Object.defineProperty(De.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function kD(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function CT(t){var e=t._readableState;_e("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(aV,e,t))}function aV(t,e){if(_e("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(De.from=function(t,e){return bT===void 0&&(bT=RD()),bT(De,t,e)});function PD(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var kT=b((zY,OD)=>{"use strict";OD.exports=zi;var Cp=Ro().codes,sV=Cp.ERR_METHOD_NOT_IMPLEMENTED,uV=Cp.ERR_MULTIPLE_CALLBACK,lV=Cp.ERR_TRANSFORM_ALREADY_TRANSFORMING,cV=Cp.ERR_TRANSFORM_WITH_LENGTH_0,xp=oa();ia()(zi,xp);function fV(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new uV);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function zi(t){if(!(this instanceof zi))return new zi(t);xp.call(this,t),this._transformState={afterTransform:fV.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",dV)}function dV(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){ND(t,e,r)}):ND(this,null,null)}zi.prototype.push=function(t,e){return this._transformState.needTransform=!1,xp.prototype.push.call(this,t,e)};zi.prototype._transform=function(t,e,r){r(new sV("_transform()"))};zi.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};zi.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};zi.prototype._destroy=function(t,e){xp.prototype._destroy.call(this,t,function(r){e(r)})};function ND(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new cV;if(t._transformState.transforming)throw new lV;return t.push(null)}});var MD=b((VY,$D)=>{"use strict";$D.exports=pl;var ID=kT();ia()(pl,ID);function pl(t){if(!(this instanceof pl))return new pl(t);ID.call(this,t)}pl.prototype._transform=function(t,e,r){r(null,t)}});var GD=b((YY,jD)=>{"use strict";var PT;function pV(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var qD=Ro().codes,hV=qD.ERR_MISSING_ARGS,mV=qD.ERR_STREAM_DESTROYED;function LD(t){if(t)throw t}function gV(t){return t.setHeader&&typeof t.abort=="function"}function yV(t,e,r,n){n=pV(n);var i=!1;t.on("close",function(){i=!0}),PT===void 0&&(PT=_p()),PT(t,{readable:e,writable:r},function(a){if(a)return n(a);i=!0,n()});var o=!1;return function(a){if(!i&&!o){if(o=!0,gV(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(a||new mV("pipe"))}}}function FD(t){t()}function vV(t,e){return t.pipe(e)}function _V(t){return!t.length||typeof t[t.length-1]!="function"?LD:t.pop()}function TV(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=_V(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new hV("streams");var i,o=e.map(function(a,s){var u=s<e.length-1,l=s>0;return yV(a,u,l,function(c){i||(i=c),c&&o.forEach(FD),!u&&(o.forEach(FD),n(i))})});return e.reduce(vV)}jD.exports=TV});var UD=b((gn,ml)=>{var hl=require("stream");process.env.READABLE_STREAM==="disable"&&hl?(ml.exports=hl.Readable,Object.assign(ml.exports,hl),ml.exports.Stream=hl):(gn=ml.exports=hT(),gn.Stream=hl||gn,gn.Readable=gn,gn.Writable=fT(),gn.Duplex=oa(),gn.Transform=kT(),gn.PassThrough=MD(),gn.finished=_p(),gn.pipeline=GD())});var WD=b((XY,BD)=>{"use strict";var{Buffer:Xn}=require("buffer"),HD=Symbol.for("BufferList");function ut(t){if(!(this instanceof ut))return new ut(t);ut._init.call(this,t)}ut._init=function(e){Object.defineProperty(this,HD,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};ut.prototype._new=function(e){return new ut(e)};ut.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let i=r+this._bufs[n].length;if(e<i||n===this._bufs.length-1)return[n,e-r];r=i}};ut.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r};ut.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};ut.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};ut.prototype.copy=function(e,r,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||Xn.alloc(0);let o=!!e,a=this._offset(n),s=i-n,u=s,l=o&&r||0,c=a[1];if(n===0&&i===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:Xn.concat(this._bufs,this.length);for(let f=0;f<this._bufs.length;f++)this._bufs[f].copy(e,l),l+=this._bufs[f].length;return e}if(u<=this._bufs[a[0]].length-c)return o?this._bufs[a[0]].copy(e,r,c,c+u):this._bufs[a[0]].slice(c,c+u);o||(e=Xn.allocUnsafe(s));for(let f=a[0];f<this._bufs.length;f++){let p=this._bufs[f].length-c;if(u>p)this._bufs[f].copy(e,l,c),l+=p;else{this._bufs[f].copy(e,l,c,c+u),l+=p;break}u-=p,c&&(c=0)}return e.length>l?e.slice(0,l):e};ut.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let n=this._offset(e),i=this._offset(r),o=this._bufs.slice(n[0],i[0]+1);return i[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,i[1]),n[1]!==0&&(o[0]=o[0].slice(n[1])),this._new(o)};ut.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};ut.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ut.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};ut.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(Xn.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(Xn.from(e));return this};ut.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};ut.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=Xn.from([t]):typeof t=="string"?t=Xn.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=Xn.from(t.buffer,t.byteOffset,t.byteLength):Xn.isBuffer(t)||(t=Xn.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let n=this._offset(e),i=n[0],o=n[1];for(;i<this._bufs.length;i++){let a=this._bufs[i];for(;o<a.length;)if(a.length-o>=t.length){let u=a.indexOf(t,o);if(u!==-1)return this._reverseOffset([i,u]);o=a.length-t.length+1}else{let u=this._reverseOffset([i,o]);if(this._match(u,t))return u;o++}o=0}return-1};ut.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?ut.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:ut.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)}})(e)})();ut.prototype._isBufferList=function(e){return e instanceof ut||ut.isBufferList(e)};ut.isBufferList=function(e){return e!=null&&e[HD]};BD.exports=ut});var KD=b((ZY,wp)=>{"use strict";var DT=UD().Duplex,RV=ia(),gl=WD();function Rr(t){if(!(this instanceof Rr))return new Rr(t);if(typeof t=="function"){this._callback=t;let e=function(n){this._callback&&(this._callback(n),this._callback=null)}.bind(this);this.on("pipe",function(n){n.on("error",e)}),this.on("unpipe",function(n){n.removeListener("error",e)}),t=null}gl._init.call(this,t),DT.call(this)}RV(Rr,DT);Object.assign(Rr.prototype,gl.prototype);Rr.prototype._new=function(e){return new Rr(e)};Rr.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n()};Rr.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};Rr.prototype.end=function(e){DT.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Rr.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Rr.prototype._isBufferList=function(e){return e instanceof Rr||e instanceof gl||Rr.isBufferList(e)};Rr.isBufferList=gl.isBufferList;wp.exports=Rr;wp.exports.BufferListStream=Rr;wp.exports.BufferList=gl});var CV={};pN(CV,{default:()=>EV,generateAction:()=>sN,initAction:()=>aN});module.exports=hN(CV);var iN=te(Al()),_l=te(zp()),oN=te(t_());var Ak=te(tk());var rk="74944eb779d7d3b4ce185be843fde9fc";var Ek=te(nk()),Ck=te(gk()),xk=te(require("os")),S_=te(vk()),k_=te(bk());var Dr=class extends Error{};var wk=te(zp());var P_=class{constructor(){this.hostId=(0,Ek.machineIdSync)();this.sessionid=(0,Ck.default)();this.trackingToken=rk;this._os=xk.platform();this.version=Hd().version;this.exitWait=200;process.env.DO_NOT_TRACK!=="1"&&this.trackingToken&&(this.mixpanel=(0,Ak.init)(this.trackingToken,{geolocate:!0})),(0,k_.default)(e=>wt(this,null,function*(){this.mixpanel&&(yield(0,S_.default)(this.exitWait)),e()})),k_.default.uncaughtExceptionHandler(e=>wt(this,null,function*(){this.track("cli:error",{message:e.message,stack:e.stack}),this.mixpanel&&(yield(0,S_.default)(this.exitWait)),e instanceof Dr||e instanceof wk.CommanderError||console.error(`
6460
+ `)),g=+d.split(" ")[1];Gu("got proxy server response: %o",d),e({statusCode:g,buffered:p})}t.on("error",l),t.on("close",s),t.on("end",u),o()})}Uu.default=n3});var BS=b(Jo=>{"use strict";var i3=Jo&&Jo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},ds=Jo&&Jo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jo,"__esModule",{value:!0});var US=ds(require("net")),HS=ds(require("tls")),o3=ds(require("url")),a3=ds(require("assert")),s3=ds(Ld()),u3=jS(),l3=ds(GS()),Hu=s3.default("https-proxy-agent:agent"),u_=class extends u3.Agent{constructor(e){let r;if(typeof e=="string"?r=o3.default.parse(e):r=e,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Hu("creating new HttpsProxyAgent instance: %o",r),super(r);let n=Object.assign({},r);this.secureProxy=r.secureProxy||d3(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,r){return i3(this,void 0,void 0,function*(){let{proxy:n,secureProxy:i}=this,o;i?(Hu("Creating `tls.Socket`: %o",n),o=HS.default.connect(n)):(Hu("Creating `net.Socket`: %o",n),o=US.default.connect(n));let a=Object.assign({},n.headers),u=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
6461
+ `;n.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:l,port:c,secureEndpoint:f}=r;f3(c,f)||(l+=`:${c}`),a.Host=l,a.Connection="close";for(let C of Object.keys(a))u+=`${C}: ${a[C]}\r
6462
+ `;let p=l3.default(o);o.write(`${u}\r
6463
+ `);let{statusCode:h,buffered:d}=yield p;if(h===200){if(e.once("socket",c3),r.secureEndpoint){let C=r.servername||r.host;if(!C)throw new Error('Could not determine "servername"');return Hu("Upgrading socket connection to TLS"),HS.default.connect(Object.assign(Object.assign({},p3(r,"host","hostname","path","port")),{socket:o,servername:C}))}return o}o.destroy();let g=new US.default.Socket;return g.readable=!0,e.once("socket",C=>{Hu("replaying proxy buffer for failed request"),a3.default(C.listenerCount("data")>0),C.push(d),C.push(null)}),g})}};Jo.default=u_;function c3(t){t.resume()}function f3(t,e){return Boolean(!e&&t===80||e&&t===443)}function d3(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function p3(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}});var KS=b((f_,WS)=>{"use strict";var h3=f_&&f_.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},l_=h3(BS());function c_(t){return new l_.default(t)}(function(t){t.HttpsProxyAgent=l_.default,t.prototype=l_.default.prototype})(c_||(c_={}));WS.exports=c_});var zS=b((W8,m3)=>{m3.exports={name:"mixpanel",description:"A simple server-side API for mixpanel",keywords:["mixpanel","analytics","api","stats"],version:"0.17.0",homepage:"https://github.com/mixpanel/mixpanel-node",author:"Carl Sverre",license:"MIT",main:"lib/mixpanel-node",directories:{lib:"lib"},repository:{type:"git",url:"http://github.com/mixpanel/mixpanel-node.git"},engines:{node:">=10.0"},scripts:{test:"nodeunit"},types:"./lib/mixpanel-node.d.ts",devDependencies:{nodeunit:"^0.11.3",proxyquire:"^1.7.11",sinon:"^7.1.1"},dependencies:{"https-proxy-agent":"5.0.0"}}});var p_=b(d_=>{d_.async_all=function(t,e,r){var n=t.length,i=null,o=[],a=function(l,c){l&&(i=i||[],i.push(l)),o.push(c),--n===0&&r(i,o)};if(n===0)r(i,o);else for(var s=0,u=t.length;s<u;s++)e(t[s],a)};d_.ensure_timestamp=function(t){if(!(t instanceof Date||typeof t=="number"))throw new Error("`time` property must be a Date or Unix timestamp and is only required for `import` endpoint");return t instanceof Date?t.getTime():t}});var m_=b(h_=>{var qd=require("util"),{ensure_timestamp:g3}=p_();function ps(t,e){return e&&(e.$ignore_alias&&(t.$ignore_alias=e.$ignore_alias),e.$ignore_time&&(t.$ignore_time=e.$ignore_time),e.hasOwnProperty("$ip")&&(t.$ip=e.$ip),e.hasOwnProperty("$time")&&(t.$time=g3(e.$time)),e.hasOwnProperty("$latitude")&&e.hasOwnProperty("$longitude")&&(t.$latitude=e.$latitude,t.$longitude=e.$longitude)),t}h_.merge_modifiers=ps;h_.ProfileHelpers=(t=Object)=>class extends t{get token(){return this.mixpanel.token}get config(){return this.mixpanel.config}_set(e,r,n,i,{identifiers:o,set_once:a=!1}){let s={};typeof e=="object"?(typeof r=="object"?(i=n,n=r):i=r,s=e):(s[e]=r,(typeof n=="function"||!n)&&(i=n));let u={$token:this.token,...o},l=a?"$set_once":"$set";u[l]=s,"ip"in s&&(u.$ip=s.ip,delete s.ip),s.$ignore_time&&(u.$ignore_time=s.$ignore_time,delete s.$ignore_time),u=ps(u,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(u)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:u},i)}_delete_profile({identifiers:e,modifiers:r,callback:n}){let i={$delete:"",$token:this.token,...e};typeof r=="function"&&(n=r),i=ps(i,r),this.config.debug&&console.log(`Deleting profile ${JSON.stringify(e)}`),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:i},n)}_remove({identifiers:e,data:r,modifiers:n,callback:i}){let o={};if(typeof r!="object"||qd.isArray(r)){this.config.debug&&console.error("Invalid value passed to #remove - data must be an object with scalar values");return}for(let[a,s]of Object.entries(r))if(typeof s=="string"||typeof s=="number")o[a]=s;else{this.config.debug&&(console.error("Invalid argument passed to #remove - values must be scalar"),console.error("Passed "+a+":",s));return}Object.keys(o).length!==0&&(r={$remove:o,$token:this.token,...e},typeof n=="function"&&(i=n),r=ps(r,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(r)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:r},i))}_union({identifiers:e,data:r,modifiers:n,callback:i}){let o={};if(typeof r!="object"||qd.isArray(r)){this.config.debug&&console.error("Invalid value passed to #union - data must be an object with scalar or array values");return}for(let[s,u]of Object.entries(r))if(qd.isArray(u)){var a=u.filter(function(l){return typeof l=="string"||typeof l=="number"});a.length>0&&(o[s]=a)}else typeof u=="string"||typeof u=="number"?o[s]=[u]:this.config.debug&&(console.error("Invalid argument passed to #union - values must be a scalar value or array"),console.error("Passed "+s+":",u));Object.keys(o).length!==0&&(r={$union:o,$token:this.token,...e},typeof n=="function"&&(i=n),r=ps(r,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(r)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:r},i))}_unset({identifiers:e,prop:r,modifiers:n,callback:i}){let o=[];if(qd.isArray(r))o=r;else if(typeof r=="string")o=[r];else{this.config.debug&&(console.error("Invalid argument passed to #unset - must be a string or array"),console.error("Passed: "+r));return}let a={$unset:o,$token:this.token,...e};typeof n=="function"&&(i=n),a=ps(a,n),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(a)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:a},i)}}});var YS=b(VS=>{var{ProfileHelpers:y3}=m_(),g_=class extends y3(){constructor(e){super(),this.mixpanel=e,this.endpoint="/groups"}set_once(e,r,n,i,o,a){let s={$group_key:e,$group_id:r};this._set(n,i,o,a,{identifiers:s,set_once:!0})}set(e,r,n,i,o,a){let s={$group_key:e,$group_id:r};this._set(n,i,o,a,{identifiers:s})}delete_group(e,r,n,i){let o={$group_key:e,$group_id:r};this._delete_profile({identifiers:o,modifiers:n,callback:i})}remove(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._remove({identifiers:a,data:n,modifiers:i,callback:o})}union(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._union({identifiers:a,data:n,modifiers:i,callback:o})}unset(e,r,n,i,o){let a={$group_key:e,$group_id:r};this._unset({identifiers:a,prop:n,modifiers:i,callback:o})}};VS.MixpanelGroups=g_});var ZS=b(XS=>{var{merge_modifiers:jd,ProfileHelpers:v3}=m_(),y_=class extends v3(){constructor(e){super(),this.mixpanel=e,this.endpoint="/engage"}set_once(e,r,n,i,o){let a={$distinct_id:e};this._set(r,n,i,o,{identifiers:a,set_once:!0})}set(e,r,n,i,o){let a={$distinct_id:e};this._set(r,n,i,o,{identifiers:a})}increment(e,r,n,i,o){var a={};if(typeof r=="object"){typeof n=="object"?(o=i,i=n):o=n;for(let[u,l]of Object.entries(r))isNaN(parseFloat(l))?this.mixpanel.config.debug&&(console.error("Invalid increment value passed to mixpanel.people.increment - must be a number"),console.error("Passed "+u+":"+l)):a[u]=l}else typeof n=="number"||!n?(n=n||1,a[r]=n,typeof i=="function"&&(o=i)):typeof n=="function"?(o=n,a[r]=1):(o=i,i=typeof n=="object"?n:{},a[r]=1);var s={$add:a,$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}append(e,r,n,i,o){var a={};typeof r=="object"?(typeof n=="object"?(o=i,i=n):o=n,Object.keys(r).forEach(function(u){a[u]=r[u]})):(a[r]=n,typeof i=="function"&&(o=i));var s={$append:a,$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}track_charge(e,r,n,i,o){if(typeof n=="function"||!n?(o=n||function(){},n={}):(typeof i=="function"||!i)&&(o=i||function(){},(n.$ignore_time||n.hasOwnProperty("$ip"))&&(i={},Object.keys(n).forEach(function(u){i[u]=n[u],delete n[u]}))),typeof r!="number"&&(r=parseFloat(r),isNaN(r))){console.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}if(n.$amount=r,n.hasOwnProperty("$time")){var a=n.$time;Object.prototype.toString.call(a)==="[object Date]"&&(n.$time=a.toISOString())}var s={$append:{$transactions:n},$token:this.mixpanel.token,$distinct_id:e};s=jd(s,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},o)}clear_charges(e,r,n){var i={$set:{$transactions:[]},$token:this.mixpanel.token,$distinct_id:e};typeof r=="function"&&(n=r),i=jd(i,r),this.mixpanel.config.debug&&console.log("Clearing this user's charges:",e),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:i},n)}delete_user(e,r,n){let i={$distinct_id:e};this._delete_profile({identifiers:i,modifiers:r,callback:n})}remove(e,r,n,i){let o={$distinct_id:e};this._remove({identifiers:o,data:r,modifiers:n,callback:i})}union(e,r,n,i){let o={$distinct_id:e};this._union({identifiers:o,data:r,modifiers:n,callback:i})}unset(e,r,n,i){let o={$distinct_id:e};this._unset({identifiers:o,prop:r,modifiers:n,callback:i})}};XS.MixpanelPeople=y_});var tk=b((Z8,ek)=>{var _3=require("querystring"),v_=require("buffer").Buffer,JS=require("http"),__=require("https"),T3=KS(),R3=require("url"),b3=zS(),{async_all:A3,ensure_timestamp:T_}=p_(),{MixpanelGroups:E3}=YS(),{MixpanelPeople:C3}=ZS(),x3={test:!1,debug:!1,verbose:!1,host:"api.mixpanel.com",protocol:"https",path:"",keepAlive:!0,geolocate:!1},QS=function(t,e){if(!t)throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`");let r={token:t,config:{...x3}},{keepAlive:n}=r.config,i=50,o={http:JS,https:__},a={http:new JS.Agent({keepAlive:n}),https:new __.Agent({keepAlive:n})},s=process.env.HTTPS_PROXY||process.env.HTTP_PROXY,u=s?new T3(Object.assign(R3.parse(s),{keepAlive:n})):null;r.send_request=function(f,p){p=p||function(){};let h=v_.from(JSON.stringify(f.data)).toString("base64"),d=f.endpoint,g=(f.method||"GET").toUpperCase(),C={ip:r.config.geolocate?1:0,verbose:r.config.verbose?1:0},x=r.config.key,T=r.config.secret,v=o[r.config.protocol],k={host:r.config.host,port:r.config.port,headers:{},method:g},j;if(!v)throw new Error("Mixpanel Initialization Error: Unsupported protocol "+r.config.protocol+". Supported protocols are: "+Object.keys(o));if(g==="POST"?(h="data="+h,k.headers["Content-Type"]="application/x-www-form-urlencoded",k.headers["Content-Length"]=v_.byteLength(h)):g==="GET"&&(C.data=h),T){if(v!==__)throw new Error("Must use HTTPS if authenticating with API Secret");let O=v_.from(T+":").toString("base64");k.headers.Authorization="Basic "+O}else if(x)C.api_key=x;else if(d==="/import")throw new Error("The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`");k.agent=u||a[r.config.protocol],r.config.test&&(C.test=1),k.path=r.config.path+d+"?"+_3.stringify(C),j=v.request(k,function(O){var $="";O.on("data",function(X){$+=X}),O.on("end",function(){var X;if(r.config.verbose)try{var J=JSON.parse($);J.status!=1&&(X=new Error("Mixpanel Server Error: "+J.error))}catch{X=new Error("Could not parse response from Mixpanel")}else X=$!=="1"?new Error("Mixpanel Server Error: "+$):void 0;p(X)})}),j.on("error",function(O){r.config.debug&&console.log("Got Error: "+O.message),p(O)}),g==="POST"&&j.write(h),j.end()},r.send_event_request=function(f,p,h,d){h.token=r.token,h.mp_lib="node",h.$lib_version=b3.version;var g={event:p,properties:h};r.config.debug&&console.log(`Sending the following event to Mixpanel:
6464
+ `,g),r.send_request({method:"GET",endpoint:f,data:g},d)};var l=function(f,p){for(var h=[],d=0,g=f.length;d<g;)h.push(f.slice(d,d+=p));return h},c=function(f,p){var h=f.event_list,d=f.endpoint,g=f.max_batch_size?Math.min(i,f.max_batch_size):i,C=f.max_concurrent_requests||f.max_batch_size>i&&Math.ceil(f.max_batch_size/i),x=l(h,g),T=C?l(x,C):[x],v=x.length,k=T.length;function j($,X){$.length>0&&($=$.map(function(J){var le=J.properties;return(d==="/import"||J.properties.time)&&(J.properties.time=T_(J.properties.time)),J.properties.token=J.properties.token||r.token,J}),r.send_request({method:"POST",endpoint:d,data:$},X))}function O($){var X=T[$],J=function(le,pe){$+=1,$===k?p&&p(le,pe):O($)};A3(X,j,J)}O(0),r.config.debug&&console.log("Sending "+h.length+" events to Mixpanel in "+v+" batches of events and "+k+" batches of requests")};return r.track=function(f,p,h){(!p||typeof p=="function")&&(h=p,p={}),p.time&&(p.time=T_(p.time)),r.send_event_request("/track",f,p,h)},r.track_batch=function(f,p,h){p=p||{},typeof p=="function"&&(h=p,p={});var d={event_list:f,endpoint:"/track",max_concurrent_requests:p.max_concurrent_requests,max_batch_size:p.max_batch_size};c(d,h)},r.import=function(f,p,h,d){(!h||typeof h=="function")&&(d=h,h={}),h.time=T_(p),r.send_event_request("/import",f,h,d)},r.import_batch=function(f,p,h){var d;(typeof p=="function"||!p)&&(h=p,p={}),d={event_list:f,endpoint:"/import",max_concurrent_requests:p.max_concurrent_requests,max_batch_size:p.max_batch_size},c(d,h)},r.alias=function(f,p,h){var d={distinct_id:f,alias:p};r.track("$create_alias",d,h)},r.groups=new E3(r),r.people=new C3(r),r.set_config=function(f){if(Object.assign(r.config,f),f.host){let[p,h]=f.host.split(":");r.config.host=p,h&&(r.config.port=Number(h))}},e&&r.set_config(e),r};ek.exports={Client:function(t){return console.warn("The function `Client(token)` is deprecated. It is now called `init(token)`."),QS(t)},init:QS}});var nk=b((Bu,R_)=>{(function(t,e){typeof Bu=="object"&&typeof R_=="object"?R_.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Bu=="object"?Bu["electron-machine-id"]=e(require("child_process"),require("crypto")):t["electron-machine-id"]=e(t.child_process,t.crypto)})(Bu,function(t,e){return function(r){function n(o){if(i[o])return i[o].exports;var a=i[o]={exports:{},id:o,loaded:!1};return r[o].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var i={};return n.m=r,n.c=i,n.p="",n(0)}([function(r,n,i){r.exports=i(34)},function(r,n,i){var o=i(29)("wks"),a=i(33),s=i(2).Symbol,u=typeof s=="function",l=r.exports=function(c){return o[c]||(o[c]=u&&s[c]||(u?s:a)("Symbol."+c))};l.store=o},function(r,n){var i=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(r,n,i){var o=i(9);r.exports=function(a){if(!o(a))throw TypeError(a+" is not an object!");return a}},function(r,n,i){r.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,n,i){var o=i(12),a=i(17);r.exports=i(4)?function(s,u,l){return o.f(s,u,a(1,l))}:function(s,u,l){return s[u]=l,s}},function(r,n){var i=r.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(r,n,i){var o=i(14);r.exports=function(a,s,u){if(o(a),s===void 0)return a;switch(u){case 1:return function(l){return a.call(s,l)};case 2:return function(l,c){return a.call(s,l,c)};case 3:return function(l,c,f){return a.call(s,l,c,f)}}return function(){return a.apply(s,arguments)}}},function(r,n){var i={}.hasOwnProperty;r.exports=function(o,a){return i.call(o,a)}},function(r,n){r.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(r,n){r.exports={}},function(r,n){var i={}.toString;r.exports=function(o){return i.call(o).slice(8,-1)}},function(r,n,i){var o=i(3),a=i(26),s=i(32),u=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,c,f){if(o(l),c=s(c,!0),o(f),a)try{return u(l,c,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[c]=f.value),l}},function(r,n,i){var o=i(42),a=i(15);r.exports=function(s){return o(a(s))}},function(r,n){r.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(r,n){r.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(r,n,i){var o=i(9),a=i(2).document,s=o(a)&&o(a.createElement);r.exports=function(u){return s?a.createElement(u):{}}},function(r,n){r.exports=function(i,o){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:o}}},function(r,n,i){var o=i(12).f,a=i(8),s=i(1)("toStringTag");r.exports=function(u,l,c){u&&!a(u=c?u:u.prototype,s)&&o(u,s,{configurable:!0,value:l})}},function(r,n,i){var o=i(29)("keys"),a=i(33);r.exports=function(s){return o[s]||(o[s]=a(s))}},function(r,n){var i=Math.ceil,o=Math.floor;r.exports=function(a){return isNaN(a=+a)?0:(a>0?o:i)(a)}},function(r,n,i){var o=i(11),a=i(1)("toStringTag"),s=o(function(){return arguments}())=="Arguments",u=function(l,c){try{return l[c]}catch{}};r.exports=function(l){var c,f,p;return l===void 0?"Undefined":l===null?"Null":typeof(f=u(c=Object(l),a))=="string"?f:s?o(c):(p=o(c))=="Object"&&typeof c.callee=="function"?"Arguments":p}},function(r,n){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,n,i){var o=i(2),a=i(6),s=i(7),u=i(5),l="prototype",c=function(f,p,h){var d,g,C,x=f&c.F,T=f&c.G,v=f&c.S,k=f&c.P,j=f&c.B,O=f&c.W,$=T?a:a[p]||(a[p]={}),X=$[l],J=T?o:v?o[p]:(o[p]||{})[l];T&&(h=p);for(d in h)g=!x&&J&&J[d]!==void 0,g&&d in $||(C=g?J[d]:h[d],$[d]=T&&typeof J[d]!="function"?h[d]:j&&g?s(C,o):O&&J[d]==C?function(le){var pe=function(G,I,U){if(this instanceof le){switch(arguments.length){case 0:return new le;case 1:return new le(G);case 2:return new le(G,I)}return new le(G,I,U)}return le.apply(this,arguments)};return pe[l]=le[l],pe}(C):k&&typeof C=="function"?s(Function.call,C):C,k&&(($.virtual||($.virtual={}))[d]=C,f&c.R&&X&&!X[d]&&u(X,d,C)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,r.exports=c},function(r,n){r.exports=function(i){try{return!!i()}catch{return!0}}},function(r,n,i){r.exports=i(2).document&&document.documentElement},function(r,n,i){r.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(r,n,i){"use strict";var o=i(28),a=i(23),s=i(57),u=i(5),l=i(8),c=i(10),f=i(45),p=i(18),h=i(52),d=i(1)("iterator"),g=!([].keys&&"next"in[].keys()),C="@@iterator",x="keys",T="values",v=function(){return this};r.exports=function(k,j,O,$,X,J,le){f(O,j,$);var pe,G,I,U=function(K){if(!g&&K in re)return re[K];switch(K){case x:return function(){return new O(this,K)};case T:return function(){return new O(this,K)}}return function(){return new O(this,K)}},z=j+" Iterator",de=X==T,ie=!1,re=k.prototype,he=re[d]||re[C]||X&&re[X],me=he||U(X),ze=X?de?U("entries"):me:void 0,H=j=="Array"&&re.entries||he;if(H&&(I=h(H.call(new k)),I!==Object.prototype&&(p(I,z,!0),o||l(I,d)||u(I,d,v))),de&&he&&he.name!==T&&(ie=!0,me=function(){return he.call(this)}),o&&!le||!g&&!ie&&re[d]||u(re,d,me),c[j]=me,c[z]=v,X)if(pe={values:de?me:U(T),keys:J?me:U(x),entries:ze},le)for(G in pe)G in re||s(re,G,pe[G]);else a(a.P+a.F*(g||ie),j,pe);return pe}},function(r,n){r.exports=!0},function(r,n,i){var o=i(2),a="__core-js_shared__",s=o[a]||(o[a]={});r.exports=function(u){return s[u]||(s[u]={})}},function(r,n,i){var o,a,s,u=i(7),l=i(41),c=i(25),f=i(16),p=i(2),h=p.process,d=p.setImmediate,g=p.clearImmediate,C=p.MessageChannel,x=0,T={},v="onreadystatechange",k=function(){var O=+this;if(T.hasOwnProperty(O)){var $=T[O];delete T[O],$()}},j=function(O){k.call(O.data)};d&&g||(d=function(O){for(var $=[],X=1;arguments.length>X;)$.push(arguments[X++]);return T[++x]=function(){l(typeof O=="function"?O:Function(O),$)},o(x),x},g=function(O){delete T[O]},i(11)(h)=="process"?o=function(O){h.nextTick(u(k,O,1))}:C?(a=new C,s=a.port2,a.port1.onmessage=j,o=u(s.postMessage,s,1)):p.addEventListener&&typeof postMessage=="function"&&!p.importScripts?(o=function(O){p.postMessage(O+"","*")},p.addEventListener("message",j,!1)):o=v in f("script")?function(O){c.appendChild(f("script"))[v]=function(){c.removeChild(this),k.call(O)}}:function(O){setTimeout(u(k,O,1),0)}),r.exports={set:d,clear:g}},function(r,n,i){var o=i(20),a=Math.min;r.exports=function(s){return s>0?a(o(s),9007199254740991):0}},function(r,n,i){var o=i(9);r.exports=function(a,s){if(!o(a))return a;var u,l;if(s&&typeof(u=a.toString)=="function"&&!o(l=u.call(a))||typeof(u=a.valueOf)=="function"&&!o(l=u.call(a))||!s&&typeof(u=a.toString)=="function"&&!o(l=u.call(a)))return l;throw TypeError("Can't convert object to primitive value")}},function(r,n){var i=0,o=Math.random();r.exports=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++i+o).toString(36))}},function(r,n,i){"use strict";function o(v){return v&&v.__esModule?v:{default:v}}function a(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function s(v){return(0,d.createHash)("sha256").update(v).digest("hex")}function u(v){switch(C){case"darwin":return v.split("IOPlatformUUID")[1].split(`
6465
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return v.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return v.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return v.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(v){var k=u((0,h.execSync)(T[C]).toString());return v?k:s(k)}function c(v){return new p.default(function(k,j){return(0,h.exec)(T[C],{},function(O,$,X){if(O)return j(new Error("Error while obtaining machine id: "+O.stack));var J=u($.toString());return k(v?J:s(J))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),p=o(f);n.machineIdSync=l,n.machineId=c;var h=i(70),d=i(71),g=process,C=g.platform,x={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},T={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:x[a()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(r,n,i){r.exports={default:i(36),__esModule:!0}},function(r,n,i){i(66),i(68),i(69),i(67),r.exports=i(6).Promise},function(r,n){r.exports=function(){}},function(r,n){r.exports=function(i,o,a,s){if(!(i instanceof o)||s!==void 0&&s in i)throw TypeError(a+": incorrect invocation!");return i}},function(r,n,i){var o=i(13),a=i(31),s=i(62);r.exports=function(u){return function(l,c,f){var p,h=o(l),d=a(h.length),g=s(f,d);if(u&&c!=c){for(;d>g;)if(p=h[g++],p!=p)return!0}else for(;d>g;g++)if((u||g in h)&&h[g]===c)return u||g||0;return!u&&-1}}},function(r,h,i){var o=i(7),a=i(44),s=i(43),u=i(3),l=i(31),c=i(64),f={},p={},h=r.exports=function(d,g,C,x,T){var v,k,j,O,$=T?function(){return d}:c(d),X=o(C,x,g?2:1),J=0;if(typeof $!="function")throw TypeError(d+" is not iterable!");if(s($)){for(v=l(d.length);v>J;J++)if(O=g?X(u(k=d[J])[0],k[1]):X(d[J]),O===f||O===p)return O}else for(j=$.call(d);!(k=j.next()).done;)if(O=a(j,X,k.value,g),O===f||O===p)return O};h.BREAK=f,h.RETURN=p},function(r,n){r.exports=function(i,o,a){var s=a===void 0;switch(o.length){case 0:return s?i():i.call(a);case 1:return s?i(o[0]):i.call(a,o[0]);case 2:return s?i(o[0],o[1]):i.call(a,o[0],o[1]);case 3:return s?i(o[0],o[1],o[2]):i.call(a,o[0],o[1],o[2]);case 4:return s?i(o[0],o[1],o[2],o[3]):i.call(a,o[0],o[1],o[2],o[3])}return i.apply(a,o)}},function(r,n,i){var o=i(11);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return o(a)=="String"?a.split(""):Object(a)}},function(r,n,i){var o=i(10),a=i(1)("iterator"),s=Array.prototype;r.exports=function(u){return u!==void 0&&(o.Array===u||s[a]===u)}},function(r,n,i){var o=i(3);r.exports=function(a,s,u,l){try{return l?s(o(u)[0],u[1]):s(u)}catch(f){var c=a.return;throw c!==void 0&&o(c.call(a)),f}}},function(r,n,i){"use strict";var o=i(49),a=i(17),s=i(18),u={};i(5)(u,i(1)("iterator"),function(){return this}),r.exports=function(l,c,f){l.prototype=o(u,{next:a(1,f)}),s(l,c+" Iterator")}},function(r,n,i){var o=i(1)("iterator"),a=!1;try{var s=[7][o]();s.return=function(){a=!0},Array.from(s,function(){throw 2})}catch{}r.exports=function(u,l){if(!l&&!a)return!1;var c=!1;try{var f=[7],p=f[o]();p.next=function(){return{done:c=!0}},f[o]=function(){return p},u(f)}catch{}return c}},function(r,n){r.exports=function(i,o){return{value:o,done:!!i}}},function(r,n,i){var o=i(2),a=i(30).set,s=o.MutationObserver||o.WebKitMutationObserver,u=o.process,l=o.Promise,c=i(11)(u)=="process";r.exports=function(){var f,p,h,d=function(){var T,v;for(c&&(T=u.domain)&&T.exit();f;){v=f.fn,f=f.next;try{v()}catch(k){throw f?h():p=void 0,k}}p=void 0,T&&T.enter()};if(c)h=function(){u.nextTick(d)};else if(s){var g=!0,C=document.createTextNode("");new s(d).observe(C,{characterData:!0}),h=function(){C.data=g=!g}}else if(l&&l.resolve){var x=l.resolve();h=function(){x.then(d)}}else h=function(){a.call(o,d)};return function(T){var v={fn:T,next:void 0};p&&(p.next=v),f||(f=v,h()),p=v}}},function(r,n,i){var o=i(3),a=i(50),s=i(22),u=i(19)("IE_PROTO"),l=function(){},c="prototype",f=function(){var p,h=i(16)("iframe"),d=s.length,g=">";for(h.style.display="none",i(25).appendChild(h),h.src="javascript:",p=h.contentWindow.document,p.open(),p.write("<script>document.F=Object<\/script"+g),p.close(),f=p.F;d--;)delete f[c][s[d]];return f()};r.exports=Object.create||function(p,h){var d;return p!==null?(l[c]=o(p),d=new l,l[c]=null,d[u]=p):d=f(),h===void 0?d:a(d,h)}},function(r,n,i){var o=i(12),a=i(3),s=i(54);r.exports=i(4)?Object.defineProperties:function(u,l){a(u);for(var c,f=s(l),p=f.length,h=0;p>h;)o.f(u,c=f[h++],l[c]);return u}},function(r,n,i){var o=i(55),a=i(17),s=i(13),u=i(32),l=i(8),c=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(p,h){if(p=s(p),h=u(h,!0),c)try{return f(p,h)}catch{}if(l(p,h))return a(!o.f.call(p,h),p[h])}},function(r,n,i){var o=i(8),a=i(63),s=i(19)("IE_PROTO"),u=Object.prototype;r.exports=Object.getPrototypeOf||function(l){return l=a(l),o(l,s)?l[s]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?u:null}},function(r,n,i){var o=i(8),a=i(13),s=i(39)(!1),u=i(19)("IE_PROTO");r.exports=function(l,c){var f,p=a(l),h=0,d=[];for(f in p)f!=u&&o(p,f)&&d.push(f);for(;c.length>h;)o(p,f=c[h++])&&(~s(d,f)||d.push(f));return d}},function(r,n,i){var o=i(53),a=i(22);r.exports=Object.keys||function(s){return o(s,a)}},function(r,n){n.f={}.propertyIsEnumerable},function(r,n,i){var o=i(5);r.exports=function(a,s,u){for(var l in s)u&&a[l]?a[l]=s[l]:o(a,l,s[l]);return a}},function(r,n,i){r.exports=i(5)},function(r,n,i){var o=i(9),a=i(3),s=function(u,l){if(a(u),!o(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};r.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(u,l,c){try{c=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),c(u,[]),l=!(u instanceof Array)}catch{l=!0}return function(f,p){return s(f,p),l?f.__proto__=p:c(f,p),f}}({},!1):void 0),check:s}},function(r,n,i){"use strict";var o=i(2),a=i(6),s=i(12),u=i(4),l=i(1)("species");r.exports=function(c){var f=typeof a[c]=="function"?a[c]:o[c];u&&f&&!f[l]&&s.f(f,l,{configurable:!0,get:function(){return this}})}},function(r,n,i){var o=i(3),a=i(14),s=i(1)("species");r.exports=function(u,l){var c,f=o(u).constructor;return f===void 0||(c=o(f)[s])==null?l:a(c)}},function(r,n,i){var o=i(20),a=i(15);r.exports=function(s){return function(u,l){var c,f,p=String(a(u)),h=o(l),d=p.length;return h<0||h>=d?s?"":void 0:(c=p.charCodeAt(h),c<55296||c>56319||h+1===d||(f=p.charCodeAt(h+1))<56320||f>57343?s?p.charAt(h):c:s?p.slice(h,h+2):(c-55296<<10)+(f-56320)+65536)}}},function(r,n,i){var o=i(20),a=Math.max,s=Math.min;r.exports=function(u,l){return u=o(u),u<0?a(u+l,0):s(u,l)}},function(r,n,i){var o=i(15);r.exports=function(a){return Object(o(a))}},function(r,n,i){var o=i(21),a=i(1)("iterator"),s=i(10);r.exports=i(6).getIteratorMethod=function(u){if(u!=null)return u[a]||u["@@iterator"]||s[o(u)]}},function(r,n,i){"use strict";var o=i(37),a=i(47),s=i(10),u=i(13);r.exports=i(27)(Array,"Array",function(l,c){this._t=u(l),this._i=0,this._k=c},function(){var l=this._t,c=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,a(1)):c=="keys"?a(0,f):c=="values"?a(0,l[f]):a(0,[f,l[f]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(r,n){},function(r,n,i){"use strict";var o,a,s,u=i(28),l=i(2),c=i(7),f=i(21),p=i(23),h=i(9),d=(i(3),i(14)),g=i(38),C=i(40),x=(i(58).set,i(60)),T=i(30).set,v=i(48)(),k="Promise",j=l.TypeError,$=l.process,O=l[k],$=l.process,X=f($)=="process",J=function(){},le=!!function(){try{var H=O.resolve(1),K=(H.constructor={})[i(1)("species")]=function(ne){ne(J,J)};return(X||typeof PromiseRejectionEvent=="function")&&H.then(J)instanceof K}catch{}}(),pe=function(H,K){return H===K||H===O&&K===s},G=function(H){var K;return!(!h(H)||typeof(K=H.then)!="function")&&K},I=function(H){return pe(O,H)?new U(H):new a(H)},U=a=function(H){var K,ne;this.promise=new H(function(Me,Ne){if(K!==void 0||ne!==void 0)throw j("Bad Promise constructor");K=Me,ne=Ne}),this.resolve=d(K),this.reject=d(ne)},z=function(H){try{H()}catch(K){return{error:K}}},de=function(H,K){if(!H._n){H._n=!0;var ne=H._c;v(function(){for(var Me=H._v,Ne=H._s==1,Nr=0,Ur=function(Or){var _t,Tt,vn=Ne?Or.ok:Or.fail,Hr=Or.resolve,Qt=Or.reject,Br=Or.domain;try{vn?(Ne||(H._h==2&&he(H),H._h=1),vn===!0?_t=Me:(Br&&Br.enter(),_t=vn(Me),Br&&Br.exit()),_t===Or.promise?Qt(j("Promise-chain cycle")):(Tt=G(_t))?Tt.call(_t,Hr,Qt):Hr(_t)):Qt(Me)}catch(_n){Qt(_n)}};ne.length>Nr;)Ur(ne[Nr++]);H._c=[],H._n=!1,K&&!H._h&&ie(H)})}},ie=function(H){T.call(l,function(){var K,ne,Me,Ne=H._v;if(re(H)&&(K=z(function(){X?$.emit("unhandledRejection",Ne,H):(ne=l.onunhandledrejection)?ne({promise:H,reason:Ne}):(Me=l.console)&&Me.error&&Me.error("Unhandled promise rejection",Ne)}),H._h=X||re(H)?2:1),H._a=void 0,K)throw K.error})},re=function(H){if(H._h==1)return!1;for(var K,ne=H._a||H._c,Me=0;ne.length>Me;)if(K=ne[Me++],K.fail||!re(K.promise))return!1;return!0},he=function(H){T.call(l,function(){var K;X?$.emit("rejectionHandled",H):(K=l.onrejectionhandled)&&K({promise:H,reason:H._v})})},me=function(H){var K=this;K._d||(K._d=!0,K=K._w||K,K._v=H,K._s=2,K._a||(K._a=K._c.slice()),de(K,!0))},ze=function(H){var K,ne=this;if(!ne._d){ne._d=!0,ne=ne._w||ne;try{if(ne===H)throw j("Promise can't be resolved itself");(K=G(H))?v(function(){var Me={_w:ne,_d:!1};try{K.call(H,c(ze,Me,1),c(me,Me,1))}catch(Ne){me.call(Me,Ne)}}):(ne._v=H,ne._s=1,de(ne,!1))}catch(Me){me.call({_w:ne,_d:!1},Me)}}};le||(O=function(H){g(this,O,k,"_h"),d(H),o.call(this);try{H(c(ze,this,1),c(me,this,1))}catch(K){me.call(this,K)}},o=function(H){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},o.prototype=i(56)(O.prototype,{then:function(H,K){var ne=I(x(this,O));return ne.ok=typeof H!="function"||H,ne.fail=typeof K=="function"&&K,ne.domain=X?$.domain:void 0,this._c.push(ne),this._a&&this._a.push(ne),this._s&&de(this,!1),ne.promise},catch:function(H){return this.then(void 0,H)}}),U=function(){var H=new o;this.promise=H,this.resolve=c(ze,H,1),this.reject=c(me,H,1)}),p(p.G+p.W+p.F*!le,{Promise:O}),i(18)(O,k),i(59)(k),s=i(6)[k],p(p.S+p.F*!le,k,{reject:function(H){var K=I(this),ne=K.reject;return ne(H),K.promise}}),p(p.S+p.F*(u||!le),k,{resolve:function(H){if(H instanceof O&&pe(H.constructor,this))return H;var K=I(this),ne=K.resolve;return ne(H),K.promise}}),p(p.S+p.F*!(le&&i(46)(function(H){O.all(H).catch(J)})),k,{all:function(H){var K=this,ne=I(K),Me=ne.resolve,Ne=ne.reject,Nr=z(function(){var Ur=[],Or=0,_t=1;C(H,!1,function(Tt){var vn=Or++,Hr=!1;Ur.push(void 0),_t++,K.resolve(Tt).then(function(Qt){Hr||(Hr=!0,Ur[vn]=Qt,--_t||Me(Ur))},Ne)}),--_t||Me(Ur)});return Nr&&Ne(Nr.error),ne.promise},race:function(H){var K=this,ne=I(K),Me=ne.reject,Ne=z(function(){C(H,!1,function(Nr){K.resolve(Nr).then(ne.resolve,Me)})});return Ne&&Me(Ne.error),ne.promise}})},function(r,n,i){"use strict";var o=i(61)(!0);i(27)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,s=this._t,u=this._i;return u>=s.length?{value:void 0,done:!0}:(a=o(s,u),this._i+=a.length,{value:a,done:!1})})},function(r,n,i){i(65);for(var o=i(2),a=i(5),s=i(10),u=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var f=l[c],p=o[f],h=p&&p.prototype;h&&!h[u]&&a(h,u,f),s[f]=s.Array}},function(r,n){r.exports=require("child_process")},function(r,n){r.exports=require("crypto")}])})});var b_=b((Q8,ik)=>{ik.exports=function(e,r){var n="000000000"+e;return n.substr(n.length-r)}});var lk=b((e5,uk)=>{var ok=b_(),S3=require("os"),ak=2,k3=ok(process.pid.toString(36),ak),sk=S3.hostname(),P3=sk.length,D3=ok(sk.split("").reduce(function(t,e){return+t+e.charCodeAt(0)},+P3+36).toString(36),ak);uk.exports=function(){return k3+D3}});var fk=b((t5,ck)=>{var N3=require("crypto"),O3=Math.pow(2,32)-1;ck.exports=function(){return Math.abs(N3.randomBytes(4).readInt32BE()/O3)}});var gk=b((r5,mk)=>{var Gd=lk(),dk=b_(),I3=fk(),Wu=0,E_=4,Ud=36,pk=Math.pow(Ud,E_);function A_(){return dk((I3()*pk<<0).toString(Ud),E_)}function hk(){return Wu=Wu<pk?Wu:0,Wu++,Wu-1}function Ku(){var t="c",e=new Date().getTime().toString(Ud),r=dk(hk().toString(Ud),E_),n=Gd(),i=A_()+A_();return t+e+r+n+i}Ku.slug=function(){var e=new Date().getTime().toString(36),r=hk().toString(36).slice(-4),n=Gd().slice(0,1)+Gd().slice(-1),i=A_().slice(-2);return e.slice(-2)+r+n+i};Ku.isCuid=function(e){return typeof e!="string"?!1:!!e.startsWith("c")};Ku.isSlug=function(e){if(typeof e!="string")return!1;var r=e.length;return r>=7&&r<=10};Ku.fingerprint=Gd;mk.exports=Ku});var vk=b((n5,yk)=>{"use strict";var $3=setTimeout;function M3(t,e){var r=e.useCachedSetTimeout?$3:setTimeout;return new Promise(function(n){r(n,t)})}yk.exports=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.useCachedSetTimeout,n=M3(t,{useCachedSetTimeout:r});function i(o){return n.then(function(){return o})}return i.then=function(){return n.then.apply(n,arguments)},i.catch=Promise.resolve().catch,i}});var bk=b((i5,Rk)=>{"use strict";var x_=[],Vu=[],_k=!1,C_=0,Tk=1e4,hs={},zu={};function w_(t,e,r){let n=!1;function i(){n||(n=!0,t===!0&&process.nextTick(process.exit.bind(null,e)))}function o(){process.nextTick(()=>{--C_===0&&i()})}function a(s,u,l){return t&&l.length>s?(C_++,u?l(u,o):l(o)):u?l(u):l()}_k||(_k=!0,r&&Vu.map(a.bind(null,1,r)),x_.map(a.bind(null,0,null)),C_?setTimeout(()=>{i()},Tk):i())}function Gr(t){x_.push(t),x_.length===1&&(Gr.hookEvent("exit"),Gr.hookEvent("beforeExit",0),Gr.hookEvent("SIGHUP",128+1),Gr.hookEvent("SIGINT",128+2),Gr.hookEvent("SIGTERM",128+15),Gr.hookEvent("SIGBREAK",128+21),Gr.hookEvent("message",0,function(e){if(e!=="shutdown")return!0}))}Gr.hookEvent=function(t,e,r){hs[t]=function(){let n=zu[t];for(let i=0;i<n.length;i++)if(n[i].apply(this,arguments))return;w_(e!=null,e)},zu[t]||(zu[t]=[]),r&&zu[t].push(r),process.on(t,hs[t])};Gr.unhookEvent=function(t){process.removeListener(t,hs[t]),delete hs[t],delete zu[t]};Gr.hookedEvents=function(){let t=[];for(let e in hs)({}).hasOwnProperty.call(hs,e)&&t.push(e);return t};Gr.uncaughtExceptionHandler=function(t){Vu.push(t),Vu.length===1&&process.once("uncaughtException",w_.bind(null,!0,1))};Gr.unhandledRejectionHandler=function(t){Vu.push(t),Vu.length===1&&process.once("unhandledRejection",w_.bind(null,!0,1))};Gr.forceExitTimeout=function(t){Tk=t};Rk.exports=Gr});var Hd=b((a5,L3)=>{L3.exports={name:"zenstack",publisher:"zenstack",displayName:"ZenStack Language Tools",description:"A toolkit for building secure CRUD apps with Next.js + Typescript",version:"0.6.0-pre.7",author:{name:"ZenStack Team"},homepage:"https://zenstack.dev",license:"MIT",keywords:["fullstack","react","typescript","data modeling"],preview:!0,icon:"asset/logo-256-bg.png",repository:{type:"git",url:"https://github.com/zenstackhq/zenstack"},publishConfig:{directory:"bundle",linkDirectory:!0},engines:{vscode:"^1.56.0"},categories:["Programming Languages"],contributes:{languages:[{id:"zmodel",aliases:["ZenStack Model","zmodel"],extensions:[".zmodel"],configuration:"./language-configuration.json",icon:{light:"./asset/logo-light-256.png",dark:"./asset/logo-dark-256.png"}}],grammars:[{language:"zmodel",scopeName:"source.zmodel",path:"./syntaxes/zmodel.tmLanguage.json"}]},activationEvents:["onLanguage:zmodel"],bin:{zenstack:"bin/cli"},main:"./extension.js",scripts:{"vscode:publish":"vsce publish --no-dependencies","vscode:prepublish":"cp ../../README.md ./ && pnpm lint && pnpm build","vscode:package":"vsce package --no-dependencies",clean:"rimraf bundle",build:"pnpm lint && pnpm bundle && tsc --emitDeclarationOnly --declaration ",bundle:"pnpm clean && node build/bundle.js --minify",watch:"node build/bundle.js --watch","ts:watch":"tsc --watch --noEmit","tsc-alias:watch":"tsc-alias --watch",lint:"eslint src --ext ts",test:"jest",prepublishOnly:"cp ../../README.md ./ && pnpm build","publish-dev":"pnpm publish --tag dev",postinstall:"node bin/post-install.js"},dependencies:{"@prisma/generator-helper":"^4.7.1","@prisma/internals":"^4.7.1","@zenstackhq/language":"workspace:*","@zenstackhq/runtime":"workspace:*","@zenstackhq/sdk":"workspace:*","async-exit-hook":"^2.0.1","change-case":"^4.1.2",chevrotain:"^9.1.0",colors:"1.4.0",commander:"^8.3.0",cuid:"^2.1.8",langium:"^0.5.0",mixpanel:"^0.17.0","node-machine-id":"^1.1.12",ora:"^6.1.2",pluralize:"^8.0.0",prisma:"~4.7.0",promisify:"^0.0.3","sleep-promise":"^9.1.0","ts-morph":"^16.0.0",uuid:"^9.0.0","vscode-jsonrpc":"^8.0.2","vscode-languageclient":"^8.0.2","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.7","vscode-uri":"^3.0.6",zod:"^3.19.1"},devDependencies:{"@types/async-exit-hook":"^2.0.0","@types/jest":"^29.2.0","@types/node":"^14.18.32","@types/pluralize":"^0.0.29","@types/tmp":"^0.2.3","@types/uuid":"^8.3.4","@types/vscode":"^1.56.0","@typescript-eslint/eslint-plugin":"^5.42.0","@typescript-eslint/parser":"^5.42.0",concurrently:"^7.4.0",dotenv:"^16.0.3",esbuild:"^0.15.12",eslint:"^8.27.0",jest:"^29.2.1","langium-cli":"^0.5.0",rimraf:"^3.0.2",tmp:"^0.2.1","ts-jest":"^29.0.3","ts-node":"^10.9.1","tsc-alias":"^1.7.0","tsconfig-paths-jest":"^0.0.1",typescript:"^4.8.4",vsce:"^2.13.0"}}});var Sk=b(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.TRANSACTION_FIELD_NAME=yo.GUARD_FIELD_NAME=yo.PluginError=void 0;var D_=class extends Error{constructor(e){super(e)}};yo.PluginError=D_;yo.GUARD_FIELD_NAME="zenstack_guard";yo.TRANSACTION_FIELD_NAME="zenstack_transaction"});var kk=b(vo=>{"use strict";var F3=vo&&vo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0});vo.NodeFileSystem=vo.NodeFileSystemProvider=void 0;var N_=F3(require("fs")),q3=$n(),Bd=class{constructor(){this.encoding="utf-8"}readFile(e){return N_.default.promises.readFile(e.fsPath,this.encoding)}readFileSync(e){return N_.default.readFileSync(e.fsPath,this.encoding)}async readDirectory(e){return(await N_.default.promises.readdir(e.fsPath,{withFileTypes:!0})).map(n=>({dirent:n,isFile:n.isFile(),isDirectory:n.isDirectory(),uri:q3.Utils.joinPath(e,n.name)}))}};vo.NodeFileSystemProvider=Bd;vo.NodeFileSystem={fileSystemProvider:()=>new Bd}});var Pk=b(Qo=>{"use strict";var j3=Qo&&Qo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G3=Qo&&Qo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j3(e,t,r)};Object.defineProperty(Qo,"__esModule",{value:!0});G3(kk(),Qo)});var Nk=b((m5,Dk)=>{Dk.exports=Pk()});var Wn=b(ea=>{"use strict";var U3=ea&&ea.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),H3=ea&&ea.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U3(e,t,r)};Object.defineProperty(ea,"__esModule",{value:!0});H3(e_(),ea)});var Lk=b(($_,M_)=>{(function(t,e){typeof require=="function"&&typeof $_=="object"&&typeof M_=="object"?M_.exports=e():typeof define=="function"&&define.amd?define(function(){return e()}):t.pluralize=e()})($_,function(){var t=[],e=[],r={},n={},i={};function o(h){return typeof h=="string"?new RegExp("^"+h+"$","i"):h}function a(h,d){return h===d?d:h===h.toLowerCase()?d.toLowerCase():h===h.toUpperCase()?d.toUpperCase():h[0]===h[0].toUpperCase()?d.charAt(0).toUpperCase()+d.substr(1).toLowerCase():d.toLowerCase()}function s(h,d){return h.replace(/\$(\d{1,2})/g,function(g,C){return d[C]||""})}function u(h,d){return h.replace(d[0],function(g,C){var x=s(d[1],arguments);return a(g===""?h[C-1]:g,x)})}function l(h,d,g){if(!h.length||r.hasOwnProperty(h))return d;for(var C=g.length;C--;){var x=g[C];if(x[0].test(d))return u(d,x)}return d}function c(h,d,g){return function(C){var x=C.toLowerCase();return d.hasOwnProperty(x)?a(C,x):h.hasOwnProperty(x)?a(C,h[x]):l(x,C,g)}}function f(h,d,g,C){return function(x){var T=x.toLowerCase();return d.hasOwnProperty(T)?!0:h.hasOwnProperty(T)?!1:l(T,T,g)===T}}function p(h,d,g){var C=d===1?p.singular(h):p.plural(h);return(g?d+" ":"")+C}return p.plural=c(i,n,t),p.isPlural=f(i,n,t),p.singular=c(n,i,e),p.isSingular=f(n,i,e),p.addPluralRule=function(h,d){t.push([o(h),d])},p.addSingularRule=function(h,d){e.push([o(h),d])},p.addUncountableRule=function(h){if(typeof h=="string"){r[h.toLowerCase()]=!0;return}p.addPluralRule(h,"$0"),p.addSingularRule(h,"$0")},p.addIrregularRule=function(h,d){d=d.toLowerCase(),h=h.toLowerCase(),i[h]=d,n[d]=h},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(h){return p.addIrregularRule(h[0],h[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(h){return p.addPluralRule(h[0],h[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(h){return p.addSingularRule(h[0],h[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p})});var Qk=b(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.getLiteralArray=_i.getArray=_i.getLiteral=_i.resolved=void 0;var Xk=Wn();function Y3(t){if(!t.ref)throw new Error(`Reference not resolved: ${t.$refText}`);return t.ref}_i.resolved=Y3;function Zk(t){if(!!(0,Xk.isLiteralExpr)(t))return t.value}_i.getLiteral=Zk;function Jk(t){return(0,Xk.isArrayExpr)(t)?t.items:void 0}_i.getArray=Jk;function X3(t){let e=Jk(t);if(!!e)return e.map(r=>Zk(r))}_i.getLiteralArray=X3});var hP=b((lY,K_)=>{"use strict";var pP=(t,e)=>{for(let r of Reflect.ownKeys(e))Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t};K_.exports=pP;K_.exports.default=pP});var gP=b((cY,ip)=>{"use strict";var lK=hP(),np=new WeakMap,mP=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,i=t.displayName||t.name||"<anonymous>",o=function(...a){if(np.set(o,++n),n===1)r=t.apply(this,a),t=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return lK(o,t),np.set(o,n),o};ip.exports=mP;ip.exports.default=mP;ip.exports.callCount=t=>{if(!np.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return np.get(t)}});var yP=b((fY,op)=>{op.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&op.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&op.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var bP=b((dY,bs)=>{var vt=global.process,ra=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};ra(vt)?(vP=require("assert"),Ts=yP(),_P=/^win/i.test(vt.platform),nl=require("events"),typeof nl!="function"&&(nl=nl.EventEmitter),vt.__signal_exit_emitter__?Jt=vt.__signal_exit_emitter__:(Jt=vt.__signal_exit_emitter__=new nl,Jt.count=0,Jt.emitted={}),Jt.infinite||(Jt.setMaxListeners(1/0),Jt.infinite=!0),bs.exports=function(t,e){if(!ra(global.process))return function(){};vP.equal(typeof t,"function","a callback must be provided for exit handler"),Rs===!1&&z_();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){Jt.removeListener(r,t),Jt.listeners("exit").length===0&&Jt.listeners("afterexit").length===0&&ap()};return Jt.on(r,t),n},ap=function(){!Rs||!ra(global.process)||(Rs=!1,Ts.forEach(function(e){try{vt.removeListener(e,sp[e])}catch{}}),vt.emit=up,vt.reallyExit=V_,Jt.count-=1)},bs.exports.unload=ap,na=function(e,r,n){Jt.emitted[e]||(Jt.emitted[e]=!0,Jt.emit(e,r,n))},sp={},Ts.forEach(function(t){sp[t]=function(){if(!!ra(global.process)){var r=vt.listeners(t);r.length===Jt.count&&(ap(),na("exit",null,t),na("afterexit",null,t),_P&&t==="SIGHUP"&&(t="SIGINT"),vt.kill(vt.pid,t))}}}),bs.exports.signals=function(){return Ts},Rs=!1,z_=function(){Rs||!ra(global.process)||(Rs=!0,Jt.count+=1,Ts=Ts.filter(function(e){try{return vt.on(e,sp[e]),!0}catch{return!1}}),vt.emit=RP,vt.reallyExit=TP)},bs.exports.load=z_,V_=vt.reallyExit,TP=function(e){!ra(global.process)||(vt.exitCode=e||0,na("exit",vt.exitCode,null),na("afterexit",vt.exitCode,null),V_.call(vt,vt.exitCode))},up=vt.emit,RP=function(e,r){if(e==="exit"&&ra(global.process)){r!==void 0&&(vt.exitCode=r);var n=up.apply(this,arguments);return na("exit",vt.exitCode,null),na("afterexit",vt.exitCode,null),n}else return up.apply(this,arguments)}):bs.exports=function(){return function(){}};var vP,Ts,_P,nl,Jt,ap,na,sp,Rs,z_,V_,TP,up,RP});var wP=b((gY,fK)=>{fK.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]}}});var PP=b((yY,kP)=>{"use strict";var cp=Object.assign({},wP()),SP=Object.keys(cp);Object.defineProperty(cp,"random",{get(){let t=Math.floor(Math.random()*SP.length),e=SP[t];return cp[e]}});kP.exports=cp});var DP=b((CY,fp)=>{var mK=function(){"use strict";function t(a,s,u,l){var c;typeof s=="object"&&(u=s.depth,l=s.prototype,c=s.filter,s=s.circular);var f=[],p=[],h=typeof Buffer<"u";typeof s>"u"&&(s=!0),typeof u>"u"&&(u=1/0);function d(g,C){if(g===null)return null;if(C==0)return g;var x,T;if(typeof g!="object")return g;if(t.__isArray(g))x=[];else if(t.__isRegExp(g))x=new RegExp(g.source,o(g)),g.lastIndex&&(x.lastIndex=g.lastIndex);else if(t.__isDate(g))x=new Date(g.getTime());else{if(h&&Buffer.isBuffer(g))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(g.length):x=new Buffer(g.length),g.copy(x),x;typeof l>"u"?(T=Object.getPrototypeOf(g),x=Object.create(T)):(x=Object.create(l),T=l)}if(s){var v=f.indexOf(g);if(v!=-1)return p[v];f.push(g),p.push(x)}for(var k in g){var j;T&&(j=Object.getOwnPropertyDescriptor(T,k)),!(j&&j.set==null)&&(x[k]=d(g[k],C-1))}return x}return d(a,u)}t.clonePrototype=function(s){if(s===null)return null;var u=function(){};return u.prototype=s,new u};function e(a){return Object.prototype.toString.call(a)}t.__objToStr=e;function r(a){return typeof a=="object"&&e(a)==="[object Date]"}t.__isDate=r;function n(a){return typeof a=="object"&&e(a)==="[object Array]"}t.__isArray=n;function i(a){return typeof a=="object"&&e(a)==="[object RegExp]"}t.__isRegExp=i;function o(a){var s="";return a.global&&(s+="g"),a.ignoreCase&&(s+="i"),a.multiline&&(s+="m"),s}return t.__getRegExpFlags=o,t}();typeof fp=="object"&&fp.exports&&(fp.exports=mK)});var OP=b((xY,NP)=>{var gK=DP();NP.exports=function(t,e){return t=t||{},Object.keys(e).forEach(function(r){typeof t[r]>"u"&&(t[r]=gK(e[r]))}),t}});var $P=b((wY,IP)=>{IP.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]});var qP=b((SY,Q_)=>{"use strict";var yK=OP(),al=$P(),LP={nul:0,control:0};Q_.exports=function(e){return FP(e,LP)};Q_.exports.config=function(t){return t=yK(t||{},LP),function(r){return FP(r,t)}};function FP(t,e){if(typeof t!="string")return MP(t,e);for(var r=0,n=0;n<t.length;n++){var i=MP(t.charCodeAt(n),e);if(i<0)return-1;r+=i}return r}function MP(t,e){return t===0?e.nul:t<32||t>=127&&t<160?e.control:vK(t)?0:1+(t>=4352&&(t<=4447||t==9001||t==9002||t>=11904&&t<=42191&&t!=12351||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=131072&&t<=196605||t>=196608&&t<=262141))}function vK(t){var e=0,r=al.length-1,n;if(t<al[0][0]||t>al[r][1])return!1;for(;r>=e;)if(n=Math.floor((e+r)/2),t>al[n][1])e=n+1;else if(t<al[n][0])r=n-1;else return!0;return!1}});var tT=b((PY,jP)=>{jP.exports=require("stream")});var BP=b((DY,HP)=>{"use strict";function GP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function _K(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GP(Object(r),!0).forEach(function(n){TK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function TK(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bK(t,e,r){return e&&UP(t.prototype,e),r&&UP(t,r),t}var AK=require("buffer"),dp=AK.Buffer,EK=require("util"),rT=EK.inspect,CK=rT&&rT.custom||"inspect";function xK(t,e,r){dp.prototype.copy.call(t,e,r)}HP.exports=function(){function t(){RK(this,t),this.head=null,this.tail=null,this.length=0}return bK(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return dp.alloc(0);for(var n=dp.allocUnsafe(r>>>0),i=this.head,o=0;i;)xK(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=dp.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,s),r-=s,r===0){s===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++o}return this.length-=o,n}},{key:CK,value:function(r,n){return rT(this,_K({},n,{depth:0,customInspect:!1}))}}]),t}()});var iT=b((NY,KP)=>{"use strict";function wK(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(nT,this,t)):process.nextTick(nT,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(pp,r):(r._writableState.errorEmitted=!0,process.nextTick(WP,r,o)):process.nextTick(WP,r,o):e?(process.nextTick(pp,r),e(o)):process.nextTick(pp,r)}),this)}function WP(t,e){nT(t,e),pp(t)}function pp(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function SK(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function nT(t,e){t.emit("error",e)}function kK(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}KP.exports={destroy:wK,undestroy:SK,errorOrDestroy:kK}});var Ro=b((OY,YP)=>{"use strict";var VP={};function mn(t,e,r){r||(r=Error);function n(o,a,s){return typeof e=="string"?e:e(o,a,s)}class i extends r{constructor(a,s,u){super(n(a,s,u))}}i.prototype.name=r.name,i.prototype.code=t,VP[t]=i}function zP(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function PK(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function DK(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function NK(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}mn("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);mn("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&PK(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(DK(t," argument"))i=`The ${t} ${n} ${zP(e,"type")}`;else{let o=NK(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${zP(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);mn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");mn("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});mn("ERR_STREAM_PREMATURE_CLOSE","Premature close");mn("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});mn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");mn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");mn("ERR_STREAM_WRITE_AFTER_END","write after end");mn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);mn("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);mn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");YP.exports.codes=VP});var oT=b((IY,XP)=>{"use strict";var OK=Ro().codes.ERR_INVALID_OPT_VALUE;function IK(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $K(t,e,r,n){var i=IK(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new OK(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}XP.exports={getHighWaterMark:$K}});var ZP=b(($Y,aT)=>{typeof Object.create=="function"?aT.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:aT.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var ia=b((MY,uT)=>{try{if(sT=require("util"),typeof sT.inherits!="function")throw"";uT.exports=sT.inherits}catch{uT.exports=ZP()}var sT});var QP=b((LY,JP)=>{JP.exports=require("util").deprecate});var fT=b((FY,oD)=>{"use strict";oD.exports=Pt;function tD(t){var e=this;this.next=null,this.entry=null,this.finish=function(){uz(e,t)}}var Es;Pt.WritableState=ul;var MK={deprecate:QP()},rD=tT(),mp=require("buffer").Buffer,LK=global.Uint8Array||function(){};function FK(t){return mp.from(t)}function qK(t){return mp.isBuffer(t)||t instanceof LK}var cT=iT(),jK=oT(),GK=jK.getHighWaterMark,bo=Ro().codes,UK=bo.ERR_INVALID_ARG_TYPE,HK=bo.ERR_METHOD_NOT_IMPLEMENTED,BK=bo.ERR_MULTIPLE_CALLBACK,WK=bo.ERR_STREAM_CANNOT_PIPE,KK=bo.ERR_STREAM_DESTROYED,zK=bo.ERR_STREAM_NULL_VALUES,VK=bo.ERR_STREAM_WRITE_AFTER_END,YK=bo.ERR_UNKNOWN_ENCODING,Cs=cT.errorOrDestroy;ia()(Pt,rD);function XK(){}function ul(t,e,r){Es=Es||oa(),t=t||{},typeof r!="boolean"&&(r=e instanceof Es),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=GK(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){nz(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tD(this)}ul.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(ul.prototype,"buffer",{get:MK.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var hp;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(hp=Function.prototype[Symbol.hasInstance],Object.defineProperty(Pt,Symbol.hasInstance,{value:function(e){return hp.call(this,e)?!0:this!==Pt?!1:e&&e._writableState instanceof ul}})):hp=function(e){return e instanceof this};function Pt(t){Es=Es||oa();var e=this instanceof Es;if(!e&&!hp.call(Pt,this))return new Pt(t);this._writableState=new ul(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),rD.call(this)}Pt.prototype.pipe=function(){Cs(this,new WK)};function ZK(t,e){var r=new VK;Cs(t,r),process.nextTick(e,r)}function JK(t,e,r,n){var i;return r===null?i=new zK:typeof r!="string"&&!e.objectMode&&(i=new UK("chunk",["string","Buffer"],r)),i?(Cs(t,i),process.nextTick(n,i),!1):!0}Pt.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&qK(t);return o&&!mp.isBuffer(t)&&(t=FK(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=XK),n.ending?ZK(this,r):(o||JK(this,n,t,r))&&(n.pendingcb++,i=ez(this,n,o,t,e,r)),i};Pt.prototype.cork=function(){this._writableState.corked++};Pt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&nD(this,t))};Pt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new YK(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Pt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function QK(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=mp.from(e,r)),e}Object.defineProperty(Pt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ez(t,e,r,n,i,o){if(!r){var a=QK(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else lT(t,e,!1,s,n,i,o);return u}function lT(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new KK("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function tz(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(sl,t,e),t._writableState.errorEmitted=!0,Cs(t,n)):(i(n),t._writableState.errorEmitted=!0,Cs(t,n),sl(t,e))}function rz(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function nz(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new BK;if(rz(r),e)tz(t,r,n,e,i);else{var o=iD(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&nD(t,r),n?process.nextTick(eD,t,r,o,i):eD(t,r,o,i)}}function eD(t,e,r,n){r||iz(t,e),e.pendingcb--,n(),sl(t,e)}function iz(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function nD(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,lT(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new tD(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if(lT(t,e,!1,f,u,l,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Pt.prototype._write=function(t,e,r){r(new HK("_write()"))};Pt.prototype._writev=null;Pt.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||sz(this,n,r),this};Object.defineProperty(Pt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function iD(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function oz(t,e){t._final(function(r){e.pendingcb--,r&&Cs(t,r),e.prefinished=!0,t.emit("prefinish"),sl(t,e)})}function az(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(oz,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function sl(t,e){var r=iD(e);if(r&&(az(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function sz(t,e,r){e.ending=!0,sl(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function uz(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Pt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});Pt.prototype.destroy=cT.destroy;Pt.prototype._undestroy=cT.undestroy;Pt.prototype._destroy=function(t,e){e(t)}});var oa=b((qY,sD)=>{"use strict";var lz=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};sD.exports=Ti;var aD=hT(),pT=fT();ia()(Ti,aD);for(dT=lz(pT.prototype),gp=0;gp<dT.length;gp++)yp=dT[gp],Ti.prototype[yp]||(Ti.prototype[yp]=pT.prototype[yp]);var dT,yp,gp;function Ti(t){if(!(this instanceof Ti))return new Ti(t);aD.call(this,t),pT.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",cz)))}Object.defineProperty(Ti.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ti.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ti.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function cz(){this._writableState.ended||process.nextTick(fz,this)}function fz(t){t.end()}Object.defineProperty(Ti.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var cD=b((mT,lD)=>{var vp=require("buffer"),Ri=vp.Buffer;function uD(t,e){for(var r in t)e[r]=t[r]}Ri.from&&Ri.alloc&&Ri.allocUnsafe&&Ri.allocUnsafeSlow?lD.exports=vp:(uD(vp,mT),mT.Buffer=aa);function aa(t,e,r){return Ri(t,e,r)}aa.prototype=Object.create(Ri.prototype);uD(Ri,aa);aa.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ri(t,e,r)};aa.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Ri(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};aa.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ri(t)};aa.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return vp.SlowBuffer(t)}});var vT=b(dD=>{"use strict";var yT=cD().Buffer,fD=yT.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function dz(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function pz(t){var e=dz(t);if(typeof e!="string"&&(yT.isEncoding===fD||!fD(t)))throw new Error("Unknown encoding: "+t);return e||t}dD.StringDecoder=ll;function ll(t){this.encoding=pz(t);var e;switch(this.encoding){case"utf16le":this.text=_z,this.end=Tz,e=4;break;case"utf8":this.fillLast=gz,e=4;break;case"base64":this.text=Rz,this.end=bz,e=3;break;default:this.write=Az,this.end=Ez;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=yT.allocUnsafe(e)}ll.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};ll.prototype.end=vz;ll.prototype.text=yz;ll.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function gT(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function hz(t,e,r){var n=e.length-1;if(n<r)return 0;var i=gT(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=gT(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=gT(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function mz(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function gz(t){var e=this.lastTotal-this.lastNeed,r=mz(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function yz(t,e){var r=hz(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function vz(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function _z(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Tz(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Rz(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function bz(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Az(t){return t.toString(this.encoding)}function Ez(t){return t&&t.length?this.write(t):""}});var _p=b((GY,mD)=>{"use strict";var pD=Ro().codes.ERR_STREAM_PREMATURE_CLOSE;function Cz(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function xz(){}function wz(t){return t.setHeader&&typeof t.abort=="function"}function hD(t,e,r){if(typeof e=="function")return hD(t,null,e);e||(e={}),r=Cz(r||xz);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||s()},a=t._writableState&&t._writableState.finished,s=function(){i=!1,a=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},c=function(d){r.call(t,d)},f=function(){var d;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(d=new pD),r.call(t,d);if(i&&!a)return(!t._writableState||!t._writableState.ended)&&(d=new pD),r.call(t,d)},p=function(){t.req.on("finish",s)};return wz(t)?(t.on("complete",s),t.on("abort",f),t.req?p():t.on("request",p)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",s),e.error!==!1&&t.on("error",c),t.on("close",f),function(){t.removeListener("complete",s),t.removeListener("abort",f),t.removeListener("request",p),t.req&&t.req.removeListener("finish",s),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",s),t.removeListener("end",l),t.removeListener("error",c),t.removeListener("close",f)}}mD.exports=hD});var yD=b((UY,gD)=>{"use strict";var Tp;function Ao(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Sz=_p(),Eo=Symbol("lastResolve"),sa=Symbol("lastReject"),cl=Symbol("error"),Rp=Symbol("ended"),ua=Symbol("lastPromise"),_T=Symbol("handlePromise"),la=Symbol("stream");function Co(t,e){return{value:t,done:e}}function kz(t){var e=t[Eo];if(e!==null){var r=t[la].read();r!==null&&(t[ua]=null,t[Eo]=null,t[sa]=null,e(Co(r,!1)))}}function Pz(t){process.nextTick(kz,t)}function Dz(t,e){return function(r,n){t.then(function(){if(e[Rp]){r(Co(void 0,!0));return}e[_T](r,n)},n)}}var Nz=Object.getPrototypeOf(function(){}),Oz=Object.setPrototypeOf((Tp={get stream(){return this[la]},next:function(){var e=this,r=this[cl];if(r!==null)return Promise.reject(r);if(this[Rp])return Promise.resolve(Co(void 0,!0));if(this[la].destroyed)return new Promise(function(a,s){process.nextTick(function(){e[cl]?s(e[cl]):a(Co(void 0,!0))})});var n=this[ua],i;if(n)i=new Promise(Dz(n,this));else{var o=this[la].read();if(o!==null)return Promise.resolve(Co(o,!1));i=new Promise(this[_T])}return this[ua]=i,i}},Ao(Tp,Symbol.asyncIterator,function(){return this}),Ao(Tp,"return",function(){var e=this;return new Promise(function(r,n){e[la].destroy(null,function(i){if(i){n(i);return}r(Co(void 0,!0))})})}),Tp),Nz),Iz=function(e){var r,n=Object.create(Oz,(r={},Ao(r,la,{value:e,writable:!0}),Ao(r,Eo,{value:null,writable:!0}),Ao(r,sa,{value:null,writable:!0}),Ao(r,cl,{value:null,writable:!0}),Ao(r,Rp,{value:e._readableState.endEmitted,writable:!0}),Ao(r,_T,{value:function(o,a){var s=n[la].read();s?(n[ua]=null,n[Eo]=null,n[sa]=null,o(Co(s,!1))):(n[Eo]=o,n[sa]=a)},writable:!0}),r));return n[ua]=null,Sz(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[sa];o!==null&&(n[ua]=null,n[Eo]=null,n[sa]=null,o(i)),n[cl]=i;return}var a=n[Eo];a!==null&&(n[ua]=null,n[Eo]=null,n[sa]=null,a(Co(void 0,!0))),n[Rp]=!0}),e.on("readable",Pz.bind(null,n)),n};gD.exports=Iz});var RD=b((HY,TD)=>{"use strict";function vD(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(l){r(l);return}s.done?e(u):Promise.resolve(u).then(n,i)}function $z(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(u){vD(o,n,i,a,s,"next",u)}function s(u){vD(o,n,i,a,s,"throw",u)}a(void 0)})}}function _D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mz(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_D(Object(r),!0).forEach(function(n){Lz(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_D(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Lz(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Fz=Ro().codes.ERR_INVALID_ARG_TYPE;function qz(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new Fz("iterable",["Iterable"],e);var i=new t(Mz({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,a())};function a(){return s.apply(this,arguments)}function s(){return s=$z(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?a():o=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}TD.exports=qz});var hT=b((WY,DD)=>{"use strict";DD.exports=De;var xs;De.ReadableState=CD;var BY=require("events").EventEmitter,ED=function(e,r){return e.listeners(r).length},dl=tT(),bp=require("buffer").Buffer,jz=global.Uint8Array||function(){};function Gz(t){return bp.from(t)}function Uz(t){return bp.isBuffer(t)||t instanceof jz}var TT=require("util"),_e;TT&&TT.debuglog?_e=TT.debuglog("stream"):_e=function(){};var Hz=BP(),wT=iT(),Bz=oT(),Wz=Bz.getHighWaterMark,Ap=Ro().codes,Kz=Ap.ERR_INVALID_ARG_TYPE,zz=Ap.ERR_STREAM_PUSH_AFTER_EOF,Vz=Ap.ERR_METHOD_NOT_IMPLEMENTED,Yz=Ap.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ws,RT,bT;ia()(De,dl);var fl=wT.errorOrDestroy,AT=["error","close","destroy","pause","resume"];function Xz(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function CD(t,e,r){xs=xs||oa(),t=t||{},typeof r!="boolean"&&(r=e instanceof xs),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Wz(this,t,"readableHighWaterMark",r),this.buffer=new Hz,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ws||(ws=vT().StringDecoder),this.decoder=new ws(t.encoding),this.encoding=t.encoding)}function De(t){if(xs=xs||oa(),!(this instanceof De))return new De(t);var e=this instanceof xs;this._readableState=new CD(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),dl.call(this)}Object.defineProperty(De.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});De.prototype.destroy=wT.destroy;De.prototype._undestroy=wT.undestroy;De.prototype._destroy=function(t,e){e(t)};De.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=bp.from(t,e),e=""),n=!0),xD(this,t,e,!1,n)};De.prototype.unshift=function(t){return xD(this,t,null,!0,!1)};function xD(t,e,r,n,i){_e("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,Qz(t,o);else{var a;if(i||(a=Zz(o,e)),a)fl(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==bp.prototype&&(e=Gz(e)),n)o.endEmitted?fl(t,new Yz):ET(t,o,e,!0);else if(o.ended)fl(t,new zz);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?ET(t,o,e,!1):xT(t,o)):ET(t,o,e,!1)}else n||(o.reading=!1,xT(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function ET(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Ep(t)),xT(t,e)}function Zz(t,e){var r;return!Uz(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new Kz("chunk",["string","Buffer","Uint8Array"],e)),r}De.prototype.isPaused=function(){return this._readableState.flowing===!1};De.prototype.setEncoding=function(t){ws||(ws=vT().StringDecoder);var e=new ws(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var bD=1073741824;function Jz(t){return t>=bD?t=bD:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function AD(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Jz(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}De.prototype.read=function(t){_e("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return _e("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?CT(this):Ep(this),null;if(t=AD(t,e),t===0&&e.ended)return e.length===0&&CT(this),null;var n=e.needReadable;_e("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,_e("length less than watermark",n)),e.ended||e.reading?(n=!1,_e("reading or ended",n)):n&&(_e("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=AD(r,e)));var i;return t>0?i=kD(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&CT(this)),i!==null&&this.emit("data",i),i};function Qz(t,e){if(_e("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Ep(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,wD(t)))}}function Ep(t){var e=t._readableState;_e("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(_e("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(wD,t))}function wD(t){var e=t._readableState;_e("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,ST(t)}function xT(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(eV,t,e))}function eV(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(_e("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}De.prototype._read=function(t){fl(this,new Vz("_read()"))};De.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,_e("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?s:g;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(C,x){_e("onunpipe"),C===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,c())}function s(){_e("onend"),t.end()}var u=tV(r);t.on("drain",u);var l=!1;function c(){_e("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(C){_e("ondata");var x=t.write(C);_e("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&PD(n.pipes,t)!==-1)&&!l&&(_e("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(C){_e("onerror",C),g(),t.removeListener("error",p),ED(t,"error")===0&&fl(t,C)}Xz(t,"error",p);function h(){t.removeListener("finish",d),g()}t.once("close",h);function d(){_e("onfinish"),t.removeListener("close",h),g()}t.once("finish",d);function g(){_e("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(_e("pipe resume"),r.resume()),t};function tV(t){return function(){var r=t._readableState;_e("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&ED(t,"data")&&(r.flowing=!0,ST(t))}}De.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=PD(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};De.prototype.on=function(t,e){var r=dl.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,_e("on readable",n.length,n.reading),n.length?Ep(this):n.reading||process.nextTick(rV,this)),r};De.prototype.addListener=De.prototype.on;De.prototype.removeListener=function(t,e){var r=dl.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(SD,this),r};De.prototype.removeAllListeners=function(t){var e=dl.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(SD,this),e};function SD(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function rV(t){_e("readable nexttick read 0"),t.read(0)}De.prototype.resume=function(){var t=this._readableState;return t.flowing||(_e("resume"),t.flowing=!t.readableListening,nV(this,t)),t.paused=!1,this};function nV(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(iV,t,e))}function iV(t,e){_e("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),ST(t),e.flowing&&!e.reading&&t.read(0)}De.prototype.pause=function(){return _e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ST(t){var e=t._readableState;for(_e("flow",e.flowing);e.flowing&&t.read()!==null;);}De.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(_e("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(_e("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=e.push(a);s||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(s){return function(){return t[s].apply(t,arguments)}}(i));for(var o=0;o<AT.length;o++)t.on(AT[o],this.emit.bind(this,AT[o]));return this._read=function(a){_e("wrapped _read",a),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(De.prototype[Symbol.asyncIterator]=function(){return RT===void 0&&(RT=yD()),RT(this)});Object.defineProperty(De.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(De.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(De.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});De._fromList=kD;Object.defineProperty(De.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function kD(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function CT(t){var e=t._readableState;_e("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(oV,e,t))}function oV(t,e){if(_e("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(De.from=function(t,e){return bT===void 0&&(bT=RD()),bT(De,t,e)});function PD(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var kT=b((KY,OD)=>{"use strict";OD.exports=zi;var Cp=Ro().codes,aV=Cp.ERR_METHOD_NOT_IMPLEMENTED,sV=Cp.ERR_MULTIPLE_CALLBACK,uV=Cp.ERR_TRANSFORM_ALREADY_TRANSFORMING,lV=Cp.ERR_TRANSFORM_WITH_LENGTH_0,xp=oa();ia()(zi,xp);function cV(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new sV);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function zi(t){if(!(this instanceof zi))return new zi(t);xp.call(this,t),this._transformState={afterTransform:cV.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",fV)}function fV(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){ND(t,e,r)}):ND(this,null,null)}zi.prototype.push=function(t,e){return this._transformState.needTransform=!1,xp.prototype.push.call(this,t,e)};zi.prototype._transform=function(t,e,r){r(new aV("_transform()"))};zi.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};zi.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};zi.prototype._destroy=function(t,e){xp.prototype._destroy.call(this,t,function(r){e(r)})};function ND(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new lV;if(t._transformState.transforming)throw new uV;return t.push(null)}});var MD=b((zY,$D)=>{"use strict";$D.exports=pl;var ID=kT();ia()(pl,ID);function pl(t){if(!(this instanceof pl))return new pl(t);ID.call(this,t)}pl.prototype._transform=function(t,e,r){r(null,t)}});var GD=b((VY,jD)=>{"use strict";var PT;function dV(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var qD=Ro().codes,pV=qD.ERR_MISSING_ARGS,hV=qD.ERR_STREAM_DESTROYED;function LD(t){if(t)throw t}function mV(t){return t.setHeader&&typeof t.abort=="function"}function gV(t,e,r,n){n=dV(n);var i=!1;t.on("close",function(){i=!0}),PT===void 0&&(PT=_p()),PT(t,{readable:e,writable:r},function(a){if(a)return n(a);i=!0,n()});var o=!1;return function(a){if(!i&&!o){if(o=!0,mV(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(a||new hV("pipe"))}}}function FD(t){t()}function yV(t,e){return t.pipe(e)}function vV(t){return!t.length||typeof t[t.length-1]!="function"?LD:t.pop()}function _V(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=vV(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new pV("streams");var i,o=e.map(function(a,s){var u=s<e.length-1,l=s>0;return gV(a,u,l,function(c){i||(i=c),c&&o.forEach(FD),!u&&(o.forEach(FD),n(i))})});return e.reduce(yV)}jD.exports=_V});var UD=b((gn,ml)=>{var hl=require("stream");process.env.READABLE_STREAM==="disable"&&hl?(ml.exports=hl.Readable,Object.assign(ml.exports,hl),ml.exports.Stream=hl):(gn=ml.exports=hT(),gn.Stream=hl||gn,gn.Readable=gn,gn.Writable=fT(),gn.Duplex=oa(),gn.Transform=kT(),gn.PassThrough=MD(),gn.finished=_p(),gn.pipeline=GD())});var WD=b((YY,BD)=>{"use strict";var{Buffer:Xn}=require("buffer"),HD=Symbol.for("BufferList");function ut(t){if(!(this instanceof ut))return new ut(t);ut._init.call(this,t)}ut._init=function(e){Object.defineProperty(this,HD,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};ut.prototype._new=function(e){return new ut(e)};ut.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let i=r+this._bufs[n].length;if(e<i||n===this._bufs.length-1)return[n,e-r];r=i}};ut.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r};ut.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};ut.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};ut.prototype.copy=function(e,r,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||Xn.alloc(0);let o=!!e,a=this._offset(n),s=i-n,u=s,l=o&&r||0,c=a[1];if(n===0&&i===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:Xn.concat(this._bufs,this.length);for(let f=0;f<this._bufs.length;f++)this._bufs[f].copy(e,l),l+=this._bufs[f].length;return e}if(u<=this._bufs[a[0]].length-c)return o?this._bufs[a[0]].copy(e,r,c,c+u):this._bufs[a[0]].slice(c,c+u);o||(e=Xn.allocUnsafe(s));for(let f=a[0];f<this._bufs.length;f++){let p=this._bufs[f].length-c;if(u>p)this._bufs[f].copy(e,l,c),l+=p;else{this._bufs[f].copy(e,l,c,c+u),l+=p;break}u-=p,c&&(c=0)}return e.length>l?e.slice(0,l):e};ut.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let n=this._offset(e),i=this._offset(r),o=this._bufs.slice(n[0],i[0]+1);return i[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,i[1]),n[1]!==0&&(o[0]=o[0].slice(n[1])),this._new(o)};ut.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};ut.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ut.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};ut.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(Xn.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(Xn.from(e));return this};ut.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};ut.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=Xn.from([t]):typeof t=="string"?t=Xn.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=Xn.from(t.buffer,t.byteOffset,t.byteLength):Xn.isBuffer(t)||(t=Xn.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let n=this._offset(e),i=n[0],o=n[1];for(;i<this._bufs.length;i++){let a=this._bufs[i];for(;o<a.length;)if(a.length-o>=t.length){let u=a.indexOf(t,o);if(u!==-1)return this._reverseOffset([i,u]);o=a.length-t.length+1}else{let u=this._reverseOffset([i,o]);if(this._match(u,t))return u;o++}o=0}return-1};ut.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?ut.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:ut.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)}})(e)})();ut.prototype._isBufferList=function(e){return e instanceof ut||ut.isBufferList(e)};ut.isBufferList=function(e){return e!=null&&e[HD]};BD.exports=ut});var KD=b((XY,wp)=>{"use strict";var DT=UD().Duplex,TV=ia(),gl=WD();function Rr(t){if(!(this instanceof Rr))return new Rr(t);if(typeof t=="function"){this._callback=t;let e=function(n){this._callback&&(this._callback(n),this._callback=null)}.bind(this);this.on("pipe",function(n){n.on("error",e)}),this.on("unpipe",function(n){n.removeListener("error",e)}),t=null}gl._init.call(this,t),DT.call(this)}TV(Rr,DT);Object.assign(Rr.prototype,gl.prototype);Rr.prototype._new=function(e){return new Rr(e)};Rr.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n()};Rr.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};Rr.prototype.end=function(e){DT.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Rr.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Rr.prototype._isBufferList=function(e){return e instanceof Rr||e instanceof gl||Rr.isBufferList(e)};Rr.isBufferList=gl.isBufferList;wp.exports=Rr;wp.exports.BufferListStream=Rr;wp.exports.BufferList=gl});var EV={};dN(EV,{default:()=>AV,generateAction:()=>aN,initAction:()=>oN});module.exports=pN(EV);var nN=te(Al()),_l=te(zp()),iN=te(t_());var Ak=te(tk());var rk="74944eb779d7d3b4ce185be843fde9fc";var Ek=te(nk()),Ck=te(gk()),xk=te(require("os")),S_=te(vk()),k_=te(bk());var Dr=class extends Error{};var wk=te(zp());var P_=class{constructor(){this.hostId=(0,Ek.machineIdSync)();this.sessionid=(0,Ck.default)();this.trackingToken=rk;this._os=xk.platform();this.version=Hd().version;this.exitWait=200;process.env.DO_NOT_TRACK!=="1"&&this.trackingToken&&(this.mixpanel=(0,Ak.init)(this.trackingToken,{geolocate:!0})),(0,k_.default)(e=>wt(this,null,function*(){this.mixpanel&&(yield(0,S_.default)(this.exitWait)),e()})),k_.default.uncaughtExceptionHandler(e=>wt(this,null,function*(){this.track("cli:error",{message:e.message,stack:e.stack}),this.mixpanel&&(yield(0,S_.default)(this.exitWait)),e instanceof Dr||e instanceof wk.CommanderError||console.error(`
6466
6466
  An unexpected error occurred:
6467
- `,e),process.exit(1)}))}track(e,r={}){if(this.mixpanel){let n=Rl({distinct_id:this.hostId,session:this.sessionid,time:new Date,$os:this._os,nodeVersion:process.version,version:this.version},r);this.mixpanel.track(e,n)}}trackSpan(e,r,n,i,o){return wt(this,null,function*(){this.track(e,i);let a=Date.now(),s=!0;try{yield Promise.resolve(o())}catch(u){throw this.track(n,Rl({message:u.message,stack:u.stack},i)),s=!1,u}finally{this.track(r,Rl({duration:Date.now()-a,success:s},i))}})}},ms=new P_;var eN=te(Sk()),Vi=te(Al()),bi=te(require("fs")),tN=te(Nk()),Ai=te(require("path")),IT=te($n());var O_=["sqlite","postgresql","mysql","sqlserver","cockroachdb"],Ok=["String","Int","Float","Decimal","BigInt","Boolean","Bytes","DateTime"],_o="stdlib.zmodel";var Jd=te(t_()),Et=te(go()),Kk=te(Xe()),zk=te(_c());var jk=te(go());var $k=te(Wn());var Kn=te(Wn());function To(t,e){let r=t.reduce((n,i)=>{var o;return n[i.name]=(o=n[i.name])!=null?o:[],n[i.name].push(i),n},{});for(let[n,i]of Object.entries(r))i.length>1&&e("error",`Duplicated declaration name "${n}"`,{node:i[1]})}function Wd(t){if((0,Kn.isLiteralExpr)(t)&&typeof t.value=="string")return t.value}function W3(t,e){switch(t){case"Any":return!0;case"Float":return e==="Any"||e==="Int"||e==="Float";default:return e==="Any"||e===t}}function I_(t){switch(t){case"Any":case"Boolean":case"String":case"DateTime":case"Int":case"Float":case"Null":return t;case"BigInt":return"Int";case"Decimal":return"Float";case"Json":case"Bytes":return"Any"}}function Ik(t,e,r){var s,u;let n=t.$resolvedType;if(!n)return!1;let i=e.type.type,o=e.type.array,a=e.type.reference;if(i){if(typeof(n==null?void 0:n.decl)!="string")return!1;if(i==="FieldReference")return o?(0,Kn.isArrayExpr)(t.value)&&!t.value.items.find(l=>!(0,Kn.isReferenceExpr)(l)||!(0,Kn.isDataModelField)(l.target.ref)):(0,Kn.isReferenceExpr)(t.value)&&(0,Kn.isDataModelField)(t.value.target.ref);if(i==="ContextType")if((0,Kn.isDataModelField)(r.$container)){if(!((u=(s=r.$container)==null?void 0:s.type)!=null&&u.type))return!1;i=I_(r.$container.type.type)}else i="Any";return W3(i,n.decl)&&o===n.array}else return(a==null?void 0:a.ref)===n.decl&&o===n.array}var Yu=class{validate(e,r){var n;To(e.declarations,r),(n=e.$document)!=null&&n.uri.path.endsWith(_o)||this.validateDataSources(e,r)}validateDataSources(e,r){let n=e.declarations.filter(i=>(0,$k.isDataSource)(i));n.length===0?r("error","Model must define a datasource",{node:e}):n.length>1&&r("error","Multiple datasource declarations are not allowed",{node:n[1]})}};var Mk=te(Wn());var K3=["provider","url","shadowDatabaseUrl","relationMode"],Xu=class{validate(e,r){To(e.fields,r),this.validateFields(e,r),this.validateProvider(e,r),this.validateUrl(e,r),this.validateRelationMode(e,r)}validateFields(e,r){e.fields.forEach(n=>{K3.includes(n.name)||r("error",`Unexpected field "${n.name}"`,{node:n})})}validateProvider(e,r){let n=e.fields.find(o=>o.name==="provider");if(!n){r("error",'datasource must include a "provider" field',{node:e});return}let i=Wd(n.value);i?O_.includes(i)||r("error",`Provider "${i}" is not supported. Choose from ${O_.map(o=>'"'+o+'"').join(" | ")}.`,{node:n.value}):r("error",'"provider" must be set to a string literal',{node:n.value})}validateUrl(e,r){var i;e.fields.find(o=>o.name==="url")||r("error",'datasource must include a "url" field',{node:e});for(let o of["url","shadowDatabaseUrl"]){let a=e.fields.find(u=>u.name===o);if(!a)continue;!Wd(a.value)&&!((0,Mk.isInvocationExpr)(a.value)&&((i=a.value.function.ref)==null?void 0:i.name)==="env")&&r("error",`"${o}" must be set to a string literal or an invocation of "env" function`,{node:a.value})}}validateRelationMode(e,r){let n=e.fields.find(i=>i.name==="relationMode");if(n){let i=Wd(n.value);(!i||!["foreignKeys","prisma"].includes(i))&&r("error",'"relationMode" must be set to "foreignKeys" or "prisma"',{node:n.value})}}};var Ki=te(Wn());var Fk=te(Lk()),Zu=class{validate(e,r){To(e.fields,r),this.validateFields(e,r),this.validateAttributes(e,r)}validateFields(e,r){let n=e.fields.filter(i=>i.attributes.find(o=>{var a;return((a=o.decl.ref)==null?void 0:a.name)==="@id"}));n.length===0?r("error","Model must include a field with @id attribute",{node:e}):n.length>1?r("error","Model can include at most one field with @id attribute",{node:e}):(n[0].type.optional&&r("error","Field with @id attribute must not be optional",{node:n[0]}),(n[0].type.array||!n[0].type.type||!Ok.includes(n[0].type.type))&&r("error","Field with @id attribute must be of scalar type",{node:n[0]})),e.fields.forEach(i=>this.validateField(i,r))}validateField(e,r){var n;e.type.array&&e.type.optional&&r("error","Optional lists are not supported. Use either `Type[]` or `Type?`",{node:e.type}),e.attributes.forEach(i=>this.validateAttributeApplication(i,r)),(0,Ki.isDataModel)((n=e.type.reference)==null?void 0:n.ref)&&this.validateRelationField(e,r)}validateAttributes(e,r){e.attributes.forEach(n=>{this.validateAttributeApplication(n,r)})}validateAttributeApplication(e,r){let n=e.decl.ref;if(!n)return;let i=e.$container;if(n.name==="@@@targetField"&&!(0,Ki.isAttribute)(i)){r("error",`attribute "${n.name}" can only be used on attribute declarations`,{node:e});return}(0,Ki.isDataModelField)(i)&&!this.isValidAttributeTarget(n,i)&&r("error",`attribute "${n.name}" cannot be used on this type of field`,{node:e});let o=new Set;for(let s of e.args){let u;if(s.name){if(u=n.params.find(l=>l.name===s.name),!u)return r("error",`Attribute "${n.name}" doesn't have a parameter named "${s.name}"`,{node:s}),!1}else if(u=n.params.find(l=>l.default&&!o.has(l)),!u)return r("error","Unexpected unnamed argument",{node:s}),!1;if(!Ik(s,u,e))return r("error","Value is not assignable to parameter",{node:s}),!1;if(o.has(u))return r("error",`Parameter "${u.name}" is already provided`,{node:s}),!1;o.add(u),s.$resolvedParam=u}let a=n.params.filter(s=>!s.type.optional&&!o.has(s));return a.length>0?(r("error",`Required ${(0,Fk.default)("parameter",a.length)} not provided: ${a.map(s=>s.name).join(", ")}`,{node:e}),!1):!0}isValidAttributeTarget(e,r){var a;let n=e.attributes.find(s=>{var u;return((u=s.decl.ref)==null?void 0:u.name)==="@@@targetField"});if(!n)return!0;let i=n.args[0].value.items.map(s=>{var u;return(u=s.target.ref)==null?void 0:u.name}),o=!1;for(let s of i){switch(s){case"StringField":o=o||r.type.type==="String";break;case"IntField":o=o||r.type.type==="Int";break;case"FloatField":o=o||r.type.type==="Float";break;case"DecimalField":o=o||r.type.type==="Decimal";break;case"BooleanField":o=o||r.type.type==="Boolean";break;case"DateTimeField":o=o||r.type.type==="DateTime";break;case"JsonField":o=o||r.type.type==="Json";break;case"BytesField":o=o||r.type.type==="Bytes";break;case"ModelField":o=o||(0,Ki.isDataModel)((a=r.type.reference)==null?void 0:a.ref);break;default:break}if(o)break}return o}parseRelation(e,r){let n=e.attributes.find(u=>{var l;return((l=u.decl.ref)==null?void 0:l.name)==="@relation"}),i,o,a,s=!0;if(!n)return{attr:n,name:i,fields:o,references:a,valid:!0};for(let u of n.args)!u.name||u.name==="name"?(0,Ki.isLiteralExpr)(u.value)&&(i=u.value.value):u.name==="fields"?(o=u.value.items,o.length===0&&(r&&r("error",'"fields" value cannot be emtpy',{node:u}),s=!1)):u.name==="references"&&(a=u.value.items,a.length===0&&(r&&r("error",'"references" value cannot be emtpy',{node:u}),s=!1));return{attr:n,name:i,fields:o,references:a,valid:s}}validateRelationField(e,r){var l,c,f,p,h;let n=this.parseRelation(e,r);if(!n.valid)return;let i=e.type.reference.ref,o=i.fields.filter(d=>{var g;return((g=d.type.reference)==null?void 0:g.ref)===e.$container});if(o=o.filter(d=>{let g=this.parseRelation(d);return g.valid&&g.name===n.name}),o.length===0){r("error",`The relation field "${e.name}" on model "${e.$container.name}" is missing an opposite relation field on model "${i.name}"`,{node:e});return}else if(o.length>1){o.forEach(d=>r("error",`Fields ${o.map(g=>'"'+g.name+'"').join(", ")} on model "${i.name}" refer to the same relation to model "${e.$container.name}"`,{node:d}));return}let a=o[0],s=this.parseRelation(a),u;if(((l=n==null?void 0:n.references)==null?void 0:l.length)&&((c=n.fields)==null?void 0:c.length))if((s==null?void 0:s.references)||(s==null?void 0:s.fields)){r("error",'"fields" and "references" must be provided only on one side of relation field',{node:a});return}else u=a;else if(((f=s==null?void 0:s.references)==null?void 0:f.length)&&((p=s.fields)==null?void 0:p.length))if((n==null?void 0:n.references)||(n==null?void 0:n.fields)){r("error",'"fields" and "references" must be provided only on one side of relation field',{node:e});return}else u=e;else{[e,a].forEach(d=>r("error",'Field for one side of relation must carry @relation attribute with both "fields" and "references" fields',{node:d}));return}if(!u.type.array&&!u.type.optional){r("error","Relation field needs to be list or optional",{node:u});return}u!==e&&!u.type.array&&((h=n.fields)==null||h.forEach(d=>{let g=d.target.ref;g&&!g.attributes.find(C=>{var x;return((x=C.decl.ref)==null?void 0:x.name)==="@unique"})&&r("error",`Field "${g.name}" is part of a one-to-one relation and must be marked as @unique`,{node:g})}))}};var Ju=class{validate(e,r){}};var Qu=class{validate(e,r){To(e.fields,r)}};var Vd=te(Wn());var qk=te(Wn());function Kd(t){return t?(0,qk.isModel)(t)?t:Kd(t.$container):null}function zd(t){var r;let e=Kd(t);return e&&((r=e.$document)==null?void 0:r.uri.path.endsWith(_o))}var el=class{validate(e,r){e.$resolvedType||(this.isAuthInvocation(e)?r("error",'auth() cannot be resolved because no "User" model is defined',{node:e}):this.isCollectionPredicate(e)?r("error","collection predicate can only be used on an array of model type",{node:e}):r("error","expression cannot be resolved",{node:e}))}isCollectionPredicate(e){return(0,Vd.isBinaryExpr)(e)&&["?","!","^"].includes(e.operator)}isAuthInvocation(e){var r;return(0,Vd.isInvocationExpr)(e)&&((r=e.function.ref)==null?void 0:r.name)==="auth"&&zd(e.function.ref)}};var Yd=class extends jk.ValidationRegistry{constructor(e){super(e);let r=e.validation.ZModelValidator,n={Model:r.checkModel,DataSource:r.checkDataSource,DataModel:r.checkDataModel,Enum:r.checkEnum,Attribute:r.checkAttribute,Expression:r.checkExpression};this.register(n,r)}},Xd=class{shouldCheck(e){let r,n=e;for(;n;){if(n.$document){r=n.$document;break}n=n.$container}return(r==null?void 0:r.parseResult.lexerErrors.length)===0&&(r==null?void 0:r.parseResult.parserErrors.length)===0}checkModel(e,r){this.shouldCheck(e)&&new Yu().validate(e,r)}checkDataSource(e,r){this.shouldCheck(e)&&new Xu().validate(e,r)}checkDataModel(e,r){this.shouldCheck(e)&&new Zu().validate(e,r)}checkEnum(e,r){this.shouldCheck(e)&&new Qu().validate(e,r)}checkAttribute(e,r){this.shouldCheck(e)&&new Ju().validate(e,r)}checkExpression(e,r){new el().validate(e,r)}};var zn=te(go()),Gk=te(ti()),ft=te(Wn());var Zd=class extends zn.DefaultLinker{constructor(r){super(r);this.descriptions=r.workspace.AstNodeDescriptionProvider}link(i){return wt(this,arguments,function*(r,n=Gk.CancellationToken.None){var o,a;if(!(((o=r.parseResult.lexerErrors)==null?void 0:o.length)>0||((a=r.parseResult.parserErrors)==null?void 0:a.length)>0)){for(let s of(0,zn.streamContents)(r.parseResult.value))yield(0,zn.interruptAndCheck)(n),this.resolve(s,r);r.state=zn.DocumentState.Linked}})}linkReference(r,n,i,o){if(!this.resolveFromScopeProviders(r,n,i,o)){let a=r[n];this.doLink({reference:a,container:r,property:n},i)}}resolveFromScopeProviders(r,n,i,o){let a=r[n];for(let s of o){let u=s(a.$refText);if(u)return a._ref=u,a._nodeDescription=this.descriptions.createDescription(u,u.name,i),u}return null}resolve(r,n,i=[]){switch(r.$type){case ft.LiteralExpr:this.resolveLiteral(r);break;case ft.InvocationExpr:this.resolveInvocation(r,n,i);break;case ft.ArrayExpr:this.resolveArray(r,n,i);break;case ft.ReferenceExpr:this.resolveReference(r,n,i);break;case ft.MemberAccessExpr:this.resolveMemberAccess(r,n,i);break;case ft.UnaryExpr:this.resolveUnary(r,n,i);break;case ft.BinaryExpr:this.resolveBinary(r,n,i);break;case ft.ThisExpr:this.resolveThis(r,n,i);break;case ft.NullExpr:this.resolveNull(r,n,i);break;case"AttributeArg":this.resolveAttributeArg(r,n,i);break;default:this.resolveDefault(r,n,i);break}}resolveBinary(r,n,i){switch(r.operator){case">":case">=":case"<":case"<=":case"==":case"!=":case"&&":case"||":this.resolve(r.left,n,i),this.resolve(r.right,n,i),this.resolveToBuiltinTypeOrDecl(r,"Boolean");break;case"?":case"!":case"^":this.resolveCollectionPredicate(r,n,i);break;default:throw Error(`Unsupported binary operator: ${r.operator}`)}}resolveUnary(r,n,i){this.resolve(r.operand,n,i),r.$resolvedType=r.operand.$resolvedType}resolveReference(r,n,i){this.linkReference(r,"target",n,i),r.args.forEach(o=>this.resolve(o,n,i)),r.target.ref&&(r.target.ref.$type===ft.EnumField?this.resolveToBuiltinTypeOrDecl(r,r.target.ref.$container):this.resolveToDeclaredType(r,r.target.ref.type))}resolveArray(r,n,i){r.items.forEach(a=>this.resolve(a,n,i));let o=r.items[0].$resolvedType;o!=null&&o.decl&&this.resolveToBuiltinTypeOrDecl(r,o.decl,!0)}resolveInvocation(r,n,i){if(this.linkReference(r,"function",n,i),r.args.forEach(o=>this.resolve(o,n,i)),r.function.ref){let o=r.function.ref;if(o.name==="auth"&&zd(o)){let a=Kd(r),s=a==null?void 0:a.declarations.find(u=>(0,ft.isDataModel)(u)&&u.name==="User");s&&(r.$resolvedType={decl:s})}else this.resolveToDeclaredType(r,o.returnType)}}resolveLiteral(r){let n=typeof r.value=="string"?"String":typeof r.value=="boolean"?"Boolean":typeof r.value=="number"?"Int":void 0;n&&this.resolveToBuiltinTypeOrDecl(r,n)}resolveMemberAccess(r,n,i){this.resolve(r.operand,n,i);let o=r.operand.$resolvedType;if(o&&!o.array&&(0,ft.isDataModel)(o.decl)){let a=o.decl;i=[u=>a.fields.find(l=>l.name===u),...i]}this.linkReference(r,"member",n,i),r.member.ref&&this.resolveToDeclaredType(r,r.member.ref.type)}resolveCollectionPredicate(r,n,i){this.resolve(r.left,n,i);let o=r.left.$resolvedType;if(o&&(0,ft.isDataModel)(o.decl)&&o.array){let a=o.decl;i=[u=>a.fields.find(l=>l.name===u),...i],this.resolve(r.right,n,i),this.resolveToBuiltinTypeOrDecl(r,"Boolean")}}resolveThis(r,n,i){let o=r.$container;for(;o&&!(0,ft.isDataModel)(o);)o=o.$container;o&&this.resolveToBuiltinTypeOrDecl(r,o)}resolveNull(r,n,i){this.resolveToBuiltinTypeOrDecl(r,"Null")}resolveAttributeArg(r,n,i){this.resolve(r.value,n,i),r.$resolvedType=r.value.$resolvedType}resolveDefault(r,n,i){for(let[o,a]of Object.entries(r))o.startsWith("$")||(0,zn.isReference)(a)&&this.linkReference(r,o,n,i);for(let o of(0,zn.streamContents)(r))this.resolve(o,n,i)}resolveToDeclaredType(r,n){if(n.type){let i=I_(n.type);r.$resolvedType={decl:i,array:n.array}}else n.reference&&(r.$resolvedType={decl:n.reference.ref,array:n.array})}resolveToBuiltinTypeOrDecl(r,n,i=!1){r.$resolvedType={decl:n,array:i}}};var Uk=te(Wn()),ys=te(go());var gs=class extends ys.DefaultScopeComputation{constructor(r){super(r);this.services=r}computeExports(r,n){return wt(this,null,function*(){let i=yield bl(gs.prototype,this,"computeExports").call(this,r,n);for(let o of(0,ys.streamAllContents)(r.parseResult.value))if(n&&(yield(0,ys.interruptAndCheck)(n)),(0,Uk.isEnumField)(o)){let a=this.services.workspace.AstNodeDescriptionProvider.createDescription(o,o.name,r);i.push(a)}return i})}};var Hk=te(go()),Bk=te(require("path")),Wk=te($n());var ta=class extends Hk.DefaultWorkspaceManager{loadAdditionalDocuments(e,r){return wt(this,null,function*(){yield bl(ta.prototype,this,"loadAdditionalDocuments").call(this,e,r);let n=Wk.URI.file(Bk.default.join(__dirname,"../res",_o));console.log(`Adding stdlib document from ${n}`);let i=this.langiumDocuments.getOrCreateDocument(n);r(i)})}};var z3={references:{ScopeComputation:t=>new gs(t),Linker:t=>new Zd(t)},validation:{ValidationRegistry:t=>new Yd(t),ZModelValidator:()=>new Xd}};function V3(t){return{ServiceRegistry:()=>new Et.DefaultServiceRegistry,lsp:{Connection:()=>t.connection,LanguageServer:e=>new Et.DefaultLanguageServer(e)},workspace:{LangiumDocuments:e=>new Et.DefaultLangiumDocuments(e),LangiumDocumentFactory:e=>new Et.DefaultLangiumDocumentFactory(e),DocumentBuilder:e=>new Et.DefaultDocumentBuilder(e),TextDocuments:()=>new Kk.TextDocuments(zk.TextDocument),TextDocumentFactory:e=>new Et.DefaultTextDocumentFactory(e),IndexManager:e=>new Et.DefaultIndexManager(e),WorkspaceManager:e=>new ta(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new Et.MutexLock,ConfigurationProvider:e=>new Et.DefaultConfigurationProvider(e)}}}function Vk(t){let e=(0,Et.inject)(V3(t),Jd.ZModelGeneratedSharedModule),r=(0,Et.inject)((0,Et.createDefaultModule)({shared:e}),Jd.ZModelGeneratedModule,z3);return e.ServiceRegistry.register(r),{shared:e,ZModel:r}}var L_=te(require("fs")),F_=te(require("path"));var Yk=require("child_process");function Qd(t){(0,Yk.execSync)(t,{encoding:"utf-8",stdio:"inherit"})}function Y3(t="."){return L_.default.existsSync(F_.default.join(t,"yarn.lock"))?"yarn":L_.default.existsSync(F_.default.join(t,"pnpm-lock.yaml"))?"pnpm":"npm"}function q_(t,e,r=void 0,n="."){let i=r!=null?r:Y3(n);switch(console.log(`Installing package "${t}" with ${i}`),i){case"yarn":Qd(`yarn --cwd "${n}" add ${t} ${e?" --dev":""} --ignore-engines`);break;case"pnpm":Qd(`pnpm add -C "${n}" ${e?" --save-dev":""} ${t}`);break;default:Qd(`npm install --prefix "${n}" ${e?" --save-dev":""} ${t}`);break}}var XD=te(Wn()),Dp=te(Qk()),Ss=te(Al());var yl=te(require("node:process"),1);var eP=(t=0)=>e=>`\x1B[${e+t}m`,tP=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,rP=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,yt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nP=Object.keys(yt.modifier),j_=Object.keys(yt.color),G_=Object.keys(yt.bgColor),iP=[...j_,...G_];function J3(){let t=new Map;for(let[e,r]of Object.entries(yt)){for(let[n,i]of Object.entries(r))yt[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=yt[n],t.set(i[0],i[1]);Object.defineProperty(yt,e,{value:r,enumerable:!1})}return Object.defineProperty(yt,"codes",{value:t,enumerable:!1}),yt.color.close="\x1B[39m",yt.bgColor.close="\x1B[49m",yt.color.ansi=eP(),yt.color.ansi256=tP(),yt.color.ansi16m=rP(),yt.bgColor.ansi=eP(10),yt.bgColor.ansi256=tP(10),yt.bgColor.ansi16m=rP(10),Object.defineProperties(yt,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>yt.rgbToAnsi256(...yt.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let s=e%36;r=Math.floor(e/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>yt.ansi256ToAnsi(yt.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>yt.ansi256ToAnsi(yt.hexToAnsi256(e)),enumerable:!1}}),yt}var Q3=J3(),Vn=Q3;var tp=te(require("node:process"),1),aP=te(require("node:os"),1),U_=te(require("node:tty"),1);function pn(t,e=tp.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Ut}=tp.default,ep;pn("no-color")||pn("no-colors")||pn("color=false")||pn("color=never")?ep=0:(pn("color")||pn("colors")||pn("color=true")||pn("color=always"))&&(ep=1);function eK(){if("FORCE_COLOR"in Ut)return Ut.FORCE_COLOR==="true"?1:Ut.FORCE_COLOR==="false"?0:Ut.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ut.FORCE_COLOR,10),3)}function tK(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function rK(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=eK();n!==void 0&&(ep=n);let i=r?ep:n;if(i===0)return 0;if(r){if(pn("color=16m")||pn("color=full")||pn("color=truecolor"))return 3;if(pn("color=256"))return 2}if(t&&!e&&i===void 0)return 0;let o=i||0;if(Ut.TERM==="dumb")return o;if(tp.default.platform==="win32"){let a=aP.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ut)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Ut)||Ut.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Ut)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ut.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in Ut&&"AGENT_NAME"in Ut)return 1;if(Ut.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ut){let a=Number.parseInt((Ut.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ut.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ut.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ut.TERM)||"COLORTERM"in Ut?1:o}function oP(t,e={}){let r=rK(t,{streamIsTTY:t&&t.isTTY,...e});return tK(r)}var nK={stdout:oP({isTTY:U_.default.isatty(1)}),stderr:oP({isTTY:U_.default.isatty(2)})},sP=nK;function uP(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,o=0,a="";do a+=t.slice(o,n)+e+r,o=n+i,n=t.indexOf(e,o);while(n!==-1);return a+=t.slice(o),a}function lP(t,e,r,n){let i=0,o="";do{let a=t[n-1]==="\r";o+=t.slice(i,a?n-1:n)+e+(a?`\r
6467
+ `,e),process.exit(1)}))}track(e,r={}){if(this.mixpanel){let n=Rl({distinct_id:this.hostId,session:this.sessionid,time:new Date,$os:this._os,nodeVersion:process.version,version:this.version},r);this.mixpanel.track(e,n)}}trackSpan(e,r,n,i,o){return wt(this,null,function*(){this.track(e,i);let a=Date.now(),s=!0;try{yield Promise.resolve(o())}catch(u){throw this.track(n,Rl({message:u.message,stack:u.stack},i)),s=!1,u}finally{this.track(r,Rl({duration:Date.now()-a,success:s},i))}})}},ms=new P_;var QD=te(Sk()),Vi=te(Al()),bi=te(require("fs")),eN=te(Nk()),Ai=te(require("path")),IT=te($n());var O_=["sqlite","postgresql","mysql","sqlserver","cockroachdb"],Ok=["String","Int","Float","Decimal","BigInt","Boolean","Bytes","DateTime"],_o="stdlib.zmodel";var Jd=te(t_()),Et=te(go()),Kk=te(Xe()),zk=te(_c());var jk=te(go());var $k=te(Wn());var Kn=te(Wn());function To(t,e){let r=t.reduce((n,i)=>{var o;return n[i.name]=(o=n[i.name])!=null?o:[],n[i.name].push(i),n},{});for(let[n,i]of Object.entries(r))i.length>1&&e("error",`Duplicated declaration name "${n}"`,{node:i[1]})}function Wd(t){if((0,Kn.isLiteralExpr)(t)&&typeof t.value=="string")return t.value}function B3(t,e){switch(t){case"Any":return!0;case"Float":return e==="Any"||e==="Int"||e==="Float";default:return e==="Any"||e===t}}function I_(t){switch(t){case"Any":case"Boolean":case"String":case"DateTime":case"Int":case"Float":case"Null":return t;case"BigInt":return"Int";case"Decimal":return"Float";case"Json":case"Bytes":return"Any"}}function Ik(t,e,r){var s,u;let n=t.$resolvedType;if(!n)return!1;let i=e.type.type,o=e.type.array,a=e.type.reference;if(i){if(typeof(n==null?void 0:n.decl)!="string")return!1;if(i==="FieldReference")return o?(0,Kn.isArrayExpr)(t.value)&&!t.value.items.find(l=>!(0,Kn.isReferenceExpr)(l)||!(0,Kn.isDataModelField)(l.target.ref)):(0,Kn.isReferenceExpr)(t.value)&&(0,Kn.isDataModelField)(t.value.target.ref);if(i==="ContextType")if((0,Kn.isDataModelField)(r.$container)){if(!((u=(s=r.$container)==null?void 0:s.type)!=null&&u.type))return!1;i=I_(r.$container.type.type)}else i="Any";return B3(i,n.decl)&&o===n.array}else return(a==null?void 0:a.ref)===n.decl&&o===n.array}var Yu=class{validate(e,r){var n;To(e.declarations,r),(n=e.$document)!=null&&n.uri.path.endsWith(_o)||this.validateDataSources(e,r)}validateDataSources(e,r){let n=e.declarations.filter(i=>(0,$k.isDataSource)(i));n.length===0?r("error","Model must define a datasource",{node:e}):n.length>1&&r("error","Multiple datasource declarations are not allowed",{node:n[1]})}};var Mk=te(Wn());var W3=["provider","url","shadowDatabaseUrl","relationMode"],Xu=class{validate(e,r){To(e.fields,r),this.validateFields(e,r),this.validateProvider(e,r),this.validateUrl(e,r),this.validateRelationMode(e,r)}validateFields(e,r){e.fields.forEach(n=>{W3.includes(n.name)||r("error",`Unexpected field "${n.name}"`,{node:n})})}validateProvider(e,r){let n=e.fields.find(o=>o.name==="provider");if(!n){r("error",'datasource must include a "provider" field',{node:e});return}let i=Wd(n.value);i?O_.includes(i)||r("error",`Provider "${i}" is not supported. Choose from ${O_.map(o=>'"'+o+'"').join(" | ")}.`,{node:n.value}):r("error",'"provider" must be set to a string literal',{node:n.value})}validateUrl(e,r){var i;e.fields.find(o=>o.name==="url")||r("error",'datasource must include a "url" field',{node:e});for(let o of["url","shadowDatabaseUrl"]){let a=e.fields.find(u=>u.name===o);if(!a)continue;!Wd(a.value)&&!((0,Mk.isInvocationExpr)(a.value)&&((i=a.value.function.ref)==null?void 0:i.name)==="env")&&r("error",`"${o}" must be set to a string literal or an invocation of "env" function`,{node:a.value})}}validateRelationMode(e,r){let n=e.fields.find(i=>i.name==="relationMode");if(n){let i=Wd(n.value);(!i||!["foreignKeys","prisma"].includes(i))&&r("error",'"relationMode" must be set to "foreignKeys" or "prisma"',{node:n.value})}}};var Ki=te(Wn());var Fk=te(Lk()),Zu=class{validate(e,r){To(e.fields,r),this.validateFields(e,r),this.validateAttributes(e,r)}validateFields(e,r){let n=e.fields.filter(i=>i.attributes.find(o=>{var a;return((a=o.decl.ref)==null?void 0:a.name)==="@id"}));n.length===0?r("error","Model must include a field with @id attribute",{node:e}):n.length>1?r("error","Model can include at most one field with @id attribute",{node:e}):(n[0].type.optional&&r("error","Field with @id attribute must not be optional",{node:n[0]}),(n[0].type.array||!n[0].type.type||!Ok.includes(n[0].type.type))&&r("error","Field with @id attribute must be of scalar type",{node:n[0]})),e.fields.forEach(i=>this.validateField(i,r))}validateField(e,r){var n;e.type.array&&e.type.optional&&r("error","Optional lists are not supported. Use either `Type[]` or `Type?`",{node:e.type}),e.attributes.forEach(i=>this.validateAttributeApplication(i,r)),(0,Ki.isDataModel)((n=e.type.reference)==null?void 0:n.ref)&&this.validateRelationField(e,r)}validateAttributes(e,r){e.attributes.forEach(n=>{this.validateAttributeApplication(n,r)})}validateAttributeApplication(e,r){let n=e.decl.ref;if(!n)return;let i=e.$container;if(n.name==="@@@targetField"&&!(0,Ki.isAttribute)(i)){r("error",`attribute "${n.name}" can only be used on attribute declarations`,{node:e});return}(0,Ki.isDataModelField)(i)&&!this.isValidAttributeTarget(n,i)&&r("error",`attribute "${n.name}" cannot be used on this type of field`,{node:e});let o=new Set;for(let s of e.args){let u;if(s.name){if(u=n.params.find(l=>l.name===s.name),!u)return r("error",`Attribute "${n.name}" doesn't have a parameter named "${s.name}"`,{node:s}),!1}else if(u=n.params.find(l=>l.default&&!o.has(l)),!u)return r("error","Unexpected unnamed argument",{node:s}),!1;if(!Ik(s,u,e))return r("error","Value is not assignable to parameter",{node:s}),!1;if(o.has(u))return r("error",`Parameter "${u.name}" is already provided`,{node:s}),!1;o.add(u),s.$resolvedParam=u}let a=n.params.filter(s=>!s.type.optional&&!o.has(s));return a.length>0?(r("error",`Required ${(0,Fk.default)("parameter",a.length)} not provided: ${a.map(s=>s.name).join(", ")}`,{node:e}),!1):!0}isValidAttributeTarget(e,r){var a;let n=e.attributes.find(s=>{var u;return((u=s.decl.ref)==null?void 0:u.name)==="@@@targetField"});if(!n)return!0;let i=n.args[0].value.items.map(s=>{var u;return(u=s.target.ref)==null?void 0:u.name}),o=!1;for(let s of i){switch(s){case"StringField":o=o||r.type.type==="String";break;case"IntField":o=o||r.type.type==="Int";break;case"FloatField":o=o||r.type.type==="Float";break;case"DecimalField":o=o||r.type.type==="Decimal";break;case"BooleanField":o=o||r.type.type==="Boolean";break;case"DateTimeField":o=o||r.type.type==="DateTime";break;case"JsonField":o=o||r.type.type==="Json";break;case"BytesField":o=o||r.type.type==="Bytes";break;case"ModelField":o=o||(0,Ki.isDataModel)((a=r.type.reference)==null?void 0:a.ref);break;default:break}if(o)break}return o}parseRelation(e,r){let n=e.attributes.find(u=>{var l;return((l=u.decl.ref)==null?void 0:l.name)==="@relation"}),i,o,a,s=!0;if(!n)return{attr:n,name:i,fields:o,references:a,valid:!0};for(let u of n.args)!u.name||u.name==="name"?(0,Ki.isLiteralExpr)(u.value)&&(i=u.value.value):u.name==="fields"?(o=u.value.items,o.length===0&&(r&&r("error",'"fields" value cannot be emtpy',{node:u}),s=!1)):u.name==="references"&&(a=u.value.items,a.length===0&&(r&&r("error",'"references" value cannot be emtpy',{node:u}),s=!1));return{attr:n,name:i,fields:o,references:a,valid:s}}validateRelationField(e,r){var l,c,f,p,h;let n=this.parseRelation(e,r);if(!n.valid)return;let i=e.type.reference.ref,o=i.fields.filter(d=>{var g;return((g=d.type.reference)==null?void 0:g.ref)===e.$container});if(o=o.filter(d=>{let g=this.parseRelation(d);return g.valid&&g.name===n.name}),o.length===0){r("error",`The relation field "${e.name}" on model "${e.$container.name}" is missing an opposite relation field on model "${i.name}"`,{node:e});return}else if(o.length>1){o.forEach(d=>r("error",`Fields ${o.map(g=>'"'+g.name+'"').join(", ")} on model "${i.name}" refer to the same relation to model "${e.$container.name}"`,{node:d}));return}let a=o[0],s=this.parseRelation(a),u;if(((l=n==null?void 0:n.references)==null?void 0:l.length)&&((c=n.fields)==null?void 0:c.length))if((s==null?void 0:s.references)||(s==null?void 0:s.fields)){r("error",'"fields" and "references" must be provided only on one side of relation field',{node:a});return}else u=a;else if(((f=s==null?void 0:s.references)==null?void 0:f.length)&&((p=s.fields)==null?void 0:p.length))if((n==null?void 0:n.references)||(n==null?void 0:n.fields)){r("error",'"fields" and "references" must be provided only on one side of relation field',{node:e});return}else u=e;else{[e,a].forEach(d=>r("error",'Field for one side of relation must carry @relation attribute with both "fields" and "references" fields',{node:d}));return}if(!u.type.array&&!u.type.optional){r("error","Relation field needs to be list or optional",{node:u});return}u!==e&&!u.type.array&&((h=n.fields)==null||h.forEach(d=>{let g=d.target.ref;g&&!g.attributes.find(C=>{var x;return((x=C.decl.ref)==null?void 0:x.name)==="@unique"})&&r("error",`Field "${g.name}" is part of a one-to-one relation and must be marked as @unique`,{node:g})}))}};var Ju=class{validate(e,r){}};var Qu=class{validate(e,r){To(e.fields,r)}};var Vd=te(Wn());var qk=te(Wn());function Kd(t){return t?(0,qk.isModel)(t)?t:Kd(t.$container):null}function zd(t){var r;let e=Kd(t);return e&&((r=e.$document)==null?void 0:r.uri.path.endsWith(_o))}var el=class{validate(e,r){e.$resolvedType||(this.isAuthInvocation(e)?r("error",'auth() cannot be resolved because no "User" model is defined',{node:e}):this.isCollectionPredicate(e)?r("error","collection predicate can only be used on an array of model type",{node:e}):r("error","expression cannot be resolved",{node:e}))}isCollectionPredicate(e){return(0,Vd.isBinaryExpr)(e)&&["?","!","^"].includes(e.operator)}isAuthInvocation(e){var r;return(0,Vd.isInvocationExpr)(e)&&((r=e.function.ref)==null?void 0:r.name)==="auth"&&zd(e.function.ref)}};var Yd=class extends jk.ValidationRegistry{constructor(e){super(e);let r=e.validation.ZModelValidator,n={Model:r.checkModel,DataSource:r.checkDataSource,DataModel:r.checkDataModel,Enum:r.checkEnum,Attribute:r.checkAttribute,Expression:r.checkExpression};this.register(n,r)}},Xd=class{shouldCheck(e){let r,n=e;for(;n;){if(n.$document){r=n.$document;break}n=n.$container}return(r==null?void 0:r.parseResult.lexerErrors.length)===0&&(r==null?void 0:r.parseResult.parserErrors.length)===0}checkModel(e,r){this.shouldCheck(e)&&new Yu().validate(e,r)}checkDataSource(e,r){this.shouldCheck(e)&&new Xu().validate(e,r)}checkDataModel(e,r){this.shouldCheck(e)&&new Zu().validate(e,r)}checkEnum(e,r){this.shouldCheck(e)&&new Qu().validate(e,r)}checkAttribute(e,r){this.shouldCheck(e)&&new Ju().validate(e,r)}checkExpression(e,r){new el().validate(e,r)}};var zn=te(go()),Gk=te(ti()),ft=te(Wn());var Zd=class extends zn.DefaultLinker{constructor(r){super(r);this.descriptions=r.workspace.AstNodeDescriptionProvider}link(i){return wt(this,arguments,function*(r,n=Gk.CancellationToken.None){var o,a;if(!(((o=r.parseResult.lexerErrors)==null?void 0:o.length)>0||((a=r.parseResult.parserErrors)==null?void 0:a.length)>0)){for(let s of(0,zn.streamContents)(r.parseResult.value))yield(0,zn.interruptAndCheck)(n),this.resolve(s,r);r.state=zn.DocumentState.Linked}})}linkReference(r,n,i,o){if(!this.resolveFromScopeProviders(r,n,i,o)){let a=r[n];this.doLink({reference:a,container:r,property:n},i)}}resolveFromScopeProviders(r,n,i,o){let a=r[n];for(let s of o){let u=s(a.$refText);if(u)return a._ref=u,a._nodeDescription=this.descriptions.createDescription(u,u.name,i),u}return null}resolve(r,n,i=[]){switch(r.$type){case ft.LiteralExpr:this.resolveLiteral(r);break;case ft.InvocationExpr:this.resolveInvocation(r,n,i);break;case ft.ArrayExpr:this.resolveArray(r,n,i);break;case ft.ReferenceExpr:this.resolveReference(r,n,i);break;case ft.MemberAccessExpr:this.resolveMemberAccess(r,n,i);break;case ft.UnaryExpr:this.resolveUnary(r,n,i);break;case ft.BinaryExpr:this.resolveBinary(r,n,i);break;case ft.ThisExpr:this.resolveThis(r,n,i);break;case ft.NullExpr:this.resolveNull(r,n,i);break;case"AttributeArg":this.resolveAttributeArg(r,n,i);break;default:this.resolveDefault(r,n,i);break}}resolveBinary(r,n,i){switch(r.operator){case">":case">=":case"<":case"<=":case"==":case"!=":case"&&":case"||":this.resolve(r.left,n,i),this.resolve(r.right,n,i),this.resolveToBuiltinTypeOrDecl(r,"Boolean");break;case"?":case"!":case"^":this.resolveCollectionPredicate(r,n,i);break;default:throw Error(`Unsupported binary operator: ${r.operator}`)}}resolveUnary(r,n,i){this.resolve(r.operand,n,i),r.$resolvedType=r.operand.$resolvedType}resolveReference(r,n,i){this.linkReference(r,"target",n,i),r.args.forEach(o=>this.resolve(o,n,i)),r.target.ref&&(r.target.ref.$type===ft.EnumField?this.resolveToBuiltinTypeOrDecl(r,r.target.ref.$container):this.resolveToDeclaredType(r,r.target.ref.type))}resolveArray(r,n,i){r.items.forEach(a=>this.resolve(a,n,i));let o=r.items[0].$resolvedType;o!=null&&o.decl&&this.resolveToBuiltinTypeOrDecl(r,o.decl,!0)}resolveInvocation(r,n,i){if(this.linkReference(r,"function",n,i),r.args.forEach(o=>this.resolve(o,n,i)),r.function.ref){let o=r.function.ref;if(o.name==="auth"&&zd(o)){let a=Kd(r),s=a==null?void 0:a.declarations.find(u=>(0,ft.isDataModel)(u)&&u.name==="User");s&&(r.$resolvedType={decl:s})}else this.resolveToDeclaredType(r,o.returnType)}}resolveLiteral(r){let n=typeof r.value=="string"?"String":typeof r.value=="boolean"?"Boolean":typeof r.value=="number"?"Int":void 0;n&&this.resolveToBuiltinTypeOrDecl(r,n)}resolveMemberAccess(r,n,i){this.resolve(r.operand,n,i);let o=r.operand.$resolvedType;if(o&&!o.array&&(0,ft.isDataModel)(o.decl)){let a=o.decl;i=[u=>a.fields.find(l=>l.name===u),...i]}this.linkReference(r,"member",n,i),r.member.ref&&this.resolveToDeclaredType(r,r.member.ref.type)}resolveCollectionPredicate(r,n,i){this.resolve(r.left,n,i);let o=r.left.$resolvedType;if(o&&(0,ft.isDataModel)(o.decl)&&o.array){let a=o.decl;i=[u=>a.fields.find(l=>l.name===u),...i],this.resolve(r.right,n,i),this.resolveToBuiltinTypeOrDecl(r,"Boolean")}}resolveThis(r,n,i){let o=r.$container;for(;o&&!(0,ft.isDataModel)(o);)o=o.$container;o&&this.resolveToBuiltinTypeOrDecl(r,o)}resolveNull(r,n,i){this.resolveToBuiltinTypeOrDecl(r,"Null")}resolveAttributeArg(r,n,i){this.resolve(r.value,n,i),r.$resolvedType=r.value.$resolvedType}resolveDefault(r,n,i){for(let[o,a]of Object.entries(r))o.startsWith("$")||(0,zn.isReference)(a)&&this.linkReference(r,o,n,i);for(let o of(0,zn.streamContents)(r))this.resolve(o,n,i)}resolveToDeclaredType(r,n){if(n.type){let i=I_(n.type);r.$resolvedType={decl:i,array:n.array}}else n.reference&&(r.$resolvedType={decl:n.reference.ref,array:n.array})}resolveToBuiltinTypeOrDecl(r,n,i=!1){r.$resolvedType={decl:n,array:i}}};var Uk=te(Wn()),ys=te(go());var gs=class extends ys.DefaultScopeComputation{constructor(r){super(r);this.services=r}computeExports(r,n){return wt(this,null,function*(){let i=yield bl(gs.prototype,this,"computeExports").call(this,r,n);for(let o of(0,ys.streamAllContents)(r.parseResult.value))if(n&&(yield(0,ys.interruptAndCheck)(n)),(0,Uk.isEnumField)(o)){let a=this.services.workspace.AstNodeDescriptionProvider.createDescription(o,o.name,r);i.push(a)}return i})}};var Hk=te(go()),Bk=te(require("path")),Wk=te($n());var ta=class extends Hk.DefaultWorkspaceManager{loadAdditionalDocuments(e,r){return wt(this,null,function*(){yield bl(ta.prototype,this,"loadAdditionalDocuments").call(this,e,r);let n=Wk.URI.file(Bk.default.join(__dirname,"../res",_o));console.log(`Adding stdlib document from ${n}`);let i=this.langiumDocuments.getOrCreateDocument(n);r(i)})}};var K3={references:{ScopeComputation:t=>new gs(t),Linker:t=>new Zd(t)},validation:{ValidationRegistry:t=>new Yd(t),ZModelValidator:()=>new Xd}};function z3(t){return{ServiceRegistry:()=>new Et.DefaultServiceRegistry,lsp:{Connection:()=>t.connection,LanguageServer:e=>new Et.DefaultLanguageServer(e)},workspace:{LangiumDocuments:e=>new Et.DefaultLangiumDocuments(e),LangiumDocumentFactory:e=>new Et.DefaultLangiumDocumentFactory(e),DocumentBuilder:e=>new Et.DefaultDocumentBuilder(e),TextDocuments:()=>new Kk.TextDocuments(zk.TextDocument),TextDocumentFactory:e=>new Et.DefaultTextDocumentFactory(e),IndexManager:e=>new Et.DefaultIndexManager(e),WorkspaceManager:e=>new ta(e),FileSystemProvider:e=>t.fileSystemProvider(e),MutexLock:()=>new Et.MutexLock,ConfigurationProvider:e=>new Et.DefaultConfigurationProvider(e)}}}function Vk(t){let e=(0,Et.inject)(z3(t),Jd.ZModelGeneratedSharedModule),r=(0,Et.inject)((0,Et.createDefaultModule)({shared:e}),Jd.ZModelGeneratedModule,K3);return e.ServiceRegistry.register(r),{shared:e,ZModel:r}}var L_=te(require("fs")),F_=te(require("path"));var Yk=require("child_process");function Qd(t){(0,Yk.execSync)(t,{encoding:"utf-8",stdio:"inherit"})}function V3(t="."){return L_.default.existsSync(F_.default.join(t,"yarn.lock"))?"yarn":L_.default.existsSync(F_.default.join(t,"pnpm-lock.yaml"))?"pnpm":"npm"}function q_(t,e,r=void 0,n="."){let i=r!=null?r:V3(n);switch(console.log(`Installing package "${t}" with ${i}`),i){case"yarn":Qd(`yarn --cwd "${n}" add ${t} ${e?" --dev":""} --ignore-engines`);break;case"pnpm":Qd(`pnpm add -C "${n}" ${e?" --save-dev":""} ${t}`);break;default:Qd(`npm install --prefix "${n}" ${e?" --save-dev":""} ${t}`);break}}var XD=te(Wn()),Dp=te(Qk()),Ss=te(Al());var yl=te(require("node:process"),1);var eP=(t=0)=>e=>`\x1B[${e+t}m`,tP=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,rP=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,yt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nP=Object.keys(yt.modifier),j_=Object.keys(yt.color),G_=Object.keys(yt.bgColor),iP=[...j_,...G_];function Z3(){let t=new Map;for(let[e,r]of Object.entries(yt)){for(let[n,i]of Object.entries(r))yt[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=yt[n],t.set(i[0],i[1]);Object.defineProperty(yt,e,{value:r,enumerable:!1})}return Object.defineProperty(yt,"codes",{value:t,enumerable:!1}),yt.color.close="\x1B[39m",yt.bgColor.close="\x1B[49m",yt.color.ansi=eP(),yt.color.ansi256=tP(),yt.color.ansi16m=rP(),yt.bgColor.ansi=eP(10),yt.bgColor.ansi256=tP(10),yt.bgColor.ansi16m=rP(10),Object.defineProperties(yt,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>yt.rgbToAnsi256(...yt.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let s=e%36;r=Math.floor(e/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>yt.ansi256ToAnsi(yt.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>yt.ansi256ToAnsi(yt.hexToAnsi256(e)),enumerable:!1}}),yt}var J3=Z3(),Vn=J3;var tp=te(require("node:process"),1),aP=te(require("node:os"),1),U_=te(require("node:tty"),1);function pn(t,e=tp.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Ut}=tp.default,ep;pn("no-color")||pn("no-colors")||pn("color=false")||pn("color=never")?ep=0:(pn("color")||pn("colors")||pn("color=true")||pn("color=always"))&&(ep=1);function Q3(){if("FORCE_COLOR"in Ut)return Ut.FORCE_COLOR==="true"?1:Ut.FORCE_COLOR==="false"?0:Ut.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ut.FORCE_COLOR,10),3)}function eK(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function tK(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=Q3();n!==void 0&&(ep=n);let i=r?ep:n;if(i===0)return 0;if(r){if(pn("color=16m")||pn("color=full")||pn("color=truecolor"))return 3;if(pn("color=256"))return 2}if(t&&!e&&i===void 0)return 0;let o=i||0;if(Ut.TERM==="dumb")return o;if(tp.default.platform==="win32"){let a=aP.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ut)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Ut)||Ut.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Ut)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ut.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in Ut&&"AGENT_NAME"in Ut)return 1;if(Ut.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ut){let a=Number.parseInt((Ut.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ut.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ut.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ut.TERM)||"COLORTERM"in Ut?1:o}function oP(t,e={}){let r=tK(t,{streamIsTTY:t&&t.isTTY,...e});return eK(r)}var rK={stdout:oP({isTTY:U_.default.isatty(1)}),stderr:oP({isTTY:U_.default.isatty(2)})},sP=rK;function uP(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,o=0,a="";do a+=t.slice(o,n)+e+r,o=n+i,n=t.indexOf(e,o);while(n!==-1);return a+=t.slice(o),a}function lP(t,e,r,n){let i=0,o="";do{let a=t[n-1]==="\r";o+=t.slice(i,a?n-1:n)+e+(a?`\r
6468
6468
  `:`
6469
6469
  `)+r,i=n+1,n=t.indexOf(`
6470
- `,i)}while(n!==-1);return o+=t.slice(i),o}var{stdout:cP,stderr:fP}=sP,H_=Symbol("GENERATOR"),vs=Symbol("STYLER"),tl=Symbol("IS_EMPTY"),dP=["ansi","ansi","ansi256","ansi16m"],_s=Object.create(null),iK=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=cP?cP.level:0;t.level=e.level===void 0?r:e.level};var oK=t=>{let e=(...r)=>r.join(" ");return iK(e,t),Object.setPrototypeOf(e,rl.prototype),e};function rl(t){return oK(t)}Object.setPrototypeOf(rl.prototype,Function.prototype);for(let[t,e]of Object.entries(Vn))_s[t]={get(){let r=rp(this,W_(e.open,e.close,this[vs]),this[tl]);return Object.defineProperty(this,t,{value:r}),r}};_s.visible={get(){let t=rp(this,this[vs],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var B_=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?Vn[r].ansi16m(...n):e==="ansi256"?Vn[r].ansi256(Vn.rgbToAnsi256(...n)):Vn[r].ansi(Vn.rgbToAnsi(...n)):t==="hex"?B_("rgb",e,r,...Vn.hexToRgb(...n)):Vn[r][t](...n),aK=["rgb","hex","ansi256"];for(let t of aK){_s[t]={get(){let{level:r}=this;return function(...n){let i=W_(B_(t,dP[r],"color",...n),Vn.color.close,this[vs]);return rp(this,i,this[tl])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);_s[e]={get(){let{level:r}=this;return function(...n){let i=W_(B_(t,dP[r],"bgColor",...n),Vn.bgColor.close,this[vs]);return rp(this,i,this[tl])}}}}var sK=Object.defineProperties(()=>{},{..._s,level:{enumerable:!0,get(){return this[H_].level},set(t){this[H_].level=t}}}),W_=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},rp=(t,e,r)=>{let n=(...i)=>uK(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,sK),n[H_]=t,n[vs]=e,n[tl]=r,n},uK=(t,e)=>{if(t.level<=0||!e)return t[tl]?"":e;let r=t[vs];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=uP(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
6471
- `);return o!==-1&&(e=lP(e,i,n,o)),n+e+i};Object.defineProperties(rl.prototype,_s);var lK=rl(),sY=rl({level:fP?fP.level:0});var Yn=lK;var Y_=te(require("node:process"),1);var AP=te(require("node:process"),1),EP=te(gP(),1),CP=te(bP(),1),fK=(0,EP.default)(()=>{(0,CP.default)(()=>{AP.default.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),xP=fK;var lp=!1,As={};As.show=(t=Y_.default.stderr)=>{!t.isTTY||(lp=!1,t.write("\x1B[?25h"))};As.hide=(t=Y_.default.stderr)=>{!t.isTTY||(xP(),lp=!0,t.write("\x1B[?25l"))};As.toggle=(t,e)=>{t!==void 0&&(lp=t),lp?As.show(e):As.hide(e)};var X_=As;var vl=te(PP(),1);var hn=te(require("node:process"),1);function il(){return hn.default.platform!=="win32"?hn.default.env.TERM!=="linux":Boolean(hn.default.env.CI)||Boolean(hn.default.env.WT_SESSION)||Boolean(hn.default.env.TERMINUS_SUBLIME)||hn.default.env.ConEmuTask==="{cmd::Cmder}"||hn.default.env.TERM_PROGRAM==="Terminus-Sublime"||hn.default.env.TERM_PROGRAM==="vscode"||hn.default.env.TERM==="xterm-256color"||hn.default.env.TERM==="alacritty"||hn.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var pK={info:Yn.blue("\u2139"),success:Yn.green("\u2714"),warning:Yn.yellow("\u26A0"),error:Yn.red("\u2716")},hK={info:Yn.blue("i"),success:Yn.green("\u221A"),warning:Yn.yellow("\u203C"),error:Yn.red("\xD7")},mK=il()?pK:hK,ol=mK;function Z_({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function J_(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Z_(),"")}var YD=te(qP(),1);function eT({stream:t=process.stdout}={}){return Boolean(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var yn=te(require("node:process"),1),zD=te(require("node:readline"),1),VD=te(KD(),1),bV=3,Sp=class{#r=0;#c=new VD.BufferListStream;#i;#n;constructor(){this.#c.pipe(yn.default.stdout);let e=this;this.#i=function(r,n,...i){let{stdin:o}=yn.default;if(e.#r>0||o.emit===e.#i){if(r==="keypress")return;r==="data"&&n.includes(bV)&&yn.default.emit("SIGINT"),Reflect.apply(e.#i,this,[r,n,...i])}else Reflect.apply(yn.default.stdin.emit,this,[r,n,...i])}}start(){this.#r++,this.#r===1&&this._realStart()}stop(){if(this.#r<=0)throw new Error("`stop` called more times than `start`");this.#r--,this.#r===0&&this._realStop()}_realStart(){yn.default.platform!=="win32"&&(this.#n=zD.default.createInterface({input:yn.default.stdin,output:this.#c}),this.#n.on("SIGINT",()=>{yn.default.listenerCount("SIGINT")===0?yn.default.emit("SIGINT"):(this.#n.close(),yn.default.kill(yn.default.pid,"SIGINT"))}))}_realStop(){yn.default.platform!=="win32"&&(this.#n.close(),this.#n=void 0)}};var kp,NT=class{#r=0;#c=!1;#i=0;#n=0;#e;#a;#t;#f;#d;#s;#u;#l;#p;#o;color;constructor(e){kp||(kp=new Sp),typeof e=="string"&&(e={text:e}),this.#e={color:"cyan",stream:yl.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#e.color,this.spinner=this.#e.spinner,this.#d=this.#e.interval,this.#t=this.#e.stream,this.#s=typeof this.#e.isEnabled=="boolean"?this.#e.isEnabled:eT({stream:this.#t}),this.#u=typeof this.#e.isSilent=="boolean"?this.#e.isSilent:!1,this.text=this.#e.text,this.prefixText=this.#e.prefixText,this.indent=this.#e.indent,yl.default.env.NODE_ENV==="test"&&(this._stream=this.#t,this._isEnabled=this.#s,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(r){this.#r=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#i}}))}get indent(){return this.#l}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#l=e,this.updateLineCount()}get interval(){return this.#d||this.#a.interval||100}get spinner(){return this.#a}set spinner(e){if(this.#n=0,this.#d=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#a=e}else if(!il())this.#a=vl.default.line;else if(e===void 0)this.#a=vl.default.dots;else if(e!=="default"&&vl.default[e])this.#a=vl.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#p}set text(e){this.#p=e||"",this.updateLineCount()}get prefixText(){return this.#o}set prefixText(e){this.#o=e||"",this.updateLineCount()}get isSpinning(){return this.#f!==void 0}getFullPrefixText(e=this.#o,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}updateLineCount(){let e=this.#t.columns||80,r=this.getFullPrefixText(this.#o,"-");this.#i=0;for(let n of J_(" ".repeat(this.#l)+r+"--"+this.#p).split(`
6470
+ `,i)}while(n!==-1);return o+=t.slice(i),o}var{stdout:cP,stderr:fP}=sP,H_=Symbol("GENERATOR"),vs=Symbol("STYLER"),tl=Symbol("IS_EMPTY"),dP=["ansi","ansi","ansi256","ansi16m"],_s=Object.create(null),nK=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=cP?cP.level:0;t.level=e.level===void 0?r:e.level};var iK=t=>{let e=(...r)=>r.join(" ");return nK(e,t),Object.setPrototypeOf(e,rl.prototype),e};function rl(t){return iK(t)}Object.setPrototypeOf(rl.prototype,Function.prototype);for(let[t,e]of Object.entries(Vn))_s[t]={get(){let r=rp(this,W_(e.open,e.close,this[vs]),this[tl]);return Object.defineProperty(this,t,{value:r}),r}};_s.visible={get(){let t=rp(this,this[vs],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var B_=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?Vn[r].ansi16m(...n):e==="ansi256"?Vn[r].ansi256(Vn.rgbToAnsi256(...n)):Vn[r].ansi(Vn.rgbToAnsi(...n)):t==="hex"?B_("rgb",e,r,...Vn.hexToRgb(...n)):Vn[r][t](...n),oK=["rgb","hex","ansi256"];for(let t of oK){_s[t]={get(){let{level:r}=this;return function(...n){let i=W_(B_(t,dP[r],"color",...n),Vn.color.close,this[vs]);return rp(this,i,this[tl])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);_s[e]={get(){let{level:r}=this;return function(...n){let i=W_(B_(t,dP[r],"bgColor",...n),Vn.bgColor.close,this[vs]);return rp(this,i,this[tl])}}}}var aK=Object.defineProperties(()=>{},{..._s,level:{enumerable:!0,get(){return this[H_].level},set(t){this[H_].level=t}}}),W_=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},rp=(t,e,r)=>{let n=(...i)=>sK(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,aK),n[H_]=t,n[vs]=e,n[tl]=r,n},sK=(t,e)=>{if(t.level<=0||!e)return t[tl]?"":e;let r=t[vs];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=uP(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
6471
+ `);return o!==-1&&(e=lP(e,i,n,o)),n+e+i};Object.defineProperties(rl.prototype,_s);var uK=rl(),aY=rl({level:fP?fP.level:0});var Yn=uK;var Y_=te(require("node:process"),1);var AP=te(require("node:process"),1),EP=te(gP(),1),CP=te(bP(),1),cK=(0,EP.default)(()=>{(0,CP.default)(()=>{AP.default.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),xP=cK;var lp=!1,As={};As.show=(t=Y_.default.stderr)=>{!t.isTTY||(lp=!1,t.write("\x1B[?25h"))};As.hide=(t=Y_.default.stderr)=>{!t.isTTY||(xP(),lp=!0,t.write("\x1B[?25l"))};As.toggle=(t,e)=>{t!==void 0&&(lp=t),lp?As.show(e):As.hide(e)};var X_=As;var vl=te(PP(),1);var hn=te(require("node:process"),1);function il(){return hn.default.platform!=="win32"?hn.default.env.TERM!=="linux":Boolean(hn.default.env.CI)||Boolean(hn.default.env.WT_SESSION)||Boolean(hn.default.env.TERMINUS_SUBLIME)||hn.default.env.ConEmuTask==="{cmd::Cmder}"||hn.default.env.TERM_PROGRAM==="Terminus-Sublime"||hn.default.env.TERM_PROGRAM==="vscode"||hn.default.env.TERM==="xterm-256color"||hn.default.env.TERM==="alacritty"||hn.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var dK={info:Yn.blue("\u2139"),success:Yn.green("\u2714"),warning:Yn.yellow("\u26A0"),error:Yn.red("\u2716")},pK={info:Yn.blue("i"),success:Yn.green("\u221A"),warning:Yn.yellow("\u203C"),error:Yn.red("\xD7")},hK=il()?dK:pK,ol=hK;function Z_({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function J_(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Z_(),"")}var YD=te(qP(),1);function eT({stream:t=process.stdout}={}){return Boolean(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var yn=te(require("node:process"),1),zD=te(require("node:readline"),1),VD=te(KD(),1),RV=3,Sp=class{#r=0;#c=new VD.BufferListStream;#i;#n;constructor(){this.#c.pipe(yn.default.stdout);let e=this;this.#i=function(r,n,...i){let{stdin:o}=yn.default;if(e.#r>0||o.emit===e.#i){if(r==="keypress")return;r==="data"&&n.includes(RV)&&yn.default.emit("SIGINT"),Reflect.apply(e.#i,this,[r,n,...i])}else Reflect.apply(yn.default.stdin.emit,this,[r,n,...i])}}start(){this.#r++,this.#r===1&&this._realStart()}stop(){if(this.#r<=0)throw new Error("`stop` called more times than `start`");this.#r--,this.#r===0&&this._realStop()}_realStart(){yn.default.platform!=="win32"&&(this.#n=zD.default.createInterface({input:yn.default.stdin,output:this.#c}),this.#n.on("SIGINT",()=>{yn.default.listenerCount("SIGINT")===0?yn.default.emit("SIGINT"):(this.#n.close(),yn.default.kill(yn.default.pid,"SIGINT"))}))}_realStop(){yn.default.platform!=="win32"&&(this.#n.close(),this.#n=void 0)}};var kp,NT=class{#r=0;#c=!1;#i=0;#n=0;#e;#a;#t;#f;#d;#s;#u;#l;#p;#o;color;constructor(e){kp||(kp=new Sp),typeof e=="string"&&(e={text:e}),this.#e={color:"cyan",stream:yl.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#e.color,this.spinner=this.#e.spinner,this.#d=this.#e.interval,this.#t=this.#e.stream,this.#s=typeof this.#e.isEnabled=="boolean"?this.#e.isEnabled:eT({stream:this.#t}),this.#u=typeof this.#e.isSilent=="boolean"?this.#e.isSilent:!1,this.text=this.#e.text,this.prefixText=this.#e.prefixText,this.indent=this.#e.indent,yl.default.env.NODE_ENV==="test"&&(this._stream=this.#t,this._isEnabled=this.#s,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(r){this.#r=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#i}}))}get indent(){return this.#l}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#l=e,this.updateLineCount()}get interval(){return this.#d||this.#a.interval||100}get spinner(){return this.#a}set spinner(e){if(this.#n=0,this.#d=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#a=e}else if(!il())this.#a=vl.default.line;else if(e===void 0)this.#a=vl.default.dots;else if(e!=="default"&&vl.default[e])this.#a=vl.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#p}set text(e){this.#p=e||"",this.updateLineCount()}get prefixText(){return this.#o}set prefixText(e){this.#o=e||"",this.updateLineCount()}get isSpinning(){return this.#f!==void 0}getFullPrefixText(e=this.#o,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}updateLineCount(){let e=this.#t.columns||80,r=this.getFullPrefixText(this.#o,"-");this.#i=0;for(let n of J_(" ".repeat(this.#l)+r+"--"+this.#p).split(`
6472
6472
  `))this.#i+=Math.max(1,Math.ceil((0,YD.default)(n)/e))}get isEnabled(){return this.#s&&!this.#u}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#s=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let{frames:e}=this.#a,r=e[this.#n];this.color&&(r=Yn[this.color](r)),this.#n=++this.#n%e.length;let n=typeof this.#o=="string"&&this.#o!==""?this.#o+" ":"",i=typeof this.text=="string"?" "+this.text:"";return n+r+i}clear(){if(!this.#s||!this.#t.isTTY)return this;this.#t.cursorTo(0);for(let e=0;e<this.#r;e++)e>0&&this.#t.moveCursor(0,-1),this.#t.clearLine(1);return(this.#l||this.lastIndent!==this.#l)&&this.#t.cursorTo(this.#l),this.lastIndent=this.#l,this.#r=0,this}render(){return this.#u?this:(this.clear(),this.#t.write(this.frame()),this.#r=this.#i,this)}start(e){return e&&(this.text=e),this.#u?this:this.#s?this.isSpinning?this:(this.#e.hideCursor&&X_.hide(this.#t),this.#e.discardStdin&&yl.default.stdin.isTTY&&(this.#c=!0,kp.start()),this.render(),this.#f=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#t.write(`- ${this.text}
6473
6473
  `),this)}stop(){return this.#s?(clearInterval(this.#f),this.#f=void 0,this.#n=0,this.clear(),this.#e.hideCursor&&X_.show(this.#t),this.#e.discardStdin&&yl.default.stdin.isTTY&&this.#c&&(kp.stop(),this.#c=!1),this):this}succeed(e){return this.stopAndPersist({symbol:ol.success,text:e})}fail(e){return this.stopAndPersist({symbol:ol.error,text:e})}warn(e){return this.stopAndPersist({symbol:ol.warning,text:e})}info(e){return this.stopAndPersist({symbol:ol.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let r=e.prefixText||this.#o,n=e.text||this.text,i=typeof n=="string"?" "+n:"";return this.stop(),this.#t.write(`${this.getFullPrefixText(r," ")}${e.symbol||" "}${i}
6474
- `),this}};function OT(t){return new NT(t)}var ZD=require("@prisma/internals"),JD=te(require("fs")),QD=te(require("path"));var Pp=class{run(e){return wt(this,null,function*(){var f;let r=Hd().version;console.log(Ss.default.bold(`\u231B\uFE0F ZenStack CLI v${r}, running plugins`));let n=[],i=e.schema.declarations.filter(p=>(0,XD.isPlugin)(p));for(let p of i){let h={};if(p.fields.forEach(x=>{let T=(0,Dp.getLiteral)(x.value)||(0,Dp.getLiteralArray)(x.value);if(!T)throw new Dr(`Invalid plugin value for ${x.name}`);h[x.name]=T}),!h.provider)throw new Dr(`Plugin ${p.name} doesn't have a provider specified`);let d=h.provider;if(d.startsWith("zenstack/plugin/")){let x=QD.default.resolve(__dirname,"../plugins/");d=d.replace(/^zenstack\/plugin/,x)}let g;try{console.log("Loading plugin from:",d),g=require(h.provider)}catch(x){throw console.error(`Unable to load plugin module ${h.provider}`),new Dr(`Unable to load plugin module ${h.provider}`)}if(!g.default||typeof g.default!="function")throw console.error(`Plugin provider ${h.provider} is missing a default function export`),new Dr(`Plugin provider ${h.provider} is missing a default function export`);let C=typeof g.name=="string"?g.name:h.provider;n.push({name:C,provider:h.provider,run:g.default,options:h})}let o="zenstack/plugins/prisma",a=n.find(p=>p.provider===o);a||(a={name:"prisma",provider:o,run:require(o).default,options:{}});let s=[],u=yield a.run(e.schema,a.options);Array.isArray(u)&&s.push(...u);let l=(f=a.options.output)!=null?f:"prisma/schema.prisma",c=yield(0,ZD.getDMMF)({datamodel:JD.default.readFileSync(l,{encoding:"utf-8"})});for(let{name:p,run:h,options:d}of n.filter(g=>g!==a)){let g=OT(`Running plugin ${Ss.default.cyan(p)}`).start();yield ms.trackSpan("cli:plugin:start","cli:plugin:complete","cli:plugin:error",{plugin:p},()=>wt(this,null,function*(){let C=h(e.schema,d,c);C instanceof Promise&&(C=yield C),Array.isArray(C)&&s.push(...C)})),g.succeed()}console.log(Ss.default.green(Ss.default.bold(`
6475
- \u{1F47B} All plugins completed successfully!`))),s.forEach(p=>console.warn(Ss.default.yellow(p)))})}};function rN(t,e){return wt(this,null,function*(){if(!bi.default.existsSync(t))throw console.error(`Path does not exist: ${t}`),new Dr("project path does not exist");let r=Ai.default.join(t,"zenstack","schema.zmodel"),n=!1;if(bi.default.existsSync(r))console.warn(Vi.default.yellow(`Model already exists: ${r}`));else{bi.default.existsSync(Ai.default.join(t,"zenstack"))||bi.default.mkdirSync(Ai.default.join(t,"zenstack")),bi.default.writeFileSync(r,`// This is a sample model to get you started.
6474
+ `),this}};function OT(t){return new NT(t)}var ZD=require("@prisma/internals"),JD=te(require("fs"));var Pp=class{run(e){return wt(this,null,function*(){var f;let r=Hd().version;console.log(Ss.default.bold(`\u231B\uFE0F ZenStack CLI v${r}, running plugins`));let n=[],i=e.schema.declarations.filter(p=>(0,XD.isPlugin)(p));for(let p of i){let h={};if(p.fields.forEach(C=>{let x=(0,Dp.getLiteral)(C.value)||(0,Dp.getLiteralArray)(C.value);if(!x)throw new Dr(`Invalid plugin value for ${C.name}`);h[C.name]=x}),!h.provider)throw new Dr(`Plugin ${p.name} doesn't have a provider specified`);let d;try{d=require(h.provider)}catch(C){throw console.error(`Unable to load plugin module ${h.provider}`),new Dr(`Unable to load plugin module ${h.provider}`)}if(!d.default||typeof d.default!="function")throw console.error(`Plugin provider ${h.provider} is missing a default function export`),new Dr(`Plugin provider ${h.provider} is missing a default function export`);let g=typeof d.name=="string"?d.name:h.provider;n.push({name:g,provider:h.provider,run:d.default,options:h})}let o="zenstack/plugins/prisma",a=n.find(p=>p.provider===o);a||(a={name:"prisma",provider:o,run:require(o).default,options:{}});let s=[],u=yield a.run(e.schema,a.options);Array.isArray(u)&&s.push(...u);let l=(f=a.options.output)!=null?f:"prisma/schema.prisma",c=yield(0,ZD.getDMMF)({datamodel:JD.default.readFileSync(l,{encoding:"utf-8"})});for(let{name:p,run:h,options:d}of n.filter(g=>g!==a)){let g=OT(`Running plugin ${Ss.default.cyan(p)}`).start();yield ms.trackSpan("cli:plugin:start","cli:plugin:complete","cli:plugin:error",{plugin:p},()=>wt(this,null,function*(){let C=h(e.schema,d,c);C instanceof Promise&&(C=yield C),Array.isArray(C)&&s.push(...C)})),g.succeed()}console.log(Ss.default.green(Ss.default.bold(`
6475
+ \u{1F47B} All plugins completed successfully!`))),s.forEach(p=>console.warn(Ss.default.yellow(p)))})}};function tN(t,e){return wt(this,null,function*(){if(!bi.default.existsSync(t))throw console.error(`Path does not exist: ${t}`),new Dr("project path does not exist");let r=Ai.default.join(t,"zenstack","schema.zmodel"),n=!1;if(bi.default.existsSync(r))console.warn(Vi.default.yellow(`Model already exists: ${r}`));else{bi.default.existsSync(Ai.default.join(t,"zenstack"))||bi.default.mkdirSync(Ai.default.join(t,"zenstack")),bi.default.writeFileSync(r,`// This is a sample model to get you started.
6476
6476
  // Learn how to model you app: https://zenstack.dev/#/modeling-your-app.
6477
6477
 
6478
6478
  /*
@@ -6526,7 +6526,7 @@ model Post {
6526
6526
  Please check the following guide on how to model your app:
6527
6527
  https://zenstack.dev/#/modeling-your-app.
6528
6528
  `),console.log(Vi.default.green(`
6529
- Project initialized successfully!`))})}function AV(t,e){return wt(this,null,function*(){var a;let r=e.LanguageMetaData.fileExtensions;if(!r.includes(Ai.default.extname(t)))throw console.error(Vi.default.yellow(`Please choose a file with extension: ${r}.`)),new Dr("invalid schema file");if(!bi.default.existsSync(t))throw console.error(Vi.default.red(`File ${t} does not exist.`)),new Dr("schema file does not exist");let n=e.shared.workspace.LangiumDocuments.getOrCreateDocument(IT.URI.file(Ai.default.resolve(Ai.default.join(__dirname,"../res",_o)))),i=e.shared.workspace.LangiumDocuments.getOrCreateDocument(IT.URI.file(Ai.default.resolve(t)));yield e.shared.workspace.DocumentBuilder.build([n,i],{validationChecks:"all"});let o=((a=i.diagnostics)!=null?a:[]).filter(s=>s.severity===1);if(o.length>0){console.error(Vi.default.red("Validation errors:"));for(let s of o)console.error(Vi.default.red(`line ${s.range.start.line+1}: ${s.message} [${i.textDocument.getText(s.range)}]`));throw new Dr("schema validation errors")}return i.parseResult.value})}function nN(t){return wt(this,null,function*(){let e=Vk(tN.NodeFileSystem).ZModel,n={schema:yield AV(t.schema,e),outDir:Ai.default.dirname(t.schema)};try{yield new Pp().run(n)}catch(i){throw i instanceof eN.PluginError?(console.error(Vi.default.red(i.message)),new Dr(i.message)):i}})}var aN=(t,e)=>wt(void 0,null,function*(){yield ms.trackSpan("cli:command:start","cli:command:complete","cli:command:error",{command:"init"},()=>rN(t,e.packageManager))}),sN=t=>wt(void 0,null,function*(){yield ms.trackSpan("cli:command:start","cli:command:complete","cli:command:error",{command:"generate"},()=>nN(t))});function EV(){return wt(this,null,function*(){yield ms.trackSpan("cli:start","cli:complete","cli:error",{args:process.argv},()=>wt(this,null,function*(){let t=new _l.Command("zenstack");t.version(Hd().version,"-v --version","display CLI version");let e=oN.ZModelLanguageMetaData.fileExtensions.join(", ");t.description(`${iN.default.bold.blue("\u03B6")} ZenStack is a toolkit for building secure CRUD apps with Next.js + Typescript.
6529
+ Project initialized successfully!`))})}function bV(t,e){return wt(this,null,function*(){var a;let r=e.LanguageMetaData.fileExtensions;if(!r.includes(Ai.default.extname(t)))throw console.error(Vi.default.yellow(`Please choose a file with extension: ${r}.`)),new Dr("invalid schema file");if(!bi.default.existsSync(t))throw console.error(Vi.default.red(`File ${t} does not exist.`)),new Dr("schema file does not exist");let n=e.shared.workspace.LangiumDocuments.getOrCreateDocument(IT.URI.file(Ai.default.resolve(Ai.default.join(__dirname,"../res",_o)))),i=e.shared.workspace.LangiumDocuments.getOrCreateDocument(IT.URI.file(Ai.default.resolve(t)));yield e.shared.workspace.DocumentBuilder.build([n,i],{validationChecks:"all"});let o=((a=i.diagnostics)!=null?a:[]).filter(s=>s.severity===1);if(o.length>0){console.error(Vi.default.red("Validation errors:"));for(let s of o)console.error(Vi.default.red(`line ${s.range.start.line+1}: ${s.message} [${i.textDocument.getText(s.range)}]`));throw new Dr("schema validation errors")}return i.parseResult.value})}function rN(t){return wt(this,null,function*(){let e=Vk(eN.NodeFileSystem).ZModel,n={schema:yield bV(t.schema,e),outDir:Ai.default.dirname(t.schema)};try{yield new Pp().run(n)}catch(i){throw i instanceof QD.PluginError?(console.error(Vi.default.red(i.message)),new Dr(i.message)):i}})}var oN=(t,e)=>wt(void 0,null,function*(){yield ms.trackSpan("cli:command:start","cli:command:complete","cli:command:error",{command:"init"},()=>tN(t,e.packageManager))}),aN=t=>wt(void 0,null,function*(){yield ms.trackSpan("cli:command:start","cli:command:complete","cli:command:error",{command:"generate"},()=>rN(t))});function AV(){return wt(this,null,function*(){yield ms.trackSpan("cli:start","cli:complete","cli:error",{args:process.argv},()=>wt(this,null,function*(){let t=new _l.Command("zenstack");t.version(Hd().version,"-v --version","display CLI version");let e=iN.ZModelLanguageMetaData.fileExtensions.join(", ");t.description(`${nN.default.bold.blue("\u03B6")} ZenStack is a toolkit for building secure CRUD apps with Next.js + Typescript.
6530
6530
 
6531
- Documentation: https://zenstack.dev.`).showHelpAfterError().showSuggestionAfterError();let r=new _l.Option("--schema <file>",`schema file (with extension ${e})`).default("./schema.zmodel"),n=new _l.Option("-p, --package-manager <pm>","package manager to use").choices(["npm","yarn","pnpm"]);t.command("init").description("Set up a new ZenStack project.").addOption(n).argument("[path]","project path",".").action(aN),t.command("generate").description("Generates RESTful API and Typescript client for your data model.").addOption(r).addOption(n).action(sN),t.exitOverride(),yield t.parseAsync(process.argv)}))})}0&&(module.exports={generateAction,initAction});
6531
+ Documentation: https://zenstack.dev.`).showHelpAfterError().showSuggestionAfterError();let r=new _l.Option("--schema <file>",`schema file (with extension ${e})`).default("./schema.zmodel"),n=new _l.Option("-p, --package-manager <pm>","package manager to use").choices(["npm","yarn","pnpm"]);t.command("init").description("Set up a new ZenStack project.").addOption(n).argument("[path]","project path",".").action(oN),t.command("generate").description("Generates RESTful API and Typescript client for your data model.").addOption(r).addOption(n).action(aN),t.exitOverride(),yield t.parseAsync(process.argv)}))})}0&&(module.exports={generateAction,initAction});
6532
6532
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */